Responses

Responses are in the form of an XML or JSON document, as determined by the client’s accept header value/MIME type. This flexible output makes the output data easy to integrate into client development. Responses are defined by Response.xsd schema.
casp941
Responses are in the form of an XML or JSON document, as determined by the client’s accept header value/MIME type. This flexible output makes the output data easy to integrate into client development. Responses are defined by Response.xsd schema.
The
Web Services API supports both application/xml and application/json MIME types in the accept header. If you choose JSON as output, you may need to parse it out and produce XML for the next request.
The following describes elements of a response output:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <resource-response-list xmlns="http://www.ca.com/spectrum/restful/schema/response" error="<msg>" throttle="<num>" total-resource="<num>"> <resource-responses> ... </resource-responses> <link rel="next" href="http://<hostname><:portnumber>/spectrum/restful/alarms?id=<result_set_ID>&start=3&throttlesize=<num>" type="application/xml" /> </resource-response-list>
  • error="<
    msg
    >"
    Indicates the overall success or failure of the operation. If there is a failure, additional information is provided. "EndOfResults" indicates that all items in the result set have been returned.
  • throttle="<
    num
    >"
    Indicates the number of items returned in this response, as specified by the throttlesize parameter on the request. If the throttle number is less than the total results found by the server, a "next" link is provided. If the complete set of data is returned, there is no "next" link.
  • total-
    resource
    ="<
    num
    >"
    Indicates the total number of items in the result set.
    Resource
    varies depending on the type of request (for example, alarms, landscape, model, models).
  • link rel="next" href="<
    URL
    >"
    The "next" link appears only if additional items remain in the result set.
    Indicates that additional items remain in the result set and provides the URL to obtain them according to the throttle value. This link conforms to the HATEOAS (Hypermedia as the Engine of Application State) constraints and can be used in a client or a browser to issue the "next" request. By using this link, the full cost of the original call is avoided. The location is cached on the OneClick server and expires after ten minutes of inactivity. After expiration, the URL returns the string "The cursor is no longer valid".
    Each RESTful call has its own cache.
    The following parameters appear in the generated URL:
    • id=<
      result_set_ID
      >
      Specifies the location of the result set on the OneClick server. The data expires after ten minutes of inactivity.
    • start=<
      element_num
      >
      Indicates the start position within the result set.
    • throttlesize
      Indicates the number of items to return in the next response.
    The format of the parameters within the generated link may vary depending on your environment. For example, "&" may be generated as "&amp;" This is due to differences between XML, HTTP, and JSON formatting standards.