02-06-2018 12:22 AM - edited 03-01-2019 05:26 AM
Hello All,
How are you ?
Please guide me how to find switch profile through moquery in CLI
I am finding difficulty to find switch profile with reference of EPG static bindings.
Regards,
Sourabh
02-06-2018 02:25 AM
Is your end goal to find a moquery to the class of the switch profiles defined in your ACI?
If that is the case you can use;
moquery -c infraNodeP
02-06-2018 02:44 AM
02-06-2018 10:17 PM
There is not a one moquery that would give you that information. You might be able to get this information with a series of moqueries.
02-06-2018 10:40 PM - edited 02-06-2018 10:40 PM
Hello Manuel,
ohh ok.
by any chance, can i get any URL to see all moqueries with defined function of each moquery ?
i will study moquery and will try to get required details.
Thanks a lot!!!
Regards,
02-07-2018 04:02 AM
Hi rocky1,
I personally use api for this. To find the switch profile used for certain static bindings you need three api calls. The classes can ofc be used for the moquery's as well.
This api call shows you the switch profile and interface poicy group used by the access port selectors:
{{protocol}}://{{apic}}/api/class/infraHPortS.json?query-target=children
Output will be something like:
{
"infraPortBlk": {
"attributes": {
"childAction": "",
"descr": "",
"dn": "uni/infra/accportprof-ilp_individual_153/hports-aps_2-typ-range/portblk-block2",
"fromCard": "1",
"fromPort": "2",
"lcOwn": "local",
"modTs": "2017-08-15T08:12:18.342+01:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "block2",
"nameAlias": "",
"status": "",
"toCard": "1",
"toPort": "2",
"uid": "15374"
}
}
},
{
"infraRsAccBaseGrp": {
"attributes": {
"childAction": "",
"dn": "uni/infra/accportprof-ilp_individual_153/hports-aps_2-typ-range/rsaccBaseGrp",
"fexId": "101",
"forceResolve": "yes",
"lcOwn": "local",
"modTs": "2017-08-15T08:12:18.342+01:00",
"monPolDn": "uni/fabric/monfab-default",
"rType": "mo",
"state": "formed",
"stateQual": "none",
"status": "",
"tCl": "infraAccPortGrp",
"tDn": "uni/infra/funcprof/accportgrp-ilpg_apicmgmt",
"tType": "mo",
"uid": "15374"
}
}
}
The next api call shows you the same information, but this time from a policy group persective:
{{protocol}}://{{apic}}/api/class/infraAccPortGrp.json?query-target=children&query-target=subtree
{
"infraRtAccBaseGrp": {
"attributes": {
"childAction": "",
"dn": "uni/infra/funcprof/accportgrp-ilpg_apicmgmt/rtaccBaseGrp-[uni/infra/accportprof-ilp_individual_153/hports-aps_2-typ-range]",
"lcOwn": "local",
"modTs": "2017-08-15T08:12:18.342+01:00",
"status": "",
"tCl": "infraHPortS",
"tDn": "uni/infra/accportprof-ilp_individual_153/hports-aps_2-typ-range"
}
}
}
Hope this helps.
Regards,
Sebastiaan
02-07-2018 08:31 PM
02-25-2018 01:28 PM
Hi Sebas,
in my team, no one is aware of API
I request you to please guide me to use below API step by step please :)
regards,
02-07-2018 09:34 AM
rocky1,
Please refer to the following documentation for some tools that may be helpful for getting familiar with the API:
Personally, I am fond of using the API Inspector when I am trying to figure out what calls are being made via the advanced GUI.
After getting the call or class in question, the Managed Object browser (visore) is a very useful minimal tool to understand the query a bit deeper, as well as see what available attributes exist, and there is a button to easily query for all children (or the parent) of the object you queried against.
-Gabriel
02-07-2018 08:32 PM
03-05-2020 02:09 AM - edited 03-05-2020 02:09 AM
https://{apic_IP}/api/node/class/infraNodeP.json
Try above, and all the switch profile name under 'name' field
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