- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
09-29-2017 06:46 AM
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>
09-29-2017 07:09 AM
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'/>
09-29-2017 06:51 AM
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.
09-29-2017 07:01 AM
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>
09-29-2017 07:09 AM
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'/>
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!