User guide
Web Services, CLI Scripting and OpenFlow Using Python
OmniSwitch AOS Release 7 Switch Management Guide March 2015 page 11-17
PYTON APIs - Quick Reference
AOSAPI (AOSConnection connection)
Connection is an AOSConnection object being injected into AOSAPI. The client implementer can write
their own connection class and use it instead.
Methods
login() Invoke this method to log in to the Web Service. A cookie will be
created.
logout() Invoke this method to log out from the Web Service. If a cookie
exists, it be destroyed.
query(domain, urn, args Invoke this method to perform a "show" query or run a CLI
command.
domain - the semantic domain being accessed. when accessing
mibs, it can be 'mib' if performing a 'show' command; it can be
'info' to retrieve information on a mib table (helpful when
developing new queries); when running a CLI command, domain
must be 'cli';
urn - represents the "address" of the entity being accessd: when
accessing mibs, it will typically be a mib table name;when running
a CLI command, it will represent the CLI type being used; in
version 1, only one type is available: 'AOS'
args - is a dictionary of key->value pairs where each respective
key's name if 'mibObjectx' and the trailing x is a value ranging
from 0 to (max number of arguments - 1): when accessing mibs,
the values will typically be the name of the table columns being
accessed; when running a CLI command, the dictionary will
contain only one element, named 'cmd'; its value will be the
command's plain text representation followed by an equal sign
('='), followed by the value being used for filtering results.
put(domain, urn, args) Invoke this method to create a new object. It is not a valid
command when using the 'cli' domain.
domain - is the same as described in the 'query()' section, except
'cli' is not supported.
urn - is the same as described in the 'query()' section, except no
cli-related value is supported.
args - is a dictionary of key->value pairs as described in the
'query()' section, with a major difference: the values will be
composed of a column name, followed by a column, followed by
the value being set;
post(domain, urn, args) Invoke this method to update an existing object. Arguments are the
same as described in the 'put()' section with one semantic differ-
ence: values specified for columns that belong to a table index will
be used to, first, find the row matching this index, then update the
value of the non-index columns specified in this query.
delete(domain, urn, args) Invoke this method to delete an object. Arguments are the same as
described in the 'post()' section; however, non-index columns will
be ignored.