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 | 106
Part no.9036931-00 Rev AA February 2021
192.168.56.123 IP Campus_08:00:27:C5:83:32
192.168.56.127 sw7
192.168.56.128 sw8
192.168.56.11 192.168.56.11
192.168.56.141 voss01
192.168.56.122 IP Campus_08:00:27:2A:B1:DF
5.3.6 Use NBI to Execute a Workflow
So far, NBI examples have been created mostly from the network field. This example uses the workflows
field.
To execute a workflow from the NBI, you need to know the ID of the workflow you want to run, and you
need to do a mutation.
Initiate a query to see the IDs for all existing workflows, as shown:
{
workflows {
allWorkflows {
id
name
}
}
}
Even if there is a limited number of user workflows, this query returns most of them, including system
workflows.
Reuse your workflow with the “OK/KO” path selection, but this time the you execute the script from an
NBI CALL. In this workflow, initially you only print the path that has been followed. Instead of doing a
print of the message, set workflowMessage to the value you need. This message is displayed on the
Workflow Dashboard when a workflow is successfully executed.
Rewrite the line of code in the output script of OK path to say:
emc_results.put("workflowMessage", "OK path has been followed")
Modify the KO path as well. Now, each time this workflow is successfully executed, it will print the
corresponding message in the message column in the Workflow Dashboard.
Now write a quick script using the NBI to execute this workflow. First find the ID of your workflow, then
execute your workflow, setting MyVariable to either OK or KO. Next, validate the execution of your
workflow and print the result.
The example below uses the Python string replace method to adapt your GraphQL CALLs with your
dynamic values.










