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 | 38
Part no.9036931-00 Rev AA February 2021
06/07/2020 14:06:37.002965 [200] <test:testbuf> Begin trace buffer
06/07/2020 14:06:54.479653 [221] <test:testbuf> INFO:test:event_cb.15::
{'meta': {'action': 'create', 'timestamp': 1591538814.48, 'object': 'vlan',
'id': 'exos.vlan.create'}, 'data': {'vr_name': 'VR-Default', 'vlan_name':
'VLAN_0010'}}
06/07/2020 14:06:54.485521 [224] <test:testbuf> INFO:test:event_cb.15::
{'meta': {'action': 'create', 'timestamp': 1591538814.49, 'object': 'vlan',
'id': 'exos.vlan.create'}, 'data': {'vr_name': 'VR-Default', 'vlan_name':
'VLAN_0011'}}
06/07/2020 14:06:54.491825 [227] <test:testbuf> INFO:test:event_cb.15::
{'meta': {'action': 'create', 'timestamp': 1591538814.49, 'object': 'vlan',
'id': 'exos.vlan.create'}, 'data': {'vr_name': 'VR-Default', 'vlan_name':
'VLAN_0012'}}
06/07/2020 14:15:16.676949 [230] <test:testbuf> INFO:test:event_cb.15::
{'meta': {'action': 'update', 'timestamp': 1591539316.68, 'object': 'vlan',
'id': 'exos.vlan.update'}, 'data': {'added': False, 'type': 'port', 'port':
(0, 0, 0), 'vlan_name': 'VLAN_0042'}}
06/07/2020 14:15:16.677836 [233] <test:testbuf> INFO:test:event_cb.15::
{'meta': {'action': 'update', 'timestamp': 1591539316.68, 'object': 'vlan',
'id': 'exos.vlan.update'}, 'data': {'added': True, 'type': 'port', 'port':
(1, 1, 0), 'vlan_name': 'VLAN_0012', 'vlan_id': 12}}
3.1.2.3 Add Proper Environment Validation
To demonstrate environment validation in more detail, first write another application with the basic
checks any program should contain. Processes run in the expy environment, so when you write an
application, make sure you are running in that environment.
def main():
# Verify you are running under EXPY. You can't live without it.
if not hasattr(sys, 'expy') or not sys.expy:
print "Must be run within EXPY"
return
Write a new App. This example uses the CLI method for illustration, as this is a common CALL for an App.
exos.api.exec_cli(cmds, timeout=0, ignore_errors=False)
Parameters:
- cmds: list of strings containing valid EXOS CLI command
- timeout: defaults to 0. This is a synchronous CALL, and the timeout tells the system how long it
should wait for a return
- ignore_errors: Boolean. If set to False, which is the default, execution will stop after the first
failed command
Returns: The output of the command: string










