Parts of a subscription success message
When a subscription request is successful, a subscription success message is returned. The subscription success message is in JSON format.
例子成功消息
{ "type": "success", "subscriber_name": "4bcf8uka90ki", "subscription_name": "ns83n58dky", "data": [ { "topicname": "/rest/v1/system/vlans/1?attributes=admin,oper_state_reason", "resources": [ { "operation": "", "uri": "/rest/v1/system/vlans/1", "values": { "admin": "up", "oper_state_reason": "no_member_port" } } ] }, { "topicname": "/rest/v1/system/vrfs", "resources": [ { "operation": "", "uri": "/rest/v1/system/vrfs/default", "values": {} }, { "operation": "", "uri": "/rest/v1/system/vrfs/mgmt", "values": {} } ] } ] }
Components of subscription success message
-
type
-
Identifies the type of message. Success messages have the type:
success
-
subscriber_name
-
Contains a unique identifier that represents the name of the subscriber.
-
subscription_name
-
Contains a unique identifier that represents the name of the specific subscription.
-
数据
-
Contains a comma-separated list of one or more topics in JSON format.
Components of a topic
In a subscription success message, each topic in the data contains the following components:
-
topicname
-
Contains the name of the topic, identified by the URI of the switch resource, including the optional query string.
-
resources
-
Contains a comma-separated list of one or more resources in JSON format. When the URI of a topic is a resource collection, a topic includes multiple resources. In the example message, the
vrfs
resource includes two VRF instances:default
andmgmt
.Each resource includes the following components:
-
operation
-
The value of
operation
is empty for success messages. This component is used for notification messages only. -
uri
-
包含t的URIhe resource instance within the resource collection. If the
topicname
is a resource instance instead of a collection,uri
matches the path portion of the URI intopicname
. -
values
-
Contains the names and current values of the attributes that were specified in the query string of
topicname
.
-