This section contains examples of telemetry subscription requests and responses. The following examples are dumps of protobuf messages from a Python API. Formats may vary across different implementations.
Example 1: Subscribe to a single path
2017-06-05 17:06:13,189 - SENT::SubscribeRequest
subscribe {
subscription {
path {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=test]"
element: "statistics"
element: "ip"
element: "in-packets"
}
mode: SAMPLE
sample_interval: 10000000000
}
}
2017-06-05 17:06:13,190 - RCVD::SubsribeResponse
2017-06-05 17:06:23,492 - RCVD::Subscribe
2017-06-05 17:06:23,492 - update {
timestamp: 1496675183491595139
prefix {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=test]"
element: "statistics"
element: "ip"
}
update {
path {
element: "in-packets"
}
val {
json_val: ‟‟0””
}
}
}
2017-06-05 17:06:23,494 - RCVD::Subscribe
2017-06-05 17:06:23,494 - sync_response: true
2017-06-05 17:06:33,589 - RCVD::Subscribe
2017-06-05 17:06:33,589 - update {
timestamp: 1496675213491595139
prefix {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=test]"
element: "statistics"
element: "ip"
}
update {
path {
element: "in-packets"
}
val {
json_val: ‟‟28””
}
}
....
....
Example 2: Subscribe to a single path with wildcard
2017-06-05 17:08:29,055 - SENT::SubscribeRequest
subscribe {
subscription {
path {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=*]"
element: "statistics"
element: "ip"
element: "in-packets"
}
mode: SAMPLE
sample_interval: 30000000000
}
}
2017-06-05 17:08:29,056 - RCVD::SubsribeResponse
2017-06-05 17:08:59,133 - RCVD::Subscribe
2017-06-05 17:08:59,133 - update {
timestamp: 1496675339132056575
prefix {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=system]"
element: "statistics"
element: "ip"
}
update {
path {
element: "in-packets"
}
val {
json_val: ‟‟0””
}
}
}
2017-06-05 17:08:59,135 - RCVD::Subscribe
2017-06-05 17:08:59,135 - update {
timestamp: 1496675339133006678
prefix {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=to_node_B]"
element: "statistics"
element: "ip"
}
update {
path {
element: "in-packets"
}
val {
json_val: ‟‟0””
}
}
}
2017-06-05 17:08:59,135 - RCVD::Subscribe
2017-06-05 17:08:59,135 - update {
timestamp: 1496675339133006678
prefix {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=to_node_D]"
element: "statistics"
element: "ip"
}
update {
path {
element: "in-packets"
}
val {
json_val: ‟‟0””
}
}
}
2017-06-05 17:08:59,136 - RCVD::Subscribe
2017-06-05 17:08:59,136 - sync_response: true
2017-06-0517:09:29,139 - RCVD::Subscribe
2017-06-0517:09:29,139 - update {
timestamp: 1496682569121314
prefix {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=system]"
element: "statistics"
element: "ip"
}
update {
path {
element: "in-packets"
}
val {
json_val: ‟‟0””
}
}
}
2017-06-05 17:09:29,142 - RCVD::Subscribe
2017-06-05 17:09:29,142 - update {
timestamp: 1496682569124342
prefix {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=to_node_B]"
element: "statistics"
element: "ip"
}
update {
path {
element: "in-packets"
}
val {
json_val: ‟‟0””
}
}
}
2017-06-05 17:09:29,145 - RCVD::Subscribe
2017-06-05 17:09:29,145 - update {
timestamp: 1496682569127344
prefix {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=to_node_D]"
element: "statistics"
element: "ip"
}
update {
path {
element: "in-packets"
}
val {
json_val: ‟‟0””
}
}
}
....
....
Example 3: Subscribe to more than one path
2017-01-24 12:54:18,228 - SENT::SubscribeRequest
subscribe {
subscription {
path {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=to_node_B]"
}
mode: SAMPLE
sample_interval: 30000000000
}
subscription {
path {
element: "state"
element: "router[router-instance=Base]"
element: "mpls"
element: "statistics"
element: "lsp-egress-stats[lsp-name=lsp_to_dest_f]"
}
mode: SAMPLE
sample_interval: 30000000000
}
}
Example 4: Subscribe to a list with wildcard
2017-01-24 13:45:30,947 - SENT::SubscribeRequest
subscribe {
subscription {
path {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=*]"
}
mode: SAMPLE
sample_interval: 30000000000
}
}
Example 5: Subscribe to path where the object did not exist before subscription
2017-01-24 13:53:50,165 - SENT::SubscribeRequest
subscribe {
subscription {
path {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=to_node_B]"
}
mode: SAMPLE
sample_interval: 30000000000
}
}
2017-01-24 13:53:50,166 - RCVD::SubsribeResponse
2017-01-24 13:54:20,169 - RCVD::Subscribe
2017-01-24 13:54:20,169 - sync_response: true
2017-01-24 13:54:50,174 - RCVD::Subscribe
2017-01-24 13:54:50,174 - update {
timestamp: 1485262490169309451
prefix {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=to_node_B]"
}
update {
...
...
}
}
Example 6: Subscribe to a path where the object existed before subscription and then deleted after subscription
2017-01-24 14:00:41,292 - SENT::SubscribeRequest
subscribe {
subscription {
path {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=to_node_B]"
}
mode: SAMPLE
sample_interval: 30000000000
}
}
2017-01-24 14:00:41,294 - RCVD::SubsribeResponse
2017-01-24 14:01:11,295 - RCVD::Subscribe
2017-01-24 14:01:11,295 - update {
timestamp: 1485262871290064704
prefix {
element: "state"
element: "router[router-instance=Base]"
element: "interface[interface-name=to_node_B]"
}
update {
...
...
}
}
2017-01-24 14:01:11,359 - RCVD::Subscribe
2017-01-24 14:01:11,359 - sync_response: true
2017-01-24 14:01:41,293 - RCVD::Subscribe
2017-01-24 14:02:11,296 - RCVD::Subscribe