Moquery is a powerful tool that you will only find in ACI. For this reason, it can be difficult to find a lot of information about the tool and the process of building new queries. The "mo" in moquery stands for 'managed object', so it is a query of the managed objects in the fabric. It is possible to run moquery on the leaf and spine nodes, but most of the time you are going to be running the queries from the APIC.
moquery -c fvBD
This will query all of the Bridge Domains in the fabric. Note that it will not gather data from other sites, but it would gather data from other pods.
moquery -d /uni/tn-Main/ap-Applications/bd-VLAN_10
This will return the managed object for BD VLAN_10, assuming it exists.
apic1# moquery --help
usage: Command line cousin to visore [-h] [-i HOST] [-p PORT] [-d DN]
[-c KLASS] [-f FILTER] [-a ATTRS]
[-o OUTPUT] [-u USER]
[-x [OPTIONS [OPTIONS ...]]]
optional arguments:
-h, --help show this help message and exit
-i HOST, --host HOST Hostname or ip of apic
-p PORT, --port PORT REST server port
-d DN, --dn DN dn of the mo
-c KLASS, --klass KLASS
comma seperated class names to query
-f FILTER, --filter FILTER
property filter to accept/reject mos
-a ATTRS, --attrs ATTRS
type of attributes to display (config, all)
-o OUTPUT, --output OUTPUT
Display format (block, table, xml, json)
-u USER, --user USER User name
-x [OPTIONS [OPTIONS ...]], --options [OPTIONS [OPTIONS ...]]
Extra options to the query
# fv.AEPg
name : Dell_A
annotation :
childAction :
configIssues :
configSt : applied
descr :
dn : uni/tn-Main/ap-Servers/epg-Dell_A
exceptionTag :
extMngdBy :
floodOnEncap : disabled
fwdCtrl :
hasMcastSource : no
isAttrBasedEPg : no
isSharedSrvMsiteEPg : no
lcOwn : local
matchT : AtleastOne
modTs : 2024-04-12T18:46:04.888+00:00
monPolDn : uni/tn-common/monepg-default
nameAlias :
pcEnfPref : unenforced
pcTag : 32770
prefGrMemb : exclude
prio : unspecified
rn : epg-Dell_A
scope : 2588672
shutdown : no
status :
triggerSt : triggerable
txId : 2882303761517122100
uid : 15374
The filter will need to have the periods in the same place as the object is shown, so # fv.AEPg in this case, and then the attribute itself is case sensitive, and almost always uses camel case notation. (Camel case is a style of writing where compound words or phrases are combined without spaces, and each word starts with a capital letter except the first one)
moquery -c fvAEPg -f 'fv.AEPg.floodOnEncap=="disabled"'
moquery -c fvBD -d "uni/tn-Main/BD-100" -x "query-target=children target-subtree-class=fvRtBd"
moquery -c fvBD
All EPGs
moquery -c fvAEPg
All Tenants
moquery -c fvTenant
All Application Profiles
moquery -c fvAp
All L3 Subnets (SVIs under BDs)
moquery -c fvSubnet
All Contracts
moquery -c vzBrCP
All L3Outs
moquery -c l3extOut
All Client Endpoints (this can be quite large)
moquery -c fvCEp
Please Sign Up or Sign In to post.