10-31-2019 10:03 AM
I was playing around with python to pull the Alarm Database from the VSPs and send it per email. So far good, but I don’t want to choose the devices where to run the workflow but to handle that in the script. I know when removing the device variable, XMC does not ask to choose a device. I was trying do achieve something with emc_vars[“family”], but had no success. Anybody a hint for that?
11-07-2019 11:54 AM
If you need sample code feel free to have a look at https://gitlab.com/bell-computer-netzwerke/xmc-nbi-clients/blob/master/Python/DeviceLister/DeviceLis... or the fork at https://github.com/rbrt-weiler/xmc-nbi-clients/blob/master/Python/DeviceLister/DeviceLister.py - this is a simple script that connects to the NBI, pulls a list of all devices and prints them to the CLI along with up/down information. The query that is included in the script should also suffice for looping over all VSP devices by using the device family for the loop.
11-01-2019 02:46 PM
There is no such query = “give me all VSP devices”.
but you can ask for all devices IP+family and process the answer in the loop.
11-01-2019 09:22 AM
Thanks for your example, I’m trying the opposite to get the IP’s from all VSP Series devices. I found the https://<xmc server>:8443/nbi/graphiql/index.html which is very helpful, but I’m still not able to create the right query.
11-01-2019 03:25 AM
here is your query:
{
network {
device(ip: "192.168.130.1") {
deviceDisplayFamily
}
}
}
here is how response look like:
{
"data": {
"network": {
"device": {
"deviceDisplayFamily": "Summit Series"
}
}
}
}
check the similar request here.