cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1850
Views
0
Helpful
2
Replies

searching for useful moquery/HTTP GET options

guillerm
Level 1
Level 1

Hello,

I am looking for useful moquery/HTTP GET options ; it is not a really new topic;

the objectives are mainly :

1) get a quicker and possibly more limited answer via CLI (if using moquery command) than via the GUI :

2) collect, in 1 shot, a set of informations via HTTP GET using a Python script that will analyze and format the results in an excel sheet (which I already do to creaet a summary of all the configured APIC Tenants/EPGs)

For example, I would like to get :

a) the list of Endpoints IP addresses currently reachable in an EPG, in all EPGs of an AP or even in all EPGs of a Tenant

b) the current status of all Leaf interfaces, Port-channels and/or VPCs

c) and many others ...

Some "show" commands on the Leaf are, of course, already available and useful in those topics, such as "show endpoint ip", show portchannel sum, ...

(but these commands have some limitations sometimes, such as they have to be done on each Leaf, or "show endpoint ip" only shows 1 endpoint at a time)

The link https://developer.cisco.com/media/mim-ref/ gives tons of details about all objects managed in the APIC MO, but, no easy to know which options are useful and what could the correct syntax in a moquery or HTTP GET command

Thanks in advance for any ideas

2 Replies 2

gmonroy
Cisco Employee
Cisco Employee

Guillerm,

Out of curiosity, what is the version of fabric you are running? I ask, as in 1.2 and forward there are some NXOS Style CLI commands that can provide the aggregated information you are seeking, such as (from the APIC):

>Show endpoint

Which will show you all endpoints across all leaves grouped by the EPG they are beign learned under. There may be another command for interface status but I have not yet come across it.

If that is not your goal, then I would recommend using the "save as" option or API inspector in the GUI to begin finding the class of the object you are viewing from that GUI page, and would like to subsequently query against in your own homemade scripts. 

As an example, if I were looking for the class beign queried for interface status, I would navigate to Fabric > Inventory > Pod 1 > Leaf xxx > Interfaces > Physical Interfaces > eth x/x

Then I would click the "save as" option:

From there, you will receive an XML file that starts with the following:

<?xml version="1.0" encoding="UTF-8"?>
-<imdata totalCount="1">
-<l1PhysIf usage="controller,epg,infra" ...snip... />

and you can now use that class name in a moquery for class (-c):

apic1# moquery -c l1PhysIf
Total Objects shown: 332

# l1.PhysIf
id : eth1/32
adminSt : up
autoNeg : on
brkoutMap : none
bw : 0
childAction :
delay : 1
descr :
dn : topology/pod-1/node-101/sys/phys-[eth1/32]
...snip...

Hope this helps,

Gabriel

hello Gabriel,

thanks a lot for your answers, it gives me some extra ideas, yes;

btw, I never tried the show endpoint without options nor even on APIC;

there is a vlan option that allows to filters by vlan encap, which is useful when running some debugging session via CLI

thanks for your help

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