Configuring Object Tracking
This section contains payload examples to demonstrate how to use the NX-API REST API to configure object tracking on the Cisco Nexus 3000 and 9000 Series switches.
Object tracking monitors the status of an object (such as an interface, an IP route, an IP SLA, or a list of multiple objects) and sends any changes to interested clients.
Configuring a Tracked Object to Track an Ethernet Interface
Configuring a Tracked Object to Track an Ethernet Interface
POST http://<IP_Address>/api/mo/sys/track/object-25.json
{
"trackIf": {
"attributes": {
"id": "eth1/1",
"protocolType": "line-protocol"
}
}
}
Creates and configures tracked object 25 to track Ethernet interface 1/1 with a line protocol.
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Creating and Configuring a Tracked Object to for SLA Tracking
Creating and Configuring a Tracked Object to for SLA Tracking
POST http://<IP_Address>/api/mo/sys/track.json
{
"trackEntity": {
"children": [
{
"trackObject": {
"attributes": {
"id": "5"
},
"children": [
{
"trackIpSla": {
"attributes": {
"probeId": "3",
"probeState": "state"
}}}]}}]}}
Creates and configures tracked object 5 for SLA tracking.
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html
Creating and Configuring a Tracked List
Creating and Configuring a Tracked List
POST http://<IP_Address>/api/mo/sys/track.json
{
"trackEntity": {
"children": [
{
"trackObject": {
"attributes": {
"id": "6"
},
"children": [
{
"trackList": {
"attributes": {
"type": "percentage"
"percentageUp": "30"
}}}]}}]}}
Creates and configures a tracked object with an ID of 6 list and a threshold up percentage of 30.
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html