How to save and export named configuration snapshot with 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.

How to save and export named configuration snapshot with API

L1 Bithead

Hi Folks,

 

I want to save and export new named configuration snapshot through API call.

I found the API but don't know whether it export the latest details or old one, In UI we have option to save and export the saved configuration but unable to find with API.

Can anyone help me if you already find out the way to export?

 

Also want to export Device group name but when i go to the API , it fetch all information including device name, it is really tough to fetch on Devicegroup.

 

Thanks in advance

8 REPLIES 8

Cyber Elite
Cyber Elite

@DexcomUser,

 

Have you tried below API call ?

 

/api/?type=export&category=configuration

M

Hi @SutareMayur 

 

I believe the below api will only export the configuration, Does it export latest configuration? 

 

like we mostly manually save the named configuration then export it

L1 Bithead

There are a lot differences I can see when I download named configuration with API.

Is there any way to grab the exact named configuration same as we download from portal.

 

Appreciate your help.

There are a few options for getting the running/live config via API, and it depends exactly what you want, there is nuance between the options, and based on this thread so far I'm not sure which is most appropriate, so I will share them all and let you decide which one meets your requirements:

https://{{host}}/api/?key={{key}}&type=config&action=show

https://{{host}}/api/?key={{key}}&type=op&cmd=<show><config><running></running></config></show>&target={{managed-device-serial}}

https://{{host}}/api/?key={{key}}&type=export&category=configuration

 

Saving the running config as a named "snapshot" can be done with:

https://{{host}}/api/?key={{key}}&type=op&cmd=<save><config><to>{{config-snapshot-name}}</to></config></save>

 

Hope that helps!

 

Help the community: "Like" helpful comments, and click "Accept as Solution" if you found your answer 🙂

@JimmyHolland , Yes these are really helpful.

 

But the format we export using API and from Portal is totally different.

I am running another python script to grab some inside details and i am able to fetch that when i used manually downloaded configuration file.

 

But exported is totally different.

Any other way to download configuration file same as manually downloaded one.

 

Thanks In advance

@Srikant I believe the command you're looking for is below. This will download the previously saved config snapshot with the expected formatting.

 

https://{{host}}/api/?key={{key}}&type=op&cmd=<show><config><saved>{{config-snapshot-name}}</saved></config></show>

 

Appreciate your help @JimmyHolland 

@Wayne_Brill Thank you so much, I was looking the same.

 

  • 5264 Views
  • 8 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!