SNS
The Simple Notification System (SNS) is composed of three major parts: topic, application platform, and application endpoint.
- Topic: a logical access point that acts as a communication channel to receive messages. For example, ZWatch can send alarm messages to a topic, and then the topic distributes the messages to the corresponding subscribed endpoints.
- Application platform: the platform through which messages are sent to specific endpoints. For example, an email server is needed if you want to send messages to an email endpoint. The email server mentioned above is an application platform. Currently, two platforms are available: email server and system platform. The system platform is used to send messages to endpoints that do not need a platform, such as DingTalk and HTTP webhook.
- Application endpoint: the endpoint used to receive messages. Currently, the following application endpoints are available: system endpoint, email, DingTalk, HTTP application, and short message service, and Microsoft Service. Before an endpoint can receive messages from a topic, the endpoint must be subscribed to the topic.
Note: Topic has a many-to-many relationship with endpoint. That is, a topic can be
subscribed by multiple endpoints, and an endpoint can also subscribe to multiple
topics.When an external system (such as ZWatch) sends a message to a topic, the topic will find all the endpoints that subscribed to the topic, and then send the message through the platform to which the endpoints belong. Assume that you subscribed an email endpoint (an email address) to a topic. When the topic receives an alarm message, it will send an alarm email to the endpoint represented by the email address through the platform (an email server) to which the email endpoint belongs.
Basic Workflow
- Create an SNS topic to receive alarm messages from external systems such as ZWatch.
- Create an application platform (an email server) if you use the email endpoint.
- Create an endpoint and subscribe the endpoint to the SNS topic you created in Step 1.
CreateSNSTopic
CreateSNSTopic name=alarm-topic{
"inventory": {
"createDate": "Jan 25, 2018 8:28:01 PM",
"lastOpDate": "Jan 25, 2018 8:28:01 PM",
"name": "alarm-topic",
"state": "Enabled",
"uuid": "e034cef9ad3d43e0b3f9c0a316a0f25a"
},
"success": true
}Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The resource name. | 2.3 | ||
| description | The detailed description of the resource. | Yes | 2.3 | |
| resourceUuid | Yes | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
DeleteSNSTopic
DeleteSNSTopic uuid=e034cef9ad3d43e0b3f9c0a316a0f25aParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.3 | ||
| deleteMode | Yes | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
ChangeSNSTopicState
Enables or disables a topic. After a topic is disabled, messages sent to the topic are automatically ignored and will not be distributed to the subscribed endpoint.
ChangeSNSTopicState uuid=e034cef9ad3d43e0b3f9c0a316a0f25a stateEvent=disable
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.3 | ||
| stateEvent | The state event. |
|
2.3 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
UpdateSNSTopic
UpdateSNSTopic name=new-topic-name uuid=e034cef9ad3d43e0b3f9c0a316a0f25aParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.3 | ||
| name | The resource name. | Yes | 2.3 | |
| description | The detailed description of the resource. | Yes | 2.3 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
QuerySNSTopic
Queries a topic. For example,
QuerySNSTopic uuid=b86c9016b4f24953a9edefb53ca0678c
Primitive Fields of Query
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 2.3 | ||
| name | The name. For more information, see Resource Property. | 2.3 | ||
| description | The description. For more information, see Resource Property. | Yes | 2.3 | |
| state | The state. | 2.3 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 2.3 | |
| createDate | The creation date. For more information, see Resource Property. | 2.3 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 |
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| endpoints | Endpoints Inventory | 2.3 |
CreateSNSEmailPlatform
Creates an email platform (email server). For example,
CreateSNSEmailPlatform name=my-sftp-server smtpServer=mail.zstack.org smtpPort=25 username=support@cloud.io password=password
{
"inventory": {
"createDate": "Jan 25, 2018 8:43:32 PM",
"lastOpDate": "Jan 25, 2018 8:43:32 PM",
"name": "my-sftp-server",
"smtpPort": 25,
"smtpServer": "mail.zstack.org",
"state": "Enabled",
"type": "Email",
"username": "support@cloud.io",
"uuid": "bec03e2d93224c7381782833e8b685ca"
},
"success": true
}
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| smtpServer | The SMTP server address. | 2.3 | ||
| smtpPort | The SMTP port. | 2.3 | ||
| username | The username. | 2.3 | ||
| password | The password. | Yes | 2.3 | |
| name | The resource name. | 2.3 | ||
| description | The detailed description of the resource. | Yes | 2.3 | |
| resourceUuid | Yes | 2.3 | ||
| encryptType | Yes |
|
2.3 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The user tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
Note:
- When you add an email server, the system will automatically detect whether the username, password, email server address, email server port, and encryption type are correct. The waiting time does not exceed 5 seconds.
ValidateSNSEmailPlatform
Tests whether an email platform (email server) is available. For example,
ValidateSNSEmailPlatform uuid=bec03e2d93224c7381782833e8b685ca
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
DeleteSNSApplicationPlatform
DeleteSNSApplicationPlatform uuid=bec03e2d93224c7381782833e8b685caParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.3 | ||
| deleteMode | Yes | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
QuerySNSEmailPlatform
QuerySNSEmailPlatform smtpServer=mail.zstack.orgUpdateSNSApplicationPlatform
UpdateSNSApplicationPlatform uuid=b86c9016b4f24953a9edefb53ca0678cParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.3 | ||
| name | The resource name. | Yes | 2.3 | |
| description | The detailed description of the resource. | Yes | 2.3 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
QuerySNSApplicationPlatform
Queries an application platform. For example,
QuerySNSApplicationPlatform uuid=b3454k6ll687h23345jh24hk5
Primitive Fields of Query
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 2.3 | ||
| name | The name. For more information, see Resource Property. | 2.3 | ||
| description | The description. For more information, see Resource Property. | Yes | 2.3 | |
| type | The type. | 2.3 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 2.3 | |
| createDate | The creation date. For more information, see Resource Property. | 2.3 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 |
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| endpoints | Endpoints Inventory | 2.3 |
ChangeSNSApplicationPlatformState
Enables or disables an application platform. After the platform is disabled, you can no longer send emails to an endpoint through this platform.
ChangeSNSApplicationPlatformState uuid=bec03e2d93224c7381782833e8b685ca stateEvent=disable
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.3 | ||
| stateEvent | The state event. |
|
2.3 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
CreateSNSEmailEndpoint
Creates an email endpoint. For example,
CreateSNSEmailEndpoint name=operator email=operator@zstack.org
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| The email address. | 2.3.0 | |||
| emails | Yes | 3.7.0 | ||
| name | The resource name. | 2.3.0 | ||
| description | The detailed description of the resource. | Yes | 2.3.0 | |
| platformUuid | The application platform UUID. | Yes | 2.3.0 | |
| resourceUuid | Yes | 2.3.0 | ||
| tagUuids | The tag UUID list. | Yes | 3.7.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
{
"inventory": {
"createDate": "Jan 25, 2018 8:57:14 PM",
"email": "operator@zstack.org",
"lastOpDate": "Jan 25, 2018 8:57:14 PM",
"name": "operator",
"platformUuid": "bec03e2d93224c7381782833e8b685ca",
"state": "Enabled",
"type": "Email",
"uuid": "b03b125230b0406ea198919954ae3928"
},
"success": true
}
- email: the email address to receive the email
- platformUuid: the email server UUID
QuerySNSEmailEndpoint
QuerySNSEmailEndpoint email~="%@zstack.org"CreateSNSHttpEndpoint
Creates an HTTP webhook endpoint. For example,
CreateSNSHttpEndpoint name=http url=http://localhost:8080/webhook-url username=url-username password=url-password
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| url | The HTTP webhook URL. | 2.3 | ||
| username | The username of the URL. | Yes | 2.3 | |
| password | The password of the URL. | Yes | 2.3 | |
| name | The resource name. | 2.3 | ||
| description | The detailed description of the resource. | Yes | 2.3 | |
| resourceUuid | Yes | 2.3 | ||
| platformUuid | Yes | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
{
"inventory": {
"createDate": "Jan 25, 2018 9:01:30 PM",
"lastOpDate": "Jan 25, 2018 9:01:30 PM",
"name": "http",
"platformUuid": "02d24b9b0a7f4ee1846f15cda248ceb7",
"state": "Enabled",
"type": "HTTP",
"url": "http://localhost:8080/webhook-url",
"username": "url-username",
"uuid": "d9d8186eeed245e0b18ec8deef185fb7"
},
"success": true
}
- url: the HTTP webhook URL
- username: Optional. The username of the URL. This parameter uses the basic authentication mode of HTTP.
- password: Optional. The password of the URL. This parameter uses the basic authentication mode of HTTP.
QuerySNSHttpEndpoint
QuerySNSHttpEndpoint url~=http%CreateSNSDingTalkEndpoint
Creates a DingTalk endpoint, which is a DingTalk robot. For example,
CreateSNSDingTalkEndpoint name=dingding url=https://oapi.dingtalk.com/robot/send?access_token=128f268950234c6c2f065fe88be6cc26d780e9d9863d63eae12be831605345 atPersonPhoneNumbers=+86-12900010002,+86-13977889933
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| url | The webhook URL of the DingTalk robot. | 2.3 | ||
| atAll | Whether to notify all (@All) members in a DingTalk group. | Yes | 2.3 | |
| atPersonPhoneNumbers | The phone number of the group member to be notified (the @member). | Yes | 2.3 | |
| name | The resource name. | 2.3 | ||
| description | The detailed description of the resource. | Yes | 2.3 | |
| resourceUuid | Yes | 2.3 | ||
| platformUuid | Yes | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
{
"inventory": {
"atAll": false,
"atPersonPhoneNumbers": [
"+86-12900010002",
"+86-13977889933"
],
"createDate": "Jan 25, 2018 9:11:00 PM",
"lastOpDate": "Jan 25, 2018 9:11:00 PM",
"name": "dingding",
"platformUuid": "02d24b9b0a7f4ee1846f15cda248ceb7",
"state": "Enabled",
"type": "DingTalk",
"url": "https://oapi.dingtalk.com/robot/send?access_token=128f268950234c6c2f065fe88be6cc26d780e9d9863d63eae12be831605345",
"uuid": "2663ecb5356a4fbeb6cde202b2e6eaf1"
},
"success": true
}
- url: the webhook URL of the DingTalk robot
- atAll: If set to true, all members in the DingTalk group will
be notified after a message is sent through DingTalk, and the
atPersonPhoneNumbersparameter will be ignored. - atPersonPhoneNumbers: the phone number of the group member to be notified (the
@member). DingTalk is registered with a phone number, through which you can
notify (@) members in a target DingTalk group.
Note: DingTalk displays phone
numbers with country calling codes. You can check a complete phone number,
such as +86-18977550789, by clicking the profile icon in
DingTalk.
AddSNSDingTalkAtPerson
AddSNSDingTalkAtPerson endpointUuid=2663ecb5356a4fbeb6cde202b2e6eaf1 phoneNumber=+86-18977550789Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| phoneNumber | The phone number of the DingTalk user. (Users register DingTalk with their phone numbers.) | 2.3 | ||
| endpointUuid | The UUID of the DingTalk endpoint. | 2.3 | ||
| resourceUuid | Yes | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
RemoveSNSDingTalkAtPerson
RemoveSNSDingTalkAtPerson endpointUuid=2663ecb5356a4fbeb6cde202b2e6eaf1 phoneNumber=1897755078Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| endpointUuid | The UUID of the DingTalk endpoint. | 2.3 | ||
| phoneNumber | The phone number of the user to be removed. | 2.3 | ||
| deleteMode | 2.3 | |||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
QuerySNSDingTalkEndpoint
QuerySNSDingTalkEndpoint atAll=falseDeleteSNSApplicationEndpoint
DeleteSNSApplicationEndpoint uuid=2663ecb5356a4fbeb6cde202b2e6eaf1Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.3 | ||
| deleteMode | Yes | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The user tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
UpdateSNSApplicationEndpoint
Changes the name of an application endpoint, or modifies the endpoint description. If you
want to update specific fields (such as url and email)
of the endpoint, the endpoint will be deleted and then rebuilt. For example,
UpdateSNSApplicationEndpoint uuid=2663ecb5356a4fbeb6cde202b2e6eaf1 name=my-endpoint
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.3 | ||
| name | The resource name. | Yes | 2.3 | |
| description | The detailed description of the resource. | Yes | 2.3 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
QuerySNSApplicationEndpoint
Queries an application endpoint. For example,
QuerySNSApplicationEndpoint
ChangeSNSApplicationEndpointState
ChangeSNSApplicationEndpointState uuid=b86c9016b4f24953a9edefb53ca0678c stateEvent=enableParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.3 | ||
| stateEvent | The state event. |
|
2.3 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
CreateSNSAliyunSmsEndpoint
CreateSNSAliyunSmsEndpoint accessKeyUuid=4eb00e2bf95bp5s505e6eccd647d9k35 name=AliyunSmsParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| accessKeyUuid | The UUID of Aliyun access key. | 3.7.0 | ||
| receivers | The SMS message receiver. | Yes | 3.7.0 | |
| name | The endpoint name. | 3.7.0 | ||
| description | The detailed description of the endpoint. | Yes | 3.7.0 | |
| platformUuid | Yes | 3.7.0 | ||
| resourceUuid | Yes | 3.7.0 | ||
| tagUuids | The tag UUID list. | Yes | 3.7.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.7.0 | |
| timeout | Yes |
ValidateSNSAliyunSmsEndpoint
ValidateSNSAliyunSmsEndpoint uuid=56304854f10730adac30a81c1e8e8de4 phoneNumbers=13456788765Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The endpoint UUID. | 3.7.0 | ||
| phoneNumbers | The phone number of the validation SMS message receiver. | 3.7.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.7.0 | |
| timeout | Yes |
AddSNSSmsReceiver
AddSNSSmsReceiver phoneNumber=18912345678 endpointUuid=e0a8e9de43774027a486f3a47fa0b46c type=AliyunSms Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| phoneNumber | The phone number to receive SMS messages. | 3.7.0 | ||
| endpointUuid | The UUID of the SMS endpoint. | 3.7.0 | ||
| type | The type of the SMS endpoint. |
|
3.7.0 | |
| description | The description of the SMS message receiver. | Yes | 3.7.0 | |
| resourceUuid | Yes | 3.7.0 | ||
| tagUuids | The tag UUID list. | Yes | 3.7.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.7.0 | |
| timeout | Yes |
RemoveSNSSmsReceiver
RemoveSNSSmsReceiver endpointUuid=196b91815e983d1397cb336a4fc9d054 phoneNumber=18812345678Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| endpointUuid | The UUID of the SMS endpoint. | 3.7.0 | ||
| phoneNumber | The phone number to receive SMS messages. | 3.7.0 | ||
| deleteMode | Yes | 3.7.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.7.0 | |
| timeout | Yes |
QuerySNSSmsEndpoint
QuerySNSSmsEndpoint Primitive Fields of Query
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 3.7.0 | ||
| name | The name. For more information, see Resource Property. | 3.7.0 | ||
| description | The description. For more information, see Resource Property. | Yes | 3.7.0 | |
| type | 3.7.0 | |||
| platformUuid | 3.7.0 | |||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 3.7.0 | |
| createDate | The creation date. For more information, see Resource Property. | 3.7.0 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 3.7.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.7.0 |
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| platform | 3.7.0 | ||
| receivers | 3.7.0 | ||
| topics | Primitive Fields of Query | 3.7.0 |
AddEmailAddressToSNSEmailEndpoint
AddEmailAddressToSNSEmailEndpoint emailAddress=example@cloud.io endpointUuid=74220bbf0d8b3c6b943a294c2679ca69Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| emailAddress | The email address. | 3.7.0 | ||
| endpointUuid | The endpoint UUID. | 3.7.0 | ||
| resourceUuid | Yes | 3.7.0 | ||
| tagUuids | The tag UUID list. | Yes | 3.7.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.7.0 | |
| timeout | Yes |
UpdateEmailAddressOfSNSEmailEndpoint
UpdateEmailAddressOfSNSEmailEndpoint emailAddressUuid=cb2b3d85e0da3a299c52c23510ba15dd endpointUuid=f305528eb6773a73beac3f94f79d3017Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| emailAddressUuid | The email address UUID. | 3.7.0 | ||
| endpointUuid | The endpoint UUID. | 3.7.0 | ||
| emailAddress | The address of the new email. | Yes | 3.7.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.7.0 | |
| timeout | Yes |
DeleteEmailAddressOfSNSEmailEndpoint
DeleteEmailAddressOfSNSEmailEndpoint emailAddressUuid=c9d1789432133840862986db31a8e3fb endpointUuid=7671c40279e23d1cba927a5726957fcbParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| emailAddressUuid | 3.7.0 | |||
| endpointUuid | 3.7.0 | |||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.7.0 | |
| timeout | Yes |
QuerySNSEmailAddress
QuerySNSEmailAddress emailAddress=test@cloud.ioPrimitive Fields of Query
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 3.7.0 | ||
| emailAddress | 3.7.0 | |||
| endpointUuid | 3.7.0 | |||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 3.7.0 | |
| createDate | The creation date. For more information, see Resource Property. | 3.7.0 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 3.7.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.7.0 |
{
"inventories": [
{
"uuid": "102431efdb133a70b7e04347de22e396",
"emailAddress": "test@cloud.io",
"endpointUuid": "4ff65a1d7762348495dd0c4da110d7cd",
"createDate": "Oct 9, 2019 10:45:40 AM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}CreateSNSMicrosoftTeamsEndpoint
CreateSNSMicrosoftTeamsEndpoint url=http://teams-robot-url name=exampleParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| url | The connector URL. | 3.10.0 | ||
| name | The resource name. For more information, see Resource Property. | 3.10.0 | ||
| description | The detailed description of the resource. For more information, see Resource Property. | Yes | 3.10.0 | |
| platformUuid | The platform UUID. | Yes | 3.10.0 | |
| resourceUuid | The resource UUID. | Yes | 3.10.0 | |
| tagUuids | The tag UUID list. | Yes | 3.10.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.10.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.10.0 | |
| timeout | Yes |
QuerySNSMicrosoftTeamsEndpoint
QuerySNSMicrosoftTeamsEndpoint uuid=e18d0fd90b513f71889d4c2dd38879bfPrimitive Fields of Query
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. For more information, see Resource Property. | Yes | 3.10.0 | |
| createDate | The creation date. For more information, see Resource Property. | Yes | 3.10.0 | |
| description | The detailed description of the resource. For more information, see Resource Property. | Yes | 3.10.0 | |
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 3.10.0 | |
| lastOpDate | The last operation date. For more information, see Resource Property. | Yes | 3.10.0 | |
| name | The resource name. For more information, see Resource Property. | Yes | 3.10.0 | |
| platformUuid | The platform UUID. | Yes | 3.10.0 | |
| state | The state. | Yes | 3.10.0 | |
| type | The type. | Yes | 3.10.0 | |
| url | The connector URL. | Yes | 3.10.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.10.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.10.0 |
Nested And Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| platform | The platform inventory. | 3.10.0 | |
| topics | The topics. For more information, see Primitive Fields of Query. | 3.10.0 |
SubscribeSNSTopic
Subscribes an endpoint to a topic. After subscription, messages sent to the topic will be automatically sent to the endpoint. For example,
SubscribeSNSTopic endpointUuid=b03b125230b0406ea198919954ae3928 topicUuid=e034cef9ad3d43e0b3f9c0a316a0f25a
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| topicUuid | The topic UUID. | 2.3 | ||
| endpointUuid | The endpoint UUID. | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The user tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
QuerySNSTopicSubscriber
Queries a topic subscriber. That is, checks which endpoints are subscribed to a topic. For example,
QuerySNSTopicSubscriber topicUuid=71efab26b4f84a62b001ec9b222efe47
Primitive Fields of Query
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| topicUuid | The topic UUID. | 2.3.1 | ||
| endpointUuid | The endpoint UUID. | 2.3.1 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 2.3.1 | |
| createDate | The creation date. For more information, see Resource Property. | 2.3.1 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 2.3.1 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3.1 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3.1 |
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| endpoints | Endpoints Inventory | 2.3.1 | |
| topics | Topics Inventory | 2.3.1 |
UnsubscribeSNSTopic
Unsubscribes an endpoint from a topic. For example,
UnsubscribeSNSTopic endpointUuid=b03b125230b0406ea198919954ae3928 topicUuid=e034cef9ad3d43e0b3f9c0a316a0f25a
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| topicUuid | The topic UUID. | 2.3 | ||
| endpointUuid | The endpoint UUID. | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
System Topic
SNS has some built-in system topics. Some predefined messages are sent to the system topics. You can subscribe to these topics to obtain information of interest.
Note:
- System topics cannot be deleted or changed. UUIDs of system topics are predefined constant values.
- System topics can be hard coded.
System Alarm Topic
QuerySNSTopic name=system-alarm
{
"inventories": [
{
"createDate": "Jan 10, 2018 12:11:09 AM",
"description": "topic for reporting system defined alarms",
"lastOpDate": "Jan 10, 2018 12:11:09 AM",
"name": "system-alarm",
"state": "Enabled",
"uuid": "e7d6f5e23bb74e99a2777126078b551c"
}
],
"success": true
}
Alarms predefined by ZWatch send alarm messages to system alarm topics. You can use a system alarm topic as a custom alarm topic.
Use System HTTP Endpoint to Receive Messages from System Alarm Topics
An internal system (usually the UI) needs a way to receive messages from system alarm topics. You can use a system HTTP endpoint to act as the way mentioned above by configuring the following fields in zstack.properties:
sns.systemTopic.endpoints.http.url = The HTTP URL to receive POST messages.
sns.systemTopic.endpoints.http.url.username = Optional. The username of the HTTP request.
sns.systemTopic.endpoints.http.url.password = Optional. The password of the HTTP request.
If you need to set the username or password, both fields need to be set at the same time. Otherwise, the setting will not take effect. The HTTP endpoint can receive messages no matter the system alarm topic is enabled or disabled.
Note:
You can use the zstack-configure command to configure the fields mentioned above.
API Topic
QuerySNSTopic name=system-alarm
{
"inventories": [
{
"createDate": "Jan 10, 2018 12:11:09 AM",
"description": "the topic to publish API requests and responses",
"lastOpDate": "Jan 10, 2018 12:11:09 AM",
"name": "api",
"state": "Enabled",
"uuid": "7bfa0eb8555b3528ace936edfd1d74f1"
}
],
"success": true
}
ZStack will send all API requests and responses to an API topic. You can subscribe to this topic to obtain API call status. The API topic can only be subscribed by HTTP endpoints. The messages received by an HTTP endpoint is the API text in JSON format.
Note:
The API requests received by an API topic are bare requests. If the
password field is included in a request (such as the API
request for adding a host), this field will also be sent to an endpoint. For
security reasons, API topics can only be subscribed by endpoints created by the
administrator. The administrator must use API topics only for internal integration
or debugging.
