SMN
Function Description
This plugin is built into SecMaster and calls Simple Message Notification (SMN) APIs to perform operations.
Each built-in plugin has a corresponding built-in operation connection.
Viewing Details and Operation Connections of the SMN Plugin
- Log in to the SecMaster console.
- Click
in the upper left corner of the management console and select a region or project. - In the navigation pane on the left, choose Workspaces > Management. In the workspace list, click the name of the target workspace. Figure 1 Workspace management page
- In the navigation pane on the left, choose . Figure 2 Plugins page
- On the Plugins page, select the SMN plugin under the Huawei Cloud catalog. The Details tab is displayed by default. The Details tab displays the login credential information of the operation connection associated with the plugin.
- Click the Operation Connections tab for the SMN plugin. On the displayed page, you can view information about the operation connections associated with the SMN plugin.
- For details about how to edit or delete an operation connection, see Editing an Operation Connection and Deleting an Operation Connection. For details about how to add an operation connection for a plugin, see Creating an Operation Connection. A plugin can have multiple operation connections.
Plugin Execution Function listSubscriptionsByTopic
- Parameters of the listSubscriptionsByTopic Function: describes the input and output parameters of the function.
- Output Example of the ListSubscriptionsByTopic Function: provides an example of the function output.
Parameters of the listSubscriptionsByTopic Function
Function: Calls the corresponding SMN API to obtain the subscription list of a specified topic by page. The subscription list is sorted by subscription creation time in ascending order.
| Parameter | Parameter Type | Parameter Description | Mandatory |
|---|---|---|---|
| topicUrn | String | Unique resource ID of the SMN topic. You can obtain the ID from the SMN console. | Yes |
| page | Int | Page number for pagination query. The default value is 1. | No |
| size | Int | Number of data records on each page. The default value is 100, and the maximum value is 100. | No |
| endpoint | String | Endpoint name of a subscriber for the query. | No |
| Parameter | Parameter Type | Parameter Description |
|---|---|---|
| subscriptionCount | Int | Number of subscribers to the topic. |
| subscriptions | Array | List of subscriber details. |
Output Example of the ListSubscriptionsByTopic Function
{
"subscriptionCount": 2,
"subscriptions": [
{
"topic_urn": "urn:smn:cn-north-7:f8ae07xxxx8f4e418c5fxxxxx6b105:SecMaster-Notification",
"protocol": "email",
"subscription_urn": "urn:smn:cn-north-7:f8axxx4148fxxxxxxxe15833f6b105:SecMaster-Notification:27fd07xxx9f442xxxxxxxx8935813ad3",
"owner": "f8ae07d4148f4e418c5fe15833f6b105",
"endpoint": "yexxxx0@h-parxxxxnxxrs.com",
"remark": "",
"status": 3
},
{
"topic_urn": "urn:smn:cn-north-7:f8ae07d4xxxxe418xxx3f6b105:SecMaster-Notification",
"protocol": "email",
"subscription_urn": "urn:smn:cn-north-7:f8aexxx8f4exxx5833f6b105:SecMaster-Notification:b0xxxea82xxx097a65d2e1a1edbe8",
"owner": "f8ae07d4xxxxxe4xxxxfe15833f6b105",
"endpoint": "zhxxxxxxxg2@h-paxxxxx.com",
"remark": "",
"status": 3
}
]
} Plugin Execution Function publishMessage
- Parameters of the PublishMessage Function: describes the input and output parameters of the function.
- Output Example of the PublishMessage Function: provides an example of the function output.
Parameters of the PublishMessage Function
Function: Calls the corresponding SMN API to send a message to all endpoints subscribed to a topic.
| Parameter | Parameter Type | Parameter Description | Mandatory |
|---|---|---|---|
| topicUrn | String | Unique ID of the SMN topic. You can obtain the ID from the SMN console. | No |
| subject | String | Message title, which is used as the subject of an email sent to a subscriber. | No |
| message | String | Message to be sent. The maximum size is 256 KB. | No |
| language | String | Response language of the query result. The value can be zh-cn or en-us. Uppercase letters and other values are not supported. The value zh-cn indicates that the query result is displayed in simplified Chinese, and the value en-us indicates that the query result is displayed in English. | No |
| agency_type | String | Unified adaptation parameter for multiple accounts. Use the default value. | No |
| Parameter | Parameter Type | Parameter Description |
|---|---|---|
| header | Object | Header of the response returned by the API. It includes basic information about the request and response, such as the request time, response service, and request ID. |
| code | Int | Status code, which indicates whether the request is successful. Response code description:
|
| body | Object | Content details returned by the API, including details about related indicators. |
Output Example of the PublishMessage Function
{
"headers": {
"content-length": "97",
"X-Request-Id": "6962c9b0f7f946d4ac557044d2aa61bd",
"content-type": "application/json; charset=UTF-8"
},
"code": 200,
"body": {
"message_id": "6a93a879a41b4746958aad33e2dec017",
"request_id": "6962c9b0f7f946d4ac557044d2aa61bd"
}
} Plugin Execution Function showTopicList
- Parameters of the ShowTopicList Function: describes the input and output parameters of the function.
- Output Example of the showTopicList Function: provides an example of the function output.
Parameters of the ShowTopicList Function
Function: Calls the corresponding SMN API to query the topic list by page.
| Parameter | Parameter Type | Parameter Description | Mandatory |
|---|---|---|---|
| topicName | String | Unique ID of the SMN topic. The topic name is used for fuzzy match. | No |
| page | Int | Page number for pagination query. The default value is 1. | No |
| size | Int | Number of data records on each page. The default value is 100, and the maximum value is 100. | No |
| Parameter | Parameter Type | Parameter Description |
|---|---|---|
| topicList | Array | Topic structure array. |
| topicCount | Int | Number of returned topics. |
Output Example of the showTopicList Function
{
"request_id": "6a63a18b8bab4xxxxxxxxxxbd9cb80d0085",
"topic_count": 1,
"topics": [{
"topic_urn": "urn:smn:regionId:8bad8a40e0f746xxxxxxe3f93a8183:xxxxx",
"display_name": "testtest",
"name": "test_topic_v1",
"push_policy": 0,
"enterprise_project_id": "0",
"topic_id": "84698185xxxxxx31aa441d8e2cf2",
"create_time": "2016-08-02T08:22:18Z",
"update_time": "2016-08-02T08:22:18Z"
}]
} Plugin Execution Function deleteSubscription
- Parameters of the deleteSubscription Function: describes the input and output parameters of the function.
- Output Example of the deleteSubscription Function: provides an example of the function output.
Parameters of the deleteSubscription Function
Function: Calls the corresponding SMN API to delete a subscriber.
| Parameter | Parameter Type | Parameter Description | Mandatory |
|---|---|---|---|
| topicUrn | String | Unique ID of the SMN topic. You can obtain the ID from the SMN console. | No |
| subscriptionUrn | String | Unique ID of an SMN subscription. This ID can be obtained from the subscription page on the SMN console. | No |
| agency_type | String | Unified adaptation parameter for multiple accounts. Use the default value. | No |
| Parameter | Parameter Type | Parameter Description |
|---|---|---|
| header | Object | Header of the response returned by the API. It includes basic information about the request and response, such as the request time, response service, and request ID. |
| code | Int | Status code, which indicates whether the request is successful. Response code description:
|
| body | Object | Content details returned by the API, including details about related indicators. |
Output Example of the deleteSubscription Function
{
"headers": {
"content-length": "49",
"X-Request-Id": "6d34c5dad23c4a56993efba96b064aad",
"content-type": "application/json; charset=UTF-8"
},
"code": 200,
"body": {
"request_id": "6d34c5dad23c4a56993efba96b064aad"
}
} Plugin Execution Function createTopic
- Parameters of the createTopic Function: describes the input and output parameters of the function.
- Output Example of the createTopic Function: provides an example of the function output.
Parameters of the createTopic Function
Function: Calls the corresponding SMN API to create a topic. You can subscribe to the topic to receive notifications.
| Parameter | Parameter Type | Parameter Description | Mandatory |
|---|---|---|---|
| topicName | String | Unique ID of the topic to be created. The key of the topic will be used for subsequent queries. | No |
| displayName | String | Alias of the topic to be created. The alias will be displayed during notifications. | No |
| agency_type | String | Unified adaptation parameter for multiple accounts. Use the default value. | No |
| Parameter | Parameter Type | Parameter Description |
|---|---|---|
| header | Object | Header of the response returned by the API. It includes basic information about the request and response, such as the request time, response service, and request ID. |
| code | Int | Status code, which indicates whether the request is successful. Response code description:
|
| body | Object | Content details returned by the API, including details about related indicators. |
Output Example of the createTopic Function
{
"headers": {
"content-length": "120",
"X-Request-Id": "06b920f350e4452cbc9f5194720158cf",
"content-type": "application/json; charset=UTF-8"
},
"code": 201,
"body": {
"topic_urn": "urn:smn:cn-north-7:f8aexxxx418c5fe15xxx05:test",
"request_id": "06b920f350e4452cbc9f5194720158cf"
}
} Plugin Execution Function addSubscription
- Parameters of the addSubscription Function: describes the input and output parameters of the function.
- Output Example of the addSubscription Function: provides an example of the function output.
Parameters of the addSubscription Function
Function: Calls the corresponding SMN API to add a subscriber to a specified topic. If the subscriber is in the unconfirmed state, a confirmation message is sent to the subscriber. After confirming the subscription, the subscriber can receive notification messages published to the topic.
| Parameter | Parameter Type | Parameter Description | Mandatory |
|---|---|---|---|
| topicUrn | String | Unique ID of the SMN topic. You can obtain the ID from the SMN console. | No |
| protocol | String | Subscription protocol. (Different protocols indicate different types of endpoints to receive messages.) The following protocols are supported:
| No |
| endpoint | String | Subscriber endpoint:
| No |
| agency_type | String | Unified adaptation parameter for multiple accounts. Use the default value. | No |
| Parameter | Parameter Type | Parameter Description |
|---|---|---|
| header | Object | Header of the response returned by the API. It includes basic information about the request and response, such as the request time, response service, and request ID. |
| code | Int | Status code, which indicates whether the request is successful. Response code description:
|
| body | Object | Content details returned by the API, including details about related indicators. |
Output Example of the addSubscription Function
{
"headers": {
"content-length": "160",
"X-Request-Id": "c000414f92854bcc89cedd5709522aff",
"content-type": "application/json; charset=UTF-8"
},
"code": 201,
"body": {
"subscription_urn": "urn:smn:cn-north-7:f8ae07d4148f4xxxx15833f6b105:test:5e1a12580fxxxx22745666408ec",
"request_id": "c000xxxxx4bcc89cedd5709522aff"
}
} Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot