29.04.2019 Views

OS6860(E)_AOS_8.1.1.R01_Switch_Management_Guide

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Web Services, CLI Scripting, and OpenFlow<br />

Web Services REST Examples<br />

Web Services REST Examples<br />

All requests are performed through a URL being in accordance with the principles of REST. The following<br />

elements are used to build the REST URL<br />

Query Structure<br />

• Endpoint: ://<br />

• Unified Syntax: //<br />

.. <br />

JSON or XML<br />

The response format can be returned in either JSON or XML.<br />

GET https://192.168.1.1/auth/?&username=admin&password=switch<br />

Accept: application/vnd.alcatellucentaos+json<br />

Response Elements<br />

domain<br />

diag<br />

Shows how the Producer interpreted the domain parameter; in most instances, it will<br />

be the same domain passed by the Consumer plus some internal information<br />

This integer will be a HTTP standard diagnostic code:<br />

• A 2xx value if the command was successful; in most cases '200' will be<br />

used.<br />

• A 3xx value if a resources was moved (not implemented).<br />

• A 4xx value if the request contained an error; e.g. '400' in case of failed<br />

authentication.<br />

error<br />

output<br />

data<br />

• A 5xx value if the server encountered an internal error such as a resource<br />

error.<br />

May be a string, containing a clear text error message. It may also be an array of<br />

such strings in case the Producer found multiple problems with a request.<br />

In some instances, the subsystem being queried may wish to return a "blob of text"<br />

and this variable will contain it.<br />

If a GET request is issued this variable should contain the values being queried in a<br />

structured form.<br />

Omni<strong>Switch</strong> <strong>AOS</strong> Release 8 <strong>Switch</strong> <strong>Management</strong> <strong>Guide</strong> May 2014 page 10-5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!