I'm trying to find a solution to configure multiple interfaces on multiple devices via a Prime Deployment Job which is defined in a Feature Template. Actually I tried to deploy a configuration with 2 variables (interface, vlan):
switchport mode access
switchport access vlan $vlan
Then I tried to create the job via HTTP PUT:
Now the problem is, that I can't use the defined variables for multiple interfaces. Any Ideas?
Your post isn't clear but are you saying that you can't use this API to roll out config to multiple interfaces of different devices or multiple interfaces of the same device?
Your targetDeviceIDs are different, even though they're dummy IDs but that's makes me think you're referring to interfaces on different devices. I've just started using this particular API this week and have rolled out config changes across different interfaces - specified via variable same as you have and it seems to be working successfully so far.
But rolling out config to multiple interfaces of the same device..... I'm having that problem too. The only config that's updated is that of the last variable. I'm having to construct multiple JSON strings if I have a device with multiple interfaces that I want to configure, and then issue them via a separate PUT to the API.
I've tried an additional variableValue, an additional targetDeviceId (with the same number), and even an additional cliTemplateCommand within the same API call. Although mine is in JSON and not XML, I'm having the same issue.
What is the actual error you're receiving? If you haven't set up the other API to grab the job status details you can log in and go to Administration -> Job Dashboard -> User Jobs and then go find your job. The Job Summary may take a few seconds to load but it should list an error there which explains what its gripe was with your submitted configuration.
Your description or behavior respectivly is exactly the same in my case.
I was able to deploy a configuration to multiple devices, but only to one interface per device. If more than one interface needs to be configured, only the last interface in the request-body is configured (as you mentioned).
I also opened an SR because of this.
Hopefully there will be a solution. Otherwise I need to create seperate jobs for every interface (100+) which in my opinion is not very comfortable.
You need change your script code to use $interface variable as an Arraylist instead of a string literal, then use a loop to get all list elements.
Thus you can configure multiple interfaces per device.