How to add V-Wire Subinterface via the API

Reply
L1 Bithead

How to add V-Wire Subinterface via the API

I've tried several different variations and I can't seem to figure out the API call to add a v-wire subinterface. What would the correct syntax be? 

Here's one example that I have tried: 

https://firewall/api/?type=config&key=KEY&action=set&xpath=/config/devices/entry[@name='localhost.localdomain']/network/interface/ethernet/entry[@name='ethernet1/14']/virtual-wire/units/&element=<entry name='ethernet1/14.5501'/> 

It gives me this: 

response status="error" code="13"> 
<msg> 
<line> 
set failed, may need to override template object first 
</line> 
</msg> 
</response>

L4 Transporter

Re: How to add V-Wire Subinterface via the API

The syntax is correct, but the error that you're getting is that you're overwriting something in a template pushed from Panorama, which would require action=override as opposed to action=set.

L1 Bithead

Re: How to add V-Wire Subinterface via the API

That's weird, because I don't have Panorama.  When I try action=override I get this:

 

<response status="error" code="12">
<msg>
<line>Object cannot be overridden</line>
</msg>
</response>

L1 Bithead

Re: How to add V-Wire Subinterface via the API

I figured it out.  I had a / after units.  After removing that the set action worked.

 

Before:

https://firewall/api/?type=config&key=KEY&action=set&xpath=/config/devices/entry[@name='localhost.localdomain']/network/interface/ethernet/entry[@name='ethernet1/14']/virtual-wire/units/&element=<entry name='ethernet1/14.5501'/> 

 

Working:

https://firewall/api/?type=config&key=KEY&action=set&xpath=/config/devices/entry[@name='localhost.localdomain']/network/interface/ethernet/entry[@name='ethernet1/14']/virtual-wire/units&element=<entry name='ethernet1/14.5501'/> 

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!