cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
888
Views
0
Helpful
1
Replies

How to check if a configuration import is done ?

clement_cheung
Level 1
Level 1

All

 

I have a program that automates the configuration import from a local configuration backup file into the APIC.  However, I have no idea how to check if the import is truly completed so that the next sequential task can be started.

 

Obviously, the 200 OK immediately returned from the configuration import REST API call only acknowledges the import request is accepted.  Any REST API call I can use to check if the configuration import is truly completed or not ?

 

Thanks in advance!

1 Reply 1

Sergiu.Daniluk
VIP Alumni
VIP Alumni

Hi @clement_cheung 

What you can do is query the configJobCont mo's subtree (which includes the configJob - which basically is the import job).  If there are more jobs of the same policy, filter by name/date, and check the operSt attribute.

Example (using moquery, but it can be easily converted to REST API call). Also I have only one job present.

apic1# moquery -d uni/backupst/jobs-\[uni/fabric/configimp-Sergiu-Import-Policy\] -x 'query-target=children' | grep operSt
operSt         : success

Converted REST API URL you should use is:

https://{{apic_ip}}/api/node/mo/uni/backupst/jobs-[uni/fabric/configimp-Sergiu-Import-Policy].json?query-target=children

 

Stay safe,

Sergiu

Review Cisco Networking for a $25 gift card

Save 25% on Day-2 Operations Add-On License