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 | 94
Part no.9036931-00 Rev AA February 2021
5.3.1 emc_nbi
The emc_nbi Python object includes several functions and methods. As of XMC 8.4.4, the example below
shows what is available:
print dir(emc_nbi)
The output is:
['__class__', '__copy__', '__deepcopy__', '__delattr__', '__doc__',
'__ensure_finalizer__', '__eq__', '__format__', '__getattribute__',
'__hash__', '__init__', '__ne__', '__new__', '__reduce__', '__reduce_ex__',
'__repr__', '__setattr__', '__str__', '__subclasshook__', '__unicode__',
'class', 'equals', 'example1', 'example2', 'getClass', 'getName', 'hashCode',
'mutation', 'name', 'notify', 'notifyAll', 'query', 'toString', 'wait']
The two methods that you will use the most are query and mutation.
Note: It is possible to use the query method for mutation, but you will use each method for their
respective usage for clarity. However, only the query method supports graphql variables, as presented
here: HTTPS://graphql.org/learn/queries/#variables.
Use query to access the XMC database as read-only, and mutation to edit (write) to the database.
Note: When using mutation, be careful not to corrupt the XMC database. The best practice is to always
have a backup of your database.
5.3.2 GraphQL Query
XMC integrates GraphQL, an interface that lets you test queries and view the output. You can access
GraphQL at the following URL on a given XMC server:
HTTPS://<xmc server IP>:8443/nbi/graphiql/index.html
You use the GraphQL NBI to create queries that retrieve information.
Note: The GraphiQL interface can also be accessed from XMC, in the following menu: Administration >
Diagnostics > Server > Server Utilities > NBI Explorer.










