Classes
The Application Policy Infrastructure Controller (APIC ) classes are crucial from an operational perspective to understand how system events and faults relate to objects within the object model. Each event and/or fault in the system is a unique object that can be accessed for configuration, health, fault, and/or statistics.
All the physical and logical components that comprise the Application Centric Infrastructure fabric are represented in a hierarchical management information tree (MIT). Each node in the tree represents a managed object (MO) or group of objects that contains its administrative state and its operational state.
The programmatic REST API uses a REST architecture. The API accepts and returns HTTP or HTTPS messages that contain JSON or XML documents. You can use any programming language to generate the messages, and the JSON or XML documents that contain the API methods or managed object (MO) descriptions.
You can invoke an API function by sending an HTTP/1.1 or HTTPS POST, GET, or DELETE message to the APIC. The HTML body of the POST message contains a JSON or XML data structure that describes an MO or an API method. The HTML body of the response message contains a JSON or XML structure that contains requested data, confirmation of a requested action, or error information.
To access the complete list of classes, point to the APIC and reference the doc/html directory at the end of the URL:
https://apic_ip_address/doc/html/
Fabric Monitoring
topSystem
Name: top:System
Description: Provides a list of all the devices within the fabric, including controllers, leafs and spines.
Usage: The topSystem class can be used to derive object properties including inb/oob management details, current time, system uptime and current state.
topSystem REST :: https://172.16.96.2/api/node/class/topSystem.json
fabricNode
Name: fabric:Node
Description: Provides a list of all the nodes that are part of the fabric, including controllers, leafs and spines.
Usage: The fabricNode class can be used to derive object properties including node serial numbers, assigned node ids, node model numbers and device roles.
fabricNode REST :: https://172.16.96.2/api/node/class/fabricNode.json
faultInst
Name: fault:Inst
Description: Contains detailed information of the fault. This object is attached as a child of the object on which the fault condition occurred. One instance object is created for each fault condition of the parent object. A fault instance object is identified by a fault code.
Usage: The faultInst class can be used to derive all faults associated with the fabric, tenant or individual managed objects within the APIC.
faultInst REST :: https://172.16.96.2/api/node/class/faultInst.json
fabricHealthTotal
Name: fabric:HealthTotal
Description: The fabric total health score instance.
Usage: The fabricHealthTotal class can be used to derive the overall system health.
fabricHealthTotal REST :: https://172.16.96.2/api/node/class/fabricHealthTotal.json
fvCEp
Name: fv:CEp
Description: A client endpoint attaching to the network.
Usage: The fvCEp class can be used to derive a list of end points attached to the fabric and the associated ip/mac address and encapsulation for each object.
fvCEp REST :: https://172.16.96.2/api/node/class/fvCEp.json
fvRsCEpToPathEp
Name: fv:RsCEpToPathEp
Description: This is an internal object that provides a relation to a path endpoint.
Usage: The fvRsCEpToPathEp class can be used to derive path fabric details such as the node and port as well as the tenant details such as the tenant name, application profile and end point group.
fvRsCEpToPathEp REST :: https://172.16.96.2/api/node/class/fvRsCEpToPathEp.json
eqptFabP
Name: eqpt:FabP
Description: Fabric port, the fabric facing external IO port.
Usage: The eqptFabP class can be used to derive a list of fabric port and the associated details such as the line card and chassis placement.
eqptFabP REST :: https://172.16.96.2/api/node/class/eqptFabP.json
eqptLeafP
Name: eqpt:LeafP
Description: Fabric port, the non-fabric facing external leaf IO port.
Usage: The eqptFabP class can be used to derive a list of non-fabric port and the associated details such as the line card and chassis placement.
eqptLeafP REST :: https://172.16.96.2/api/node/class/eqptLeafP.json
eqptCh
Name: eqpt:ChA
Description: The hardware chassis container.
Usage: The eqptCh class can be used to derive a chassis list and the associated details such as the operational state, serial number and model number.
eqptCh REST :: https://172.16.96.2/api/node/class/eqptCh.json
eqptLC
Name: eqpt:LCA
Description: The line card (IO card), containing IO ports.
Usage: The eqptLC class can be used to derive a list of line cards deployed within the fabric and the associated details such as the redundancy state, model, serial numbers and the number of ports.
eqptLC REST :: https://172.16.96.2/api/node/class/eqptLC.json
eqptFt
Name: eqpt:Ft
Description: The inventoried fan tray.
Usage: The eqptFt class can be used to derive a list of fan trays and the associated details such as the operational status, model number, serial number and hardware version.
eqptFt REST :: https://172.16.96.2/api/node/class/eqptFt.json
eqptPsu
Name: eqpt:Psu
Description: The power supply unit.
Usage: The eqptFt class can be used to derive a list of power supplies within the fabric and the associated details such as the model number, serial number, operational status, and the voltage source.
eqptPsu REST :: https://172.16.96.2/api/node/class/eqptPsu.json
eqptSupC
Name: eqpt:SupC
Description: The supervisor card, which contains the CPU running control plane.
Usage: The eqptFt class can be used to derive a list of supervisor cards deployed within the fabric and the associated details such as the model number, serial number, operational status and redundancy state.
eqptSupC REST :: https://172.16.96.2/api/node/class/eqptSupC.json
ethpmPhysIf
Name: ethpm:PhysIf
Description: The physical interface information holder.
Usage: The ethpmPhysIf class can be used to derive a list of physical interfaces in the fabric and the associated details such as a the speed, duplex, operational status, and usage state.
ethpmPhysIf REST :: https://172.16.96.2/api/node/class/ethpmPhysIf.json
dbgAcTrail
Name: dbg:AcTrail
Description: The atomic counter trail.
Usage: The dbgAcTrail class can be used to derive a list of the atomic counters deployed within the fabric and the associated details such as dropped packet statistics and packet counts.
dbgAcTrail REST :: https://172.16.96.2/api/node/class/dbgAcTrail.json
dbgEpgToEpgRslt
Name: dbg:EpgToEpgRslt
Description: The endpoint group to endpoint group atomic counter, on-demand, entry.
Usage: The dbgEpgToEpgRsIt class can be used to derive a list of the EPG to EPG atomic counters deployed within the fabric, and the associated details such as dropped packet statistics and packet counts.
dbgEpgToEpgRsIt REST :: https://172.16.96.2/api/node/class/dbgEpgToEpgRslt.json
dbgEpToEpRslt
Name: dbg:EpToEpRslt
Description: The endpoint to endpoint atomic counter, On-demand, Entry.
Usage: The dbgEpToEpTsIt class can be used to derive a list of the endpoint to endpoint atomic counters deployed within the fabric and the associated details such as dropped packet statistics and packet counts.
dbgEpToEpTsIt REST :: https://172.16.96.2/api/node/class/dbgEpToEpRslt.json
VM_Monitoring
compVm
Name: comp:Vm
Description: The Virtual machine object.
Usage: The compVm class can be used to derive a list of virtual machines deployed within the fabric and the associated details such as the name and state.
compVm REST :: https://172.16.96.2/api/node/class/compVm.json
compHv
Name: comp:Hv
Description: An object representing the compute hypervisor.
Usage: The compVm class can be used to derive a list of compute hypervisor deployed within the fabric and the associated details such as the name and status.
compHv REST :: https://172.16.96.2/api/node/class/compHv.json
fvRsVm
Name: fv:RsVm
Description: A relation to a virtual machine connected to a hypervisor. This is an internal object.
Usage: The fvRsVm class can be used to derive the relationship of the virtual machines connected to the hypervisor.
vRsVm REST :: https://172.16.96.2/api/node/class/fvRsVm.json
fvRsHyper
Name: fv:RsHyper
Description: A relation to the hypervisor that controls and monitors the APIC VMs. This is an internal object.
Usage: The fvRsHyper class can be used to derive the relationship of the hypervisor that controls and monitors the APIC VMs.
fvRsHyper REST :: https://172.16.96.2/api/node/class/fvRsHyper.json
vmmCtrlrP
Name: vmm:CtrlrP
Description: The VMM controller profile, which specifies how to connect to a single VM management controller that is part of containing policy enforcement domain. For example, the VMM controller profile could be a policy to connect a VMware vCenter that is part a VMM domain.
Usage: The vmmCtrlrP class can be used to derive the ip address and the datacenter name of the connected VM domain.
vmmCtrlrP REST :: https://172.16.96.2/api/node/class/vmmCtrlrP.json
Layer 4 to Layer 7 Monitoring
vnsAbsGraph
Name: vnsAbsGraph
Description: The abstract graph is made up of abstract nodes and used to define the traffic flow through a service function such as load balancing, SSL offload, or firewall. Abstract nodes are comprised of service nodes such as a service node balancer (SLB) or firewall (FW), abstract term nodes (the nodes that are connected to endpoint groups), and connections.
Usage: The class vnsAbsGraph can be used to derive a list of service graph templates configured on the APIC, along with their properties.
vnsAbsGraph REST :: https://172.16.96.2/api/node/class/vnsAbsGraph.json
vnsLDevVip
Name: vnsLDevVip
Description: An L4-L7 device cluster, which is represented by a single virtual IP (VIP). The configuration is pushed down to the VIP address.
Usage: The class vnsLDevVip can be used to derive all the VIPs configured for the logical device clusters in the fabric
vnsLDevVip REST :: https://172.16.96.2/api/node/class/vnsLDevVip.json
vnsCDev
Name: vnsCDev
Description: The individual service device, which is used to define a concrete l4-l7 service device.
Usage: The class vnsCDev can be used to derive a list of concrete devices configured as part of the L4-7 service integration
vnsCDev REST :: https://172.16.96.2/api/node/class/vnsCDev.json
vnsLif
Name: vnsLif
Description: The logical interface, which is associated with a set of concrete interfaces from the L4-L7 device cluster.
Usage: The class vnsLif can be used to derive the connection between a service graph and device interfaces.
vnsLif REST :: https://172.16.96.2/api/node/class/vnsLIf.json
vnsLDevCtx
Name: vnsLDevCtx
Description: A device cluster context, which points to the device cluster used to pick a specific device based on contract, subject, and function label or names. To specify a wild card, set the name to Any.
Usage: The class vnsLDevCtx can be used to derive the node and contract name.
nsLDevCtx REST :: https://172.16.96.2/api/node/class/vnsLDevCtx.json
vnsRsLDevCtxToLDev
Name: vnsRsLDevCtxToLDev
Description: A source relation to the abstraction of a service device cluster or of a proxy object for a logical device cluster in the tenant.
Usage: The class vnsRsLDevCtxToLDev can be used to derive the relationship between vnsLDevCtx and vnsLDev.
vnsRsLDevCtxToLDev REST :: https://172.16.96.2/api/node/class/vnsRsLDevCtxToLDev.json
Statistics
compHostStats1h
Name: comp:HostStats1h
Description: A class that represents the most current statistics for host in a 1 hour sampling interval. This class updates every 15 minutes.
Usage: The compHostStats1h class can be used to derive the statistics associated with the compute hypervisor.
compHostStats1h REST :: https://172.16.96.2/api/node/class/compHostStats1h.json
compRcvdErrPkts1h
Name: comp:RcvdErrPkts1h
Description: A class that represents the most current statistics for received error packets in a 1 hour sampling interval. This class updates every 15 minutes.
Usage: The compRcvdErrPkts1h class can be used to derive the most current statistics for received error packets.
compRcvdErrPkts1h REST :: https://172.16.96.2/api/node/class/compRcvdErrPkts1h.json
compTrnsmtdErrPkts1h
Name: comp:TrnsmtdErrPkts1h
Description: A class that represents the most current statistics for transmitted error packets in a 1 hour sampling interval. This class updates every 15 minutes.
Usage: The compTrnsmtdErrPkts1h class can be used to derive the most current statistics for transmitted error packets.
compTrnsmtdErrPkts1h REST :: https://172.16.96.2/api/node/class/compTrnsmtdErrPkts1h.json
Authentication, Authorization, and Accounting
aaaModLR
Name: aaa:ModLR
Description: The AAA audit log record. A log record is automatically generated whenever a user modifies an object.
Usage: The aaaModLR class can be used to derive a fabric based audit log for all changes and events.
aaaModLR REST :: https://172.16.96.2/api/node/class/aaaModLR.json
aaaUser
Name: aaa:User
Description: A locally-authenticated user account.
Usage: The aaaUser class can be used to derive a list of user accounts deployed within the fabric.
aaaUser REST :: https://172.16.96.2/api/node/class/aaaUser.json
aaaRemoteUser
Name: aaa:RemoteUser
Description: A remote user login account.
Usage: The aaaUser class can be used to derive a list of remote user accounts deployed within the fabric.
aaaRemoteUser REST :: https://172.16.96.2/api/node/class/aaaRemoteUser.json
Fabric Capacity
Policy TCAM
Name: eqptcapacityPolEntry5min
Description: Policy CAM entry statistics. A class that represents the most current statistics for policy entry in a 5 minute sampling interval. This class updates every 10 seconds.
Usage: The eqptcapacityPolEntry5min class can be used to derive the current value associated with the Policy TCAM usage.
eqptcapacityPolEntry5min REST :: https://172.16.96.2/api/class/eqptcapacityPolEntry5min.json
Prefix TCAM
Name: eqptcapacityL3Entry5min
Description: Layer3 entry statistics. A class that represents the most current statistics for layer3 entry in a 5 minute sampling interval. This class updates every 10 seconds.
Usage: The eqptcapacityL3Entry5min class can be used to derive the current value associated with the Prefix TCAM usage.
eqptcapacityL3Entry5min REST :: https://172.16.96.2/api/class/eqptcapacityL3Entry5min.json
SNMP and Syslog
SNMP Trap Destination
Name: snmpTrapDest
Description: "background-color:rgb(255, 255, 255); color:rgb(51, 51, 51)">A destination to which traps and informs are sent.
Usage: The snmpTrapDest class can be used to derive the current list of snmp trap destinations implemented within the fabric.
snmpTrapDest REST :: https://172.16.96.2/api/node/class/snmpTrapDest.json
Syslog Remote Destination Host
Name: syslogRemoteDest
Description: The syslog remote destination host enables you to specify syslog servers to which messages from the APIC and fabric nodes should be forwarded.
Usage: The syslogRemoteDest class can be used to derive the current list of syslog remote destinations implemented within the fabric.
syslogRemoteDest REST :: https://172.16.96.2/api/node/class/syslogRemoteDest.json
Use Cases
The class faultInst used in Use Case #1 and Use Case #2 below can be replaced with any of the managed object classses discussed above or specified within the APIC documentation. The Cisco APIC Command-Line Interface User Guide may also be helpful for understanding the following sections.
Case 1: Creating an application script to retrieve the current list of faults in the fabric.
This use case may be typical for environments where an ACI administrator wishes to obtain the list of current faults in the fabric. The user has the option of collecting the results via CLI, Visore, POSTMAN and/or Cobra. Please refer to the section above for application specific access and explantions.
From a CLI perspective, use the following command to perform the query:
admin@apic1:~> moquery -c faultInst
From a Visore perspective, use the following parameters to perform the query.:
Class or DN :: faultInst
Property :: n/a
Op :: n/a
Value :: n/a
From a POSTMAN perspective, user the following REST GET to perform the query:
GET http://<your apic ip address>/api/node/class/faultInst.xml
From a Cobra perspective, use the following class query:
# Class Query
classQuery= ClassQuery(' faultInst')
for fault in md.query(classQuery):
print fault.name
Sample Cobra script to capture faults within the fabric:
#!/usr/bin/env python
import cobra.mit.access
import cobra.mit.session
from cobra.mit.session import LoginSession
from cobra.mit.request import ClassQuery
ls = cobra.mit.session.LoginSession('https://'<your apic ip address>, <username>,
<password>, secure=False)
md = cobra.mit.access.MoDirectory(ls)
md.login()
# Class Query
classQuery= ClassQuery(' faultInst')
for fault in md.query(classQuery):
print fault.name
Case 2: Creating an application script to retrieve the current list of faults in the fabric that have been caused by a failed configuration.
This use case may be typical for environments where an ACI administrator wishes to cobtain the list of current faults in the fabric. The user has an option of collecting the results via CLI, Visore, POSTMAN and/or Cobra. Please refer to the section above for application specific access and explantions.
From a CLI perspective, use the following command to perform the query:
admin@apic1:~> moquery -c faultInst -f 'fv.faultInst.cause=="config-failure"'
From a Visore perspective, use the following parameters to perform the query:
Class or DN :: faultInst
Property :: cause
Op :: ==
Value :: config-failure
From a POSTMAN perspective, use the following REST GET to perform the query:
GET http:// <your apic ip address>/api/node/class/faultInst.xml?
query-target-filter=and(eq(faultInst.cause,"config-failure"))
From a Cobra perspective, use the following class query:
# Class Query
classQuery= ClassQuery(' faultInst')
classQuery.propFilter = 'wcard(faultInst. cause, "{0}")'.format(' config-failure')
for fault in md.query(classQuery):
print fault.name
Cobra Script to capture faults casued by configuration failures.
#!/usr/bin/env python
import cobra.mit.access
import cobra.mit.session
from cobra.mit.session import LoginSession
from cobra.mit.request import ClassQuery
ls = cobra.mit.session.LoginSession('https://'<your apic ip address>, <username>,
<password>, secure=False)
md = cobra.mit.access.MoDirectory(ls)
md.login()
# Class Query
classQuery= ClassQuery(' faultInst')
for fault in md.query(classQuery):
print fault.name
Case 3: Creating an application script to retrieve the properties for a specific managed object, DN
This use case may be typical for environments where an ACI administrator wishes to obtain the properties of the tenant name Common. The user has an option of collecting the results via CLI, Visore, POSTMAN and/or Cobra. Please refer to the section above for application specific access and explantions.
From a CLI perspective, use the following command to perform the query:
admin@apic1:~> moquery -d uni/tn-common
From a Visore perspective, use the following parameters to perform the query:
Class or DN :: uni/tn-common
Property :: n/a
Op :: n/a
Value :: n/a
From a POSTMAN perspective, use the following REST GET to perform the query:
GET http://<your apic ip address>/api/node/mo/uni/tn-common.xml?query-target=self
From a Cobra perspective, use the following class query:
# DN Query
dnQuery= DnQuery(' uni/tn-common')
for results in md.query(dnQuery):
print results.dn
Cobra Script to capture faults casued by configuration failures.
#!/usr/bin/env python
import cobra.mit.access
import cobra.mit.session
from cobra.mit.session import LoginSession
from cobra.mit.request import DnQuery
ls = cobra.mit.session.LoginSession('https://'<your apic ip address>, <username>,
<password>, secure=False)
md = cobra.mit.access.MoDirectory(ls)
md.login()
# DN Query
dnQuery= DnQuery('uni/tn-common')
for results in md.query(dnQuery):
print results.dn
Case 4: Creating an application script to retrieve the current list of endpoints (mac-addresses) attached to the fabric
This use case may be typical for environments where an ACI administrator wishes to create an application script to capture the list of current endpoints attached to the fabric along with the node details pertaining to each endpoint.
Cobra Script to capture faults caused by configuration failures.
#!/usr/bin/env python
from cobra.mit.access import MoDirectory
from cobra.mit.session import LoginSession
from cobra.mit.request import ClassQuery
lls = cobra.mit.session.LoginSession('https://'<your apic ip address>, <username>,
<password>, secure=False)
md = MoDirectory(ls)
md.login()
q = ClassQuery('fvCEp')
q.subtree = 'children'
q.subtreeClassFilter = 'fvRsCEpToPathEp'
mos = md.query(q)
for mo in mos:
for child in mo.rscEpToPathEp:
print child.dn