User guide

Using Python Web Services, CLI Scripting and OpenFlow
page 11-18 OmniSwitch AOS Release 7 Switch Management Guide March 2015
AOSConnection(string username, string password, string server, boolean secure, boolean
obeyproxy, boolean prettylinks, int port, AOSHeaders headers, boolean debug)
success() This method will return true if the previous operation succeeded. It
is a convenience method that will evolve to support all success
codes returned by future versions of the AOS API.
diag() This method can be used to retrieve a specific error code deliv-
ered by the Web Service Producer. It is not recommended to use it
to determine success or failure; the preferred approach is to invoke
'success()' first and, if it returns False, call 'diag()' to retrieve the
error code.
username AAA username; same as when using WebView.
password AAA user password
server The address of the device to connect to.
secure When True, SSL connections will be used.
default value: True
obeyproxy When True, system proxy settings will be followed.
default value: True
prettylinks When True, use semantically correct links as opposed to
'?a=b&c=d…'
default value: True
port The port where the Web Service Producer is expected to be avail-
able; typically 80 or 443; however, -1 can be used to specify the
use of the default port for secure/unsecure HTTP.
default value: -1
headers An object used to inject additional headers in the request if neces-
sary.
default value: None
debug When True, low-level GET, POST, PUT and DELETE
commands will be displayed in the current terminal.
default value: False