How to add V-Wire Subinterface via the API

Announcements

Changes to the LIVEcommunity experience are coming soon... Here's what you need to know.

Reply
jslabaugh1
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>


Accepted Solutions
jslabaugh1
L1 Bithead

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'/> 

View solution in original post


All Replies
nigelswift
L4 Transporter

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.

jslabaugh1
L1 Bithead

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>

jslabaugh1
L1 Bithead

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'/> 

View solution in original post

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 LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!