01-31-2023 08:15 AM
Hi ACI experts,
I'm trying to find out the CLI commands to snapshot APIC config through CLI with a custom name.
(Ex : Save_@IP_APIC_-<yyyy-mm-dd>T<hh-mm-ss>.tar.gz)
Any ideas ?
Thank you
Solved! Go to Solution.
02-22-2023 04:03 AM
Hello there @ju.mahieu,
I've tried it on a lab and was not able to do it via CLI, however i was able to do it via API / GUI, to do it in a reoccurring way you will need two steps:
1. You need to create a new Snapshot management policy
via GUI
go to ADMIN > Import/Export > then right click on Snapshot Management, and select Create Configuration Snapshot Management Policy
or via API
Method:POST
url: https://{{Your_APIC_IP}}/api/node/mo/uni/fabric/snpmgr-{{YourSnapPolicyNAME}}.json
payload{"configSnapshotMgrP":{"attributes":{"dn":"uni/fabric/snpmgr-{{YourSnapPolicyNAME}}","name":"{{YourSnapPolicyNAME}}":"download","fileName":"{{NameOfYourFile.tar.gz}}","rn":"snpmgr-{{YourSnapPolicyNAME}}","status":"created"},"children":[{"configRsRemotePath":{"attributes":{"tnFileRemotePathName":"{{YourRemoteLocationsPreviously created}}","status":"created,modified"},"children":[]}}]}}
2. Every time you want a new snapshot this policy has to be triggered and it can be done again via GUI or via API (my suggestion is to trigger it via API as you can automate it).
via GUI
Inside of your Snapshot Management Policy, on the Policy tab, on the option "Start Now:" select "YES", then click submit on the bottom right side.
via API
Method:POST
url: https://{{Your_APIC_IP}}/api/node/mo/uni/fabric/snpmgr-{{YourSnapPolicyNAME}}.json
payload{"configSnapshotMgrP":{"attributes":{"dn":"uni/fabric/snpmgr-{{YourSnapPolicyNAME}},"adminSt":"triggered"},"children":[]}}
If you find my reply solved your question or issue, kindly click the 'Accept as Solution' button and vote it as helpful.
You can also learn more about Cisco ACI through our live Ask the Experts (ATXs) session. Check out the ATXs Resources [https://community.cisco.com/t5/data-center-and-cloud-knowledge/cisco-aci-ask-the-experts-resources/ta-p/4394491] to view the latest schedule for upcoming sessions, as well as the useful references, e.g. online guides, FAQs.
02-22-2023 04:03 AM
Hello there @ju.mahieu,
I've tried it on a lab and was not able to do it via CLI, however i was able to do it via API / GUI, to do it in a reoccurring way you will need two steps:
1. You need to create a new Snapshot management policy
via GUI
go to ADMIN > Import/Export > then right click on Snapshot Management, and select Create Configuration Snapshot Management Policy
or via API
Method:POST
url: https://{{Your_APIC_IP}}/api/node/mo/uni/fabric/snpmgr-{{YourSnapPolicyNAME}}.json
payload{"configSnapshotMgrP":{"attributes":{"dn":"uni/fabric/snpmgr-{{YourSnapPolicyNAME}}","name":"{{YourSnapPolicyNAME}}":"download","fileName":"{{NameOfYourFile.tar.gz}}","rn":"snpmgr-{{YourSnapPolicyNAME}}","status":"created"},"children":[{"configRsRemotePath":{"attributes":{"tnFileRemotePathName":"{{YourRemoteLocationsPreviously created}}","status":"created,modified"},"children":[]}}]}}
2. Every time you want a new snapshot this policy has to be triggered and it can be done again via GUI or via API (my suggestion is to trigger it via API as you can automate it).
via GUI
Inside of your Snapshot Management Policy, on the Policy tab, on the option "Start Now:" select "YES", then click submit on the bottom right side.
via API
Method:POST
url: https://{{Your_APIC_IP}}/api/node/mo/uni/fabric/snpmgr-{{YourSnapPolicyNAME}}.json
payload{"configSnapshotMgrP":{"attributes":{"dn":"uni/fabric/snpmgr-{{YourSnapPolicyNAME}},"adminSt":"triggered"},"children":[]}}
If you find my reply solved your question or issue, kindly click the 'Accept as Solution' button and vote it as helpful.
You can also learn more about Cisco ACI through our live Ask the Experts (ATXs) session. Check out the ATXs Resources [https://community.cisco.com/t5/data-center-and-cloud-knowledge/cisco-aci-ask-the-experts-resources/ta-p/4394491] to view the latest schedule for upcoming sessions, as well as the useful references, e.g. online guides, FAQs.
02-22-2023 10:16 AM
03-06-2023 11:38 PM
Thank you guys for your help
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide