cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Run a workflow on multiple devices, one after the other

Run a workflow on multiple devices, one after the other

Nealo
New Contributor
Hello,

I have a workflow that finds a given VLAN (with a prompted variable), and duplicates it with another ID if it exists. However, I have two things that I would love to implement, but haven't found anything that shows me it's possible.

1 - Is there a way to start the workflow on multiple devices, but it does them one by one, and not at the same time ?
As I have multiple python scripts or signals, the workflow is executed steps by steps on all the devices. So when storing information in a variable, it mixes between the devices and I don't have the correct result at the end.
Maybe it's possible to create workflow variable from script, but don't know how to play with variable outside of emc_vars.get() and emc_results.put().

I guess I could make a GateWay to make a loop, while checking the list of all the selected devices, and increasing an index until it's out of the devices_list's length. But maybe there is a more practical way.


2 - Is it possible to add a variable (like the Device name) in an Event's message ?
It would be to say "VLAN 3 was correctly added on the device : Device3", or messages like that.


Thanks a lot already for the answers.
Would happily discuss about it more in details.
1 ACCEPTED SOLUTION

Zdeněk_Pala
Extreme Employee
here is example for the device name/nickname NBI call

code:
varDeviceIP = "10.8.255.15"
varQuery = '''query{network{device(ip:"%s"){name,nickName}}}''' %varDeviceIP
varResult = emc_nbi.query(varQuery)
varName = varResult['network']['device']['name']
varNickName = varResult['network']['device']['nickName']
Regards Zdeněk Pala

View solution in original post

7 REPLIES 7

Zdeněk_Pala
Extreme Employee
here is example for the device name/nickname NBI call

code:
varDeviceIP = "10.8.255.15"
varQuery = '''query{network{device(ip:"%s"){name,nickName}}}''' %varDeviceIP
varResult = emc_nbi.query(varQuery)
varName = varResult['network']['device']['name']
varNickName = varResult['network']['device']['nickName']
Regards Zdeněk Pala

Nealo
New Contributor


Thanks for those infos. I have to look into it.
Would love some examples though, so I can have a better idea on how it works.

Zdeněk_Pala
Extreme Employee
Number one: store variables from one activity to other activity = the information is not overwritten.
This can be done if you define variable scope as activity instead of workflow.

Number two: using device name.
You can use NBI to get information from XMC database to workflow.

Let me know if you need some examples. Next week I should be able to give you hints.
Regards Zdeněk Pala
GTM-P2G8KFN