Explicitly retrieving running or candidate config via XML API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

Explicitly retrieving running or candidate config via XML API

Not applicable

If I understand correctly, the XML API can be used to retrieve and edit the latest version of the config, whether it has been committed as the running config or not.  Because a running config represents the actual current configuration state of the device, it would be very helpful to be able to explicitly request a retrieval of that config version.  At the minimum, when a config is retrieved it would be helpful to see in the data whether it had been committed or not (something like a committed="true|false" attribute on the root config element).

Does a capability like this exist in the API, perhaps as an undocumented option?

Thanks in advance for your help!

Tim

1 accepted solution

Accepted Solutions

L4 Transporter

You can retrieve the running config using type=config and action=show:

https://hostname/esp/restapi.esp?key=keyvalue&type=config&action=show

You can retrieve candidate config using type=config, action=get, and the xpath for appropriate config section.

https://hostname/esp/restapi.esp?key=keyvalue&type=config&action=get&xpath=/config/shared

https://hostname/esp/restapi.esp?key=keyvalue&type=config&action=get&xpath=/config/devices

https://hostname/esp/restapi.esp?key=keyvalue&type=config&action=get&xpath=/config/mgt-config

View solution in original post

4 REPLIES 4

Not applicable

Edit : moving to its own thread

Message was edited by: tgarrett

L4 Transporter

You can retrieve the running config using type=config and action=show:

https://hostname/esp/restapi.esp?key=keyvalue&type=config&action=show

You can retrieve candidate config using type=config, action=get, and the xpath for appropriate config section.

https://hostname/esp/restapi.esp?key=keyvalue&type=config&action=get&xpath=/config/shared

https://hostname/esp/restapi.esp?key=keyvalue&type=config&action=get&xpath=/config/devices

https://hostname/esp/restapi.esp?key=keyvalue&type=config&action=get&xpath=/config/mgt-config

Thanks for the info!

I was able to verify that the rule bases reflected change as you said.  However, I did also notice that the output with the "show" action is considerably smaller than the output of the "get" action.  Is it possible to get predefined elements such as applications in the running config?  The use of the xpath request parameter with the "show" action always seems to return an error "No such node".

  • 1 accepted solution
  • 3596 Views
  • 4 replies
  • 0 Likes
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!