Moquery Cheat Sheet: Bridge Domain
Moquery Cheat Sheet: Bridge Domain
Moquery Cheat Sheet: Bridge Domain
Introduction
I figured we have a CLI Commands cheat sheet list so why not one for moquery. I figured I would break it
up into two separate pieces with one for APICs and one for Switches. Please feel free to add any potential
moquery statements you feel are good for troubleshooting.
moquery usage
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
BRIDGE DOMAIN
moquery -c fvBD
moquery -c fvBD -f "fv.BD.name==\"BDname\""
moquery -c fvSubnet (BD SVI)
CONTEXT
moquery -c fvCtx
EPG
moquery -c fvAEPg
moquery -c fvAEPg -f 'fv.AEPg.pcTag=="xxxx"'
ENDPOINT
moquery -c fvCEp
moquery -c fvCEp | grep x.x.x.x -A 10 -B 5
moquery -c fvCEp -f 'fv.CEp.name=="aa:bb:cc:dd:11:22:33:44"'
moquery -c fvCEp -f 'fv.CEp.ip=="1.1.1.1"'
moquery -c fvRsCEpToPathEp
CONSUMED CONTRACT
moquery -c vzBrCP
PROVIDED CONTRACT
moquery -c vzBrCP
L3 OUT
moquery -c l3extInstP
moquery -c l3extDomP
moquery -c actrl.PfxEntry
moquery -c l3extSubnet
FAULT
moquery -c faultInst -f 'fault.Inst.code=="F0053"'
moquery -c faultRecord -x order-by="faultRecord.created|desc" 'query-target-
filter=wcard(faultRecord.created,"2017-12-1[2]")'>/home/admin/auditlog.txt
TUNNEL INTERFACES
moquery -c tunnelIf
APIC moquery
Which Tenant and VRF number is a specific EPG in if you know the pcTag?
# fv.AEPg
name : epg8
childAction :
configIssues :
configSt : applied
descr :
dn : uni/tn-mb-7-8/ap-mb-app1/epg-epg8
lcOwn : local
matchT : AtleastOne
modTs : 2015-08-11T16:49:11.249+00:00
monPolDn : uni/tn-common/monepg-default
pcTag : 5481
prio : unspecified
rn : epg-epg8
scope : 2621441
status :
triggerSt : triggerable
uid : 15374
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-new]/node-102
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-new]/node-103
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-static]/node-
102/stpathatt-[eth1/35]
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-static]/node-
103/stpathatt-[eth1/35]
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-new]/node-102/dyatt-
[topology/pod-1/paths-102/pathep-[eth1/35]]
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-new]/node-103/dyatt-
[topology/pod-1/paths-103/pathep-[eth1/35]]
# infra.AccPortP
name : LEAF_1-2_ifselector
childAction :
descr : GUI Interface Selector Generated PortP Profile: LEAF_1-2
dn : uni/infra/accportprof-LEAF_1-2_ifselector
lcOwn : local
modTs : 2015-11-02T16:25:59.586-08:00
monPolDn : uni/fabric/monfab-default
ownerKey :
ownerTag :
rn : accportprof-LEAF_1-2_ifselector
status :
uid : 15374
# infra.HPortS
name : 101-102_1-ports-25
type : range
childAction :
descr :
dn : uni/infra/accportprof-LEAF_1-2_ifselector/hports-101-102_1-ports-25-typ-range
lcOwn : local
modTs : 2015-11-02T16:25:59.586-08:00
monPolDn : uni/fabric/monfab-default
ownerKey :
ownerTag :
rn : hports-101-102_1-ports-25-typ-range
status :
uid : 15374
To collect Audit logs: This will collect audit all changes made from 2016-01-25 (Change the date on
command as you need)
moquery -c aaaModLR -x order-by="aaaModLR.created|desc" 'query-target-
filter=wcard(aaaModLR.created,"2016-01-25")'>/home/admin/Audit20160125.txt
Switch moquery
VPC
moquery -c fabricExplicitGEp
Total Objects shown: 1
# fabric.ExplicitGEp
name : vPCProtectionGroup
childAction :
configQual :
configSt : deployed
dn : uni/fabric/protpol/expgep-vPCProtectionGroup
id : 1
lcOwn : resolveOnBehalf
modTs : 2015-08-07T13:39:58.993-04:00
monPolDn : uni/fabric/monfab-default
rn : expgep-vPCProtectionGroup
status :
uid : 15374
virtualIp : 10.0.152.67/32
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-static]/node-
103/stpathatt-[eth1/35]/conndef/conn-[vlan-2103]-[0.0.0.0]
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-epg8]/node-
103/dyatt-[topology/pod-1/paths-103/pathep-[eth1/35]]/conndef/conn-[vlan-203]-[0.0.0.0]
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-new]/node-103/dyatt-
[topology/pod-1/paths-103/pathep-[eth1/35]]/conndef/conn-[vlan-211]-[0.0.0.0]
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-test2]/node-
103/dyatt-[topology/pod-1/paths-103/pathep-[eth1/35]]/conndef/conn-[vlan-207]-[0.0.0.0]
What VLANs are already allocated to which interfaces on this leaf? (We can grep by tenant
name, or attachment type of dyatt or stpathatt as well.
dn : uni/epp/br-[uni/tn-pod1/l2out-pod1-l2-out-1000/instP-pod1-l2-out-
1000]/node-103/stpathatt-[pod1-vpc-l2]/conndef/conn-[vlan-1000]-[0.0.0.0]
dn : uni/epp/br-[uni/tn-pod2/l2out-pod2-l2-out-1002/instP-pod2-l2-out-
1002]/node-103/stpathatt-[pod2-vpc-l2]/conndef/conn-[vlan-1002]-[0.0.0.0]
dn : uni/epp/rtd-[uni/tn-pod1/out-pod1_l3_ext_bgp/instP-L3_ext_bgp]/node-
103/stpathatt-[eth1/45]/conndef/conn-[vlan-3101]-[17.17.17.1/24]
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-static]/node-
103/stpathatt-[eth1/35]/conndef/conn-[vlan-2103]-[0.0.0.0]
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-epg8]/node-
103/dyatt-[topology/pod-1/paths-103/pathep-[eth1/35]]/conndef/conn-[vlan-203]-[0.0.0.0]
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-new]/node-103/dyatt-
[topology/pod-1/paths-103/pathep-[eth1/35]]/conndef/conn-[vlan-211]-[0.0.0.0]
dn : uni/epp/fv-[uni/tn-mb-tennant1/ap-mb-app-pro/epg-mb-test2]/node-
103/dyatt-[topology/pod-1/paths-103/pathep-[eth1/35]]/conndef/conn-[vlan-207]-[0.0.0.0]
dn : uni/epp/rtd-[uni/tn-pod3/out-pod3_bgp_svi/instP-pod3_bpg_ExNet]/node-
103/stpathatt-[eth1/44]/conndef/conn-[vlan-3103]-[19.19.19.1/24]
# nw.PathEp
id : eth1/1
allocState : allocated
childAction :
descr :
dn : sys/conng/path-[eth1/1]
fabricPathDn : topology/pod-1/paths-404/pathep-[eth1/1]
lcOwn : local
modTs : 2017-11-23T02:00:33.481+00:00
monPolDn : uni/fabric/monfab-default
name :
nativeEncap : 22
rn : path-[eth1/1]
status :
vlanScope : global
vlanScopeSupport : supported
dn : sys/phys-[eth1/33]/phys
operSpeed : 10G
dn : sys/phys-[eth1/34]/phys
operSpeed : 10G
dn : sys/phys-[eth1/35]/phys
operSpeed : 1G