cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Who Me Too'd this topic

Problems overriding a Panorama template via the XML API

L0 Member

I'm trying to disable via the XML API a IPSEC tunnel on a firewall which was configured using Panorama. I can manage to disable a locally created tunnel with the following GET request:

 

https://CENSORED/api/?key=CENSORED&type=config&action=edit&xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='CENSORED']/disabled&element=<disabled>yes</disabled>

 

However when I change the action from edit to override it gives me a seemingly nonsensical and contradictory error:

 

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

 

According to the documentation, error code 12 means an invalid xpath or element. I dont think this is accurate considering that the xpath and element work fine when the action is edit. And the message doesnt make sense considering that I can override this object via the web UI. Is anyone here familiar with doing overrides via the XML API and know what i'm doing wrong? 

 

And if I use the debug cli on on command and create an override via the CLI, it tells me XML request is

<request cmd="override" obj="/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='Azure-DR']" cookie="9297669682826545"></request>

According to this KB article, the GET request should be

https://CENSORED/api/?key=CENSORED&type=config&action=override&xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='CENSORED']&element=

But that gives me the error:

<response status="error" code="400">
<result>
<msg>Missing value for parameter "element".</msg>
</result>
</response>

If I remove the element parameter it gives me the same error, and any value I specify for the element parameter gives me the error :

<response status="error" code="12">
<msg>
<line>Request doesn't have an object to be added</line>
</msg>
</response>
Who Me Too'd this topic