{ "restSchemaVersion": "1.0", "errors": [ { "error_id": "REQUEST_INVALID_INPUT", "description": "The request is invalid", "http_status": 400 }, { "error_id": "AUTH_REQUIRED", "description": "Missing authentication credentials", "http_status": 401 }, { "error_id": "AUTH_INVALID_CREDENTIALS", "description": "Invalid user name or password", "http_status": 401 }, { "error_id": "AUTH_INVALID_SESSION", "description": "The authentication session has timed out or is invalid", "http_status": 401 }, { "error_id": "AUTH_EXPIRED_PASSWORD", "description": "Account password has expired", "http_status": 401 }, { "error_id": "AUTH_INVALID_CODE", "description": "The Oauth access code is invalid", "http_status": 401 }, { "error_id": "AUTH_EXPIRED_TOKEN", "description": "The Oauth token has expired", "http_status": 401 }, { "error_id": "AUTH_EXPIRED_CODE", "description": "The Oauth access code has expired", "http_status": 401 }, { "error_id": "AUTH_DISABLED_ACCOUNT", "description": "Account has been disabled", "http_status": 403 }, { "error_id": "AUTH_FORBIDDEN", "description": "Account does not have privileges for this request", "http_status": 403 }, { "error_id": "AUTH_INVALID_TOKEN", "description": "The Oauth token is invalid", "http_status": 403 }, { "error_id": "RESOURCE_NOT_FOUND", "description": "The requested resource was not found", "http_status": 404 }, { "error_id": "HTTP_INVALID_METHOD", "description": "The requested method is not supported by this resouce", "http_status": 405 }, { "error_id": "INTERNAL_ERROR", "description": "Internal error occurred", "http_status": 500 } ], "name": "common", "title": "Riverbed Cascade Shark Common REST API", "description": "This document describes version 1.0 of the Riverbed Common REST API as implemented by Cascade Shark systems.\n\nThe Common REST API is used to obtain general system information and for authentication. \n\nIt is assumed that the reader has practical knowledge of RESTful APIs, so the documentation does not go into detail about what REST is and how to use it. Instead the documentation focuses on what data can be accessed or modified, how to access it, and how to encode requests and responses.\n\nThe Resources section lists the supported REST resources and the methods supported on these resources. For each operation, the document describes what the operation does, the specific HTTP method and URL used, the data types used for requests and responses (if any) and any required or optional URL parameters.\n\nThe Errors section lists the various error codes that may be returned from REST API operations.\n\n### Data Encoding\n\nMost resources exposed by the API support both XML and JSON encoding for requests and responses. The selection of the specific encoding is accomplished through the use of HTTP headers.\n\nThe Accept header should be included with all API requests, and it is used to control the encoding of the response body. To specify XML encoding, the header should be set to Accept: text/xml, and to specify JSON encoding, the header should be set to Accept: application/json. If the Accept header is omitted, the default encoding is XML.\n\nThe Content-Type header must be included with all PUT or POST requests that include a request body. To specify XML encoding, the header should be set to Content-Type: text/xml. To specify JSON encoding, the header should be set to Content-Type: application/json.\n\nSome resources support alternative content types for requests and responses, as identified in the specific resource documentation below. \n\n### Authorization\n\nThis common API and other service-specific APIs support various methods of user authentication and authorization.\n\n* **BASIC** (*HTTP Basic Authentication*): The username and password are passed using the Authorization HTTP header in each request.\n\n* **COOKIE** (*Cookie-based Session Authentication*): A valid username and password combination are transmitted in an explicit login request which returns a session identifier. Subsequent requests include this session identifier as a HTTP cookie.", "version": "1.0", "defaultAuthorization": "not required", "servicePath": "/api/common/1.0", "resources": { "information": { "methods": { "ping": { "path": "ping", "description": "Check availability of the system", "httpmethod": "GET" }, "list services": { "path": "services", "response": { "items": { "description": "Description of an available service", "type": "object", "id": "service", "properties": { "id": { "required": true, "type": "string", "description": "Identifier for the service" }, "versions": { "items": { "type": "string", "id": "version" }, "required": true, "type": "array", "description": "Available versions for service 'id'" } } }, "example": [ { "id": "common", "versions": [ "1.0" ] }, { "id": "shark", "versions": [ "3.2", "4.0" ] } ], "type": "array", "description": "List of common services available on this Shark", "id": "services" }, "description": "List the service identifier and version for the various API services available on this system.", "httpmethod": "GET" }, "get system information": { "path": "info", "response": { "id": "info", "properties": { "sw_version": { "required": true, "type": "string", "description": "Software version of this Shark" }, "hw_version": { "required": false, "type": "string", "description": "Hardware version of this Shark (does not apply to Shark VE)" }, "device_name": { "required": true, "type": "string", "description": "Host name for this Shark" }, "mgmt_addresses": { "items": { "type": "string", "id": "address" }, "required": true, "type": "array", "description": "Management IP addresses for this Shark" }, "serial": { "required": true, "type": "string", "description": "Serial number of this Shark" }, "model": { "required": true, "type": "string", "description": "Model of this Shark" } }, "type": "object", "description": "General information about this Shark", "example": { "mgmt_addresses": [ "172.16.222.131" ], "sw_version": "10.0.0000.0000", "serial": "N/A", "model": "vShark", "device_name": "my_shark" } }, "description": "Get basic information about the system, including version, model, and management addresses.", "httpmethod": "GET" } } }, "authentication": { "methods": { "login": { "path": "login", "response": { "id": "login", "properties": { "session_key": { "required": true, "type": "string", "description": "Cookie name used to identify the session" }, "session_id": { "notes": "Should be set as the value of the 'session_key' cookie", "required": true, "type": "string", "description": "Unique session identifier ID" } }, "type": "object", "description": "Information available in response to a successful login", "example": { "session_key": "pilot_session_id", "session_id": "b9d2e3b2-32b7-11e2-b4da-000c29c8cc69" } }, "request": { "id": "login", "properties": { "username": { "required": true, "type": "string", "description": "The user account to log in with" }, "password": { "required": true, "type": "string", "description": "The password of the given account" }, "purpose": { "notes": "Should only be included if specify_purpose is enabled in the auth_info structure", "required": false, "type": "string", "description": "The stated purpose of the login session" } }, "type": "object", "description": "Login request information for a Shark session", "example": { "username": "user1", "password": "MyPassWord", "purpose": "Logging in to test this Shark." } }, "description": "Authenticate to the system for session-based authentication. The response will include the information needed to construct a session cookie, and will also include the Set-Cookie HTTP header.", "httpmethod": "POST" }, "authentication info": { "path": "auth_info", "response": { "id": "auth_info", "properties": { "supported_methods": { "items": { "enum": [ "BASIC", "COOKIE", "OAUTH_2_0" ], "type": "string", "id": "method", "description": "Authentication method" }, "required": true, "type": "array", "description": "Available authentication methods" }, "specify_purpose": { "required": true, "type": "boolean", "description": "Indication if the user should be prompted to include a purpose with the login request" }, "login_banner": { "required": true, "type": "string", "description": "Banner to be displayed on login page" } }, "type": "object", "description": "Information about authentication protocols", "example": { "supported_methods": [ "BASIC", "COOKIE", "OAUTH_2_0" ], "specify_purpose": false, "login_banner": "" } }, "description": "Get information required to authenticate to the system.", "httpmethod": "GET" }, "logout": { "path": "logout", "description": "Log out from the system. The request must include a session cookie and will invalidate that cookie for future requests.", "authorization": "required", "httpmethod": "POST" } } } }, "schemas": {} }