Attribute filters in monitored URIs
Some types of attributes can be filtered further by specifying an attribute name and value pair instead of just an attribute name.
For example, you might want to specify that only physical interfaces be monitored. There is no way to specify only the physical interfaces in the URI path. However, physical interfaces have an attribute called
type
, which has a value of
system
.
The
filter
keyword indicates that the value that follows the equal sign (=
) is an attribute and value pair.
The filtered attribute must be the name of an attribute of the resource specified by the path component of the URI.
The attribute must be one of the following data types:
integer
string
boolean
For information about the names, types, and values of attributes of a resource, see the ArubaOS-CX REST API Reference.
The syntax of the attribute and value pair is the following:
attribute-name:attribute-value
Multiple attribute and value pairs are supported. Commas separate the pairs. For example:
...&filter=type:vlan,admin_state:up
Examples
The following example shows a monitored URI that specifies the received packets of all physical interfaces.
uri1 = '/rest/v1/system/interfaces/*?attributes=statistics.rx_packets&filter=type:system'
self.m1 = Monitor(uri1, 'rx on all physical interfaces')
The following example shows a monitored URI that specifies the received packets of VLAN interfaces that are in an
up
state.
uri2 = '/rest/v1/system/interfaces/*?attributes=statistics.rx_packets&filter=type:vlan,admin_state:up'
self.m2 = Monitor(uri2, 'rx on UP VLAN interfaces')