Cisco Cisco Prime Home 6.3 开发者指南

下载
页码 78
Cisco Prime Home – Integration Guide
 
 
OL-28557-01   v5.0.1
 
12 
• 
• 
•  Richardson, Ruby RESTful Web Services. O'Reilly 2007 
Kinds of Resources  
A resource generally comes in one of 3 flavors: a single item, a list of items, or a 
process. Depending on the kind of resource, the semantics of the various 
supported methods can be slightly different.
 
Single Item  
Interacting with a single resource is the most common. In this case a single 
document is sent to and from the server. Typically, a resource can be retrieved, 
modified and sent back to the server to update the resource's state.
 
Lists  
A list resource can act as a table of contents for sub-ordinate resources which 
can filtered, searched, sorted and paginated. New sub-ordinate resources can 
be created by appending (via POST) to a list resource.  
Processes  
Resources do not always have to be objects or state-centric. System processes 
can also be exposed as a resource and are typically interacted with using the  
POST method. 
 
Compared with SOAP 
•  REST tends to focus on data, SOAP tends to focus on operations.  
•  SOAP is a much more strictly defined standard, REST is far less formal.  
•  REST services tend to be easier to access because any HTTP tool can interact 
with them. SOAP requires a richer toolset to make interaction easy. 
 
•  SOAP is designed to be transport-layer independent. REST is HTTP. 
 
JSON 
JavaScript Object Notation is the data format primarily used by ClerVision's APIs. 
The format is easy to produce and consume and is largely schema-less. The 
Content-Type to use when sending or receiving JSON data is 'application/json'.