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 | 108
Part no.9036931-00 Rev AA February 2021
'''
WorkflowName = "StefWorkflow"
WorkflowID = 0
Action = "OK"
WAIT = 1
res = emc_nbi.query(idQuery)
for workflow in res['workflows']['allWorkflows']:
if workflow['name'] == WorkflowName:
WorkflowID = workflow['id']
break
exeMutation = exeMutation.replace("<id>", str(WorkflowID)).replace("<state>", Action)
res = emc_nbi.mutation(exeMutation)
sleep(WAIT)
if res['workflows']['startWorkflow']['status'] == "SUCCESS":
execId = res['workflows']['startWorkflow']['executionId']
messageQuery = messageQuery.replace("<id>", str(execId))
info = emc_nbi.query(messageQuery)
print info['workflows']['execution']['variables'].get('workflowMessage')
else:
print res
You must include a wait timer after the execution of your workflow, so that it has enough time to
complete.
When you run your script, you should see the following output:
Script Name: NBI Workflow
Date and Time: 2020-06-29T19:32:46.221
XMC User: root
XMC User Domain:
IP: 192.168.56.126
"OK path has been followed"
On the Workflow Dashboard, you can see the same output.










