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

how to get uni/infra full json config via moquery

guillerm
Level 1
Level 1

hello,

1) I am able to get uni/infra full json config via following icurl command from APIC CLI :

icurl -o /tmp/Extract-UNI_INFRA-181001.json -X 'GET http://localhost:7777/api/node/mo/uni/infra.json?rsp-subtree=full&rsp-prop-include=config-only'

2) how can I get the same output via moquery command ? I tried this command :

moquery -d uni/infra -o json -x 'rsp-subtree=full' -x 'rsp-prop-include=config-only'

but I only got the very limited output below :

 

 

admin@APIC1:tmp> moquery -d uni/infra -o json -x 'rsp-subtree=full' -x 'rsp-prop-include=config-only'
{
  "imdata": [
    {
      "infraInfra": {
        "attributes": {
          "dn": "uni/infra",
          "lcOwn": "local",
          "ownerKey": "",
          "name": "infra",
          "modTs": "never",
          "status": "",
          "nameAlias": "",
          "ownerTag": "",
          "rn": "infra"
        }
      }
    }
  ],
  "totalCount": "1"
}
admin@APIC1:tmp>


 

3) If I use the same kind of command for a Tenant, i.e. : 

moquery -d uni/tn-TENANT1 -o json -x 'rsp-subtree=full' -x 'rsp-prop-include=config-only'

I got the same incomplete config output;

and to get the full Tenant config, I have to use the following moquery command :

moquery -c fvTenant -f 'fv.Tenant.name=="TENANT1"' -o xml -x 'rsp-subtree=full' -x 'rsp-prop-include=config-only

 

Question :

What is the moquery command that allows to collect the same uni/infra full json config as collected via icurl ?

 

thanks in advance for any feedback

1 Reply 1

guillerm
Level 1
Level 1

Hello,

finally, I got the answer from CISCO ;

here it is :

moquery -c infraInfra -x rsp-subtree=full rsp-prop-include=config-only -o xml

moquery -c infraInfra -x rsp-subtree=full rsp-prop-include=config-only -o json

 

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

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