Explicitly retrieving running or candidate config via XML API

Reply
Not applicable

Explicitly retrieving running or candidate config via XML API

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

Tags (2)
Not applicable

Re: Explicitly retrieving running or candidate config via XML API

Edit : moving to its own thread

Message was edited by: tgarrett

SRA
L4 Transporter

Re: Explicitly retrieving running or candidate config via XML API

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

Not applicable

Re: Explicitly retrieving running or candidate config via XML API

Thanks for the info!

Not applicable

Re: Explicitly retrieving running or candidate config via XML API

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".

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!