Extreme API with Python
Table Of Contents
- 1 Preface
- 2 Introduction
- 3 EXOS APIs
- 4 VOSS API
- 5 XMC API
- 6 ExtremeCloud IQ API
- 7 Extreme Campus Controller API
Extreme API with Python
Page | 62
Part no.9036931-00 Rev AA February 2021
jboss.http.port
jboss.server.log.dir
jboss.bind.address
jboss.bind.address.management
jboss.HTTPS.port
STATUS
USE_IPV6
extreme.hideLegacyDesktopApps
The ports variable returns a string containing all the ports, separated by commas.
5.1.6.2 emc_cli.send()
Another tool provided by XMC is the emc_cli.send() Python object. This object accepts several
parameters. The first parameter is a string containing the CLI command, the second parameter is a
Boolean value that enables you to choose to wait for a system or shell prompt, or not wait. If you set the
Boolean value to False, no CLI output is returned. The Boolean value is optional, and the default is True.
A third (optional) parameter is a timer, in seconds, to wait for information if needed.
There are several ways to use this Python object to retrieve information from CLI command execution:
- isSucces(): Boolean to represent outcome of the last command
- getError(): if it fails, contains the error as a string
- getOutput(): output captured or echoed back from the device (including the CLI command
prompt) as a string
isSuccess()does not indicate whether the CLI command was successful or not, but it does show
whether the send() has been completed correctly. The script handles the result of this CLI command
by analyzing the CLI output.
For example:
# executes a show vlan command and prints the output
cli_results = emc_cli.send("show vlan")
cli_output = cli_results.getOutput()
print cli_output
# creates a dummy UPM profile
emc_cli.send("create upm profile \"Test\"", False)
emc_cli.send("Test", False)
cli_results = emc_cli.send(".")
# example of using timer – waiting for 3 seconds
emc_cli.send("show config", False, 3)
In this example, EXOS is the NOS. This is not restricted to one specific NOS. Any other NOS is eligible, if
the device is accessible from XMC with a correct CLI Profile.










