cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1997
Views
5
Helpful
3
Replies

Prime 3.2 API: How to deploy a cli job to configure multiple ports on multiple devices

Hi,

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):

interface $interface

switchport mode access

switchport access vlan $vlan

Then I tried to create the job via HTTP PUT:

URL: https://[PRIME]/webacs/api/v3/op/cliTemplateConfiguration/deployTemplateThroughJob

Body:

<cliTemplateCommand>

     <targetDevices>

          <targetDevice>

               <targetDeviceID>1234567890</targetDeviceID>

                    <variableValues>

                         <variableValue>

                              <name>interface</name>

                              <value>GigabitEthernet0/1</value>

                         </variableValue>

                         <variableValue>

                              <name>vlan</name>

                              <value>99</value>

                         </variableValue>

                    </variableValues>

               </targetDevice>

               <targetDevice>

                    <targetDeviceID>1234567890</targetDeviceID>

                         <variableValues>

                              <variableValue>

                                   <name>interface</name>

                                   <value>GigabitEthernet0/2</value>

                              </variableValue>

                              <variableValue>

                                   <name>vlan</name>

                                   <value>99</value>

                              </variableValue>

                         </variableValues>

                    </targetDevice>

               </targetDevices>

          <templateName>TestTemplate</templateName>

</cliTemplateCommand>

Now the problem is, that I can't use the defined variables for multiple interfaces. Any Ideas?

Thx

3 Replies 3

leesa9char
Level 1
Level 1

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.

Hi leesa9char

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.

Hi Jonas,

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: