User guide
Web Services, CLI Scripting and OpenFlow Web Services REST Examples
OmniSwitch AOS Release 7 Switch Management Guide March 2015 page 11-5
Web Services REST Examples
All requests are performed through a URL being in accordance with the principles of REST. The follow-
ing elements are used to build the REST URL
Query Structure
• Endpoint: <http|https>://<device ip>
• Unified Syntax: <endpoint>/<domain>/<URN>
<var 1> .. <var n>
JSON or XML
The response format can be returned in either JSON or XML.
GET https://192.168.1.1/auth/?&username=admin&password=switch
Accept: application/vnd.alcatellucentaos+json
Response Elements
domain Shows how the Producer interpreted the domain parameter; in most instances, it will
be the same domain passed by the Consumer plus some internal information
diag This integer will be a HTTP standard diagnostic code:
• A 2xx value if the command was successful; in most cases '200' will be
used.
• A 3xx value if a resources was moved (not implemented).
• A 4xx value if the request contained an error; e.g. '400' in case of failed
authentication.
• A 5xx value if the server encountered an internal error such as a resource
error.
error May be a string, containing a clear text error message. It may also be an array of
such strings in case the Producer found multiple problems with a request.
output In some instances, the subsystem being queried may wish to return a "blob of text"
and this variable will contain it.
data If a GET request is issued this variable should contain the values being queried in a
structured form.