Parts of a subscribe message
A subscribe message is the message sent when a subscriber requests a subscription to a topic on a switch. The subscribe message is in JSON format.
Subscribe message example
{
"type": "subscribe",
"topics": [
{
"name": "/rest/v1/system/vrfs"
},
{
"name": "/rest/v1/system/bridge/vlans/DEFAULT_VLAN_1?attributes=admin,oper_state_reason"
}
],
"hint": 5
}
Components of a subscribe message
type
Required. For a subscribe message, you must specify the following value:
subscribe
topics
Required. The value is a comma-separated list of one or more topics in JSON format. A topic includes one component:
name
Required. The name of the topic, identified by the URI of the switch resource, including the optional query string.
hint
Optional. Some resource attributes—typically in the statistics category—are not populated until a client requests the information. The value of
hint
specifies how often—in seconds—the notification subsystem is to request information about the topics in the list. The samehint
value applies to all the topics in the list.If the same resource is a topic in multiple subscriptions that have different values for
hint
, the notification subsystem uses the smallest value.Default: 10