29.04.2019 Views

OS6860(E)_AOS_8.1.1.R01_Switch_Management_Guide

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Using Python<br />

PYTON APIs - Quick Reference<br />

<strong>AOS</strong>API (<strong>AOS</strong>Connection connection)<br />

Connection is an <strong>AOS</strong>Connection object being injected into <strong>AOS</strong>API. The client implementer can write<br />

their own connection class and use it instead.<br />

Methods<br />

login()<br />

logout()<br />

query(domain, urn, args<br />

Invoke this method to log in to the Web Service. A cookie will be<br />

created.<br />

Invoke this method to log out from the Web Service. If a cookie<br />

exists, it be destroyed.<br />

Invoke this method to perform a "show" query or run a CLI<br />

command.<br />

domain - the semantic domain being accessed. when accessing<br />

mibs, it can be 'mib' if performing a 'show' command; it can be<br />

'info' to retrieve information on a mib table (helpful when<br />

developing new queries); when running a CLI command, domain<br />

must be 'cli';<br />

urn - represents the "address" of the entity being accessd: when<br />

accessing mibs, it will typically be a mib table name;when running<br />

a CLI command, it will represent the CLI type being used; in<br />

version 1, only one type is available: '<strong>AOS</strong>'<br />

put(domain, urn, args)<br />

args - is a dictionary of key->value pairs where each respective<br />

key's name if 'mibObjectx' and the trailing x is a value ranging<br />

from 0 to (max number of arguments - 1): when accessing mibs,<br />

the values will typically be the name of the table columns being<br />

accessed; when running a CLI command, the dictionary will<br />

contain only one element, named 'cmd'; its value will be the<br />

command's plain text representation followed by an equal sign<br />

('='), followed by the value being used for filtering results.<br />

Invoke this method to create a new object. It is not a valid<br />

command when using the 'cli' domain.<br />

domain - is the same as described in the 'query()' section, except<br />

'cli' is not supported.<br />

urn - is the same as described in the 'query()' section, except no<br />

cli-related value is supported.<br />

post(domain, urn, args)<br />

delete(domain, urn, args)<br />

args - is a dictionary of key->value pairs as described in the<br />

'query()' section, with a major difference: the values will be<br />

composed of a column name, followed by a column, followed by<br />

the value being set;<br />

Invoke this method to update an existing object. Arguments are the<br />

same as described in the 'put()' section with one semantic difference:<br />

values specified for columns that belong to a table index will<br />

be used to, first, find the row matching this index, then update the<br />

value of the non-index columns specified in this query.<br />

Invoke this method to delete an object. Arguments are the same as<br />

described in the 'post()' section; however, non-index columns will<br />

be ignored.<br />

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

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

Saved successfully!

Ooh no, something went wrong!