Cisco ACI: moquery filter operators

moquery is a command line utility that ships with the Cisco APIC and iNX-OS (leaf/spine switch operating system). moquery allows querying of the Management Information Tree (MIT) from the command line; it’s also known as the command line cousin to Visore.

The following are the operators that can be used as part of the filter argument. This doesn’t appear to be documented anywhere, so I had to consult the source code (/controller/ishell/insieme/rest/queryfilter.py).

Single quotes must be used to enclose the query filter, double quotes must be used to enclose the second operand, even if the second operand is an integer. See example #2 below.

The second operand for the ~ operator is of the form (integer1, integer2). The second operand must be enclosed in double quotes, as above. The integers must not be enclosed in quotes. See example #3 below.

Examples

moquery -c fvAEPg -f ‘fv.AEPg.name*"ad"'

Return all application EPGs with ‘ad’ in the name property

moquery -c fvAEPg -f 'fv.AEPg.pcTag<="16384"'

Return all application EPGs that have global pcTag

moquery -c fvAEPg -f 'fv.AEPg.pcTag~"(10933,10934)"'

Return all application EPGs that have pcTag between 10933 and 10934

moquery -c fvAEPg -f 'fv.AEPg.pcTag<="16384" and fv.AEPg.name*"epo"'

Return all application EPGs that have global pcTag and ‘epo’ in the name property