CLI Command Reference
Subscribers
| API Name | Command | Description | Operation |
|---|---|---|---|
| Adding a Subscriber | hcloud SMNGLOBAL CreateSubscriptionUser | This API is used to add a subscriber. If the subscriber is in the Unconfirmed status, the system sends a subscription confirmation message to the subscriber. After the subscriber clicks the subscription confirmation link, the subscriber status changes to Confirmed and a subscription cancellation message is sent to the subscriber so that the subscriber can cancel the subscription at any time. After the subscriber clicks the link to cancel the subscription, the subscriber status changes to Cancelled and a new subscription confirmation message is sent to the subscriber so that the subscriber can subscribe again. | |
| Querying Subscribers | hcloud SMNGLOBAL ListSubscriptionUser | This API is used to query subscribers. | |
| Deleting a Subscriber | hcloud SMNGLOBAL DeleteSubscriptionUser | This API is used to delete a subscriber. | |
| Updating a Subscriber | hcloud SMNGLOBAL UpdateSubscriptionUser | This API is used to update a subscriber. |
Topics
| API Name | Command | Description | Operation |
|---|---|---|---|
| Querying Topics | hcloud SMN ListTopics | This API is used to query topics by page. The topics are sorted by creation time in descending order. You can specify offset and limit. If no topic has been created, an empty list is returned. | |
| Creating a Topic | hcloud SMN CreateTopic | This API is used to create a topic. Each user can create a maximum of 3,000 topics. In high-concurrency scenarios, more than 3,000 topics may be created. This is acceptable. | |
| Querying Details About a Topic | hcloud SMN ListTopicDetails | This API is used to query details about a topic. | |
| Updating a Topic | hcloud SMN UpdateTopic | This API is used to update the topic display name. | |
| Deleting a Topic | hcloud SMN DeleteTopic | This API is used to delete a topic. | |
| Querying a Topic Policy | hcloud SMN ListTopicAttributes | This API is used to query a topic policy. | |
| Deleting All Topic Policies | hcloud SMN DeleteTopicAttributes | This API is used to delete all topic policies. | |
| Updating a Topic Policy | hcloud SMN UpdateTopicAttribute | This API is used to update a topic policy. | |
| Deleting a Specified Topic Policy | hcloud SMN DeleteTopicAttributeByName | This API is used to delete a topic policy with a specified name. | |
| Querying Sending Details of a Topic | hcloud SMN ListTopicMessageStatistics | This API is used to query the data sent by a topic. You can query all statistical data of the last 31 days. | |
| Querying the Topic List Along with Their Associated Resources | hcloud SMN ListTopicsWithAssociatedResources | This API is used to query the topic list along with their associated resources. The associated resources will grow as the service expands. By default, topics are sorted by creation time in descending order. You can specify offset and limit for pagination query. If no topic has been created, an empty list is returned. |
Subscriptions
| API Name | Command | Description | Operation |
|---|---|---|---|
| Batch Deleting Subscriptions | hcloud SMN BatchDeleteSubscriptions | This API is used to delete subscriptions in a batch. The deletion result of each subscription endpoint is displayed in the response body. | |
| Querying Subscriptions | hcloud SMN ListSubscriptions | This API is used to query all subscriptions of a requestor by page. The subscriptions are sorted by creation time in ascending order. You can specify offset and limit. If there are no subscriptions, an empty list is returned. | |
| Batch Deleting Subscriptions from a Specified Topic | hcloud SMN BatchDeleteSubscriptionsByTopic | This API is used to batch delete subscriptions from a specified topic. The deletion result of each subscription endpoint is displayed in the response body. | |
| Querying Subscriptions of a Specified Topic | hcloud SMN ListSubscriptionsByTopic | This API is used to query subscriptions of a specified topic by page. The subscriptions are sorted by creation time in ascending order. You can specify offset and limit. If the topic has no subscriptions, an empty list is returned. | |
| Adding a Subscription | hcloud SMN AddSubscription | This API is used to add a subscription to a specified topic. If the status of the subscriber is unconfirmed, a confirmation message is sent to the subscriber. After confirming the subscription, the subscriber can receive notification messages published to the topic. By default, 10,000 subscriptions can be added to a topic. However, in a high-concurrency scenario, extra subscriptions may be added successfully. This is acceptable. The API is idempotent. If the added subscription already exists, a successful result and status code 200 are returned. Otherwise, the status code is 201. | |
| Deleting a Subscription | hcloud SMN CancelSubscription | This API is used to delete a specified subscription. | |
| Deleting a Subscription from a Specified Topic | hcloud SMN DeleteSubscriptionsByTopic | This API is used to delete a subscription from a specified topic. | |
| Updating a Subscription | hcloud SMN UpdateSubscription | This API is used to update the remarks of a subscription. | |
| Importing a Subscription | hcloud SMN AddSubscriptionFromSubscriptionUser | This API is used to add a subscription to a specified topic. The subscription information comes from the subscriber list. | |
| Confirming a Subscription | hcloud SMN ConfirmSubscription | This API is used to confirm the message of subscription to a topic. | |
| Canceling a Subscription | hcloud SMN UnsubscribeSubscription | This API is used to cancel a subscription. | |
| Subscribing to a Topic | hcloud SMN SubscribeTopic | This API is used to confirm the subscription to a topic. | |
| Unsubscribing from a Topic | hcloud SMN UnsubscribeTopic | This API is used to unsubscribe from a topic. |
Templates
| API Name | Command | Description | Operation |
|---|---|---|---|
| Querying Message Templates | hcloud SMN ListMessageTemplates | This API is used to query message templates by page. The templates are sorted by creation time in ascending order. You can specify offset and limit. If no template has been created, an empty list is returned. The additional query parameters are message_template_name and protocol. | |
| Creating a Message Template | hcloud SMN CreateMessageTemplate | This API is used to create a template. You can send messages based on the template to reduce the amount of data in requests. | |
| Querying Details About a Message Template | hcloud SMN ListMessageTemplateDetails | This API is used to query details about a template, including the template content. | |
| Updating a Message Template | hcloud SMN UpdateMessageTemplate | This API is used to modify the content of a message template. | |
| Deleting a Message Template | hcloud SMN DeleteMessageTemplate | This API is used to delete a message template. After a template is deleted, you can no longer use it to publish messages. |
Message Publishing
| API Name | Command | Description | Operation |
|---|---|---|---|
| Publishing a Message | hcloud SMN PublishMessage | This API is used to send a message to all subscription endpoints of a topic. After the message ID is returned, the message has been saved and is to be pushed to the subscribers of the topic. To send messages to subscribers successfully, ensure that your message content complies with local laws and regulations. | |
| Publishing a Detection Message | hcloud SMN PublishHttpDetect | This API is used to send an HTTP/HTTPS detection message to a topic to check whether the current HTTP/HTTPS endpoint is available and whether the SMN egress can access the endpoint. | |
| Obtaining the HTTP Detection Result | hcloud SMN ShowHttpDetectResult | This API is used to query the detection result based on task_id returned by the HTTP detection. |
Tags
| API Name | Command | Description | Operation |
|---|---|---|---|
| Querying Resources by Tag | hcloud SMN ListResourceInstances | This API is used to query resources by tag. | |
| Adding or Deleting Tags in a Batch | hcloud SMN BatchCreateOrDeleteResourceTags | This API is used to add or delete tags for a specified instance in a batch. A maximum of 10 tags can be added to a resource. | |
| Querying Resource Tags | hcloud SMN ListResourceTags | This API is used to query tags of a specified instance. | |
| Adding a Resource Tag | hcloud SMN CreateResourceTag | A maximum of 10 tags can be added to a resource. The API is idempotent. If a to-be-created tag has the same key as an existing tag, the tag will be created and overwrite the existing one. | |
| Querying Project Tags | hcloud SMN ListProjectTags | This API is used to query all tags of a specified instance type for a tenant in a specific region. | |
| Deleting a Resource Tag | hcloud SMN DeleteResourceTag | The API is idempotent. When deleting a tag, the system does not verify it. The tag key cannot be left blank or be an empty string. If the key of the tag to be deleted does not exist, 404 will be returned. |
Applications
| API Name | Command | Description | Operation |
|---|---|---|---|
| Querying Applications | hcloud SMN ListApplications | This API is used to query applications. | |
| Creating an Application | hcloud SMN CreateApplication | This API is used to create an application. | |
| Querying Application Attributes | hcloud SMN ListApplicationAttributes | This API is used to obtain attributes of an application. | |
| Updating an Application | hcloud SMN UpdateApplication | This API is used to update an application. | |
| Deleting an Application | hcloud SMN DeleteApplication | This API is used to delete an application. |
Application Endpoints
| API Name | Command | Description | Operation |
|---|---|---|---|
| Querying Application Endpoints | hcloud SMN ListApplicationEndpoints | This API is used to query application endpoints. | |
| Creating an Application Endpoint | hcloud SMN CreateApplicationEndpoint | This API is used to create an application endpoint. | |
| Querying Application Endpoint Attributes | hcloud SMN ListApplicationEndpointAttributes | This API is used to query attributes of an application endpoint. | |
| Updating an Application Endpoint | hcloud SMN UpdateApplicationEndpoint | This API is used to update device attributes. | |
| Deleting an Application Endpoint | hcloud SMN DeleteApplicationEndpoint | This API is used to delete a device. |
Sending an Application Message
| API Name | Command | Description | Operation |
|---|---|---|---|
| Sending an Application Message | hcloud SMN PublishAppMessage | This API is used to directly send a message to an endpoint. |
API Version Query
Cloud Logs
| API Name | Command | Description | Operation |
|---|---|---|---|
| Binding a Cloud Log | hcloud SMN CreateLogtank | This API is used to bind a cloud log to a specified topic to record information such as the message sending status. | |
| Querying Cloud Logs | hcloud SMN ListLogtank | This API is used to query cloud logs bound to a specified topic. | |
| Updating a Cloud Log | hcloud SMN UpdateLogtank | This API is used to update a cloud log bound to a specified topic. | |
| Unbinding a Cloud Log | hcloud SMN DeleteLogtank | This API is used to unbind a log from a specified topic. |
Message Filter Policies for Subscriptions
| API Name | Command | Description | Operation |
|---|---|---|---|
| Creating Message Filter Policies for Subscriptions | hcloud SMN BatchCreateSubscriptionsFilterPolices | This API is used to create message filter policies for subscriptions. | |
| Updating Message Filter Policies for Subscriptions | hcloud SMN BatchUpdateSubscriptionsFilterPolices | This API is used to update message filter policies for subscriptions. | |
| Deleting Message Filter Policies for Subscriptions | hcloud SMN BatchDeleteSubscriptionsFilterPolices | This API is used to delete message filter policies for subscriptions. |
Notification Policies
| API Name | Command | Description | Operation |
|---|---|---|---|
| Creating a Notification Policy | hcloud SMN CreateNotifyPolicy | This API is used to create a notification policy. | |
| Querying Notification Policies | hcloud SMN ShowNotifyPolicy | This API is used to query notification policies. | |
| Modifying a Notification Policy | hcloud SMN UpdateNotifyPolicy | This API is used to modify a notification policy. You need to include all parameters required in the request body. | |
| Deleting a Notification Policy | hcloud SMN DeleteNotifyPolicy | This API is used to delete a notification policy. |
Protocols
| API Name | Command | Description | Operation |
|---|---|---|---|
| Querying Protocols | hcloud SMN ListProtocols | This API is used to query the protocols supported by SMN. |
Cloud Service Authorization
Certificates
| API Name | Command | Description | Operation |
|---|---|---|---|
| Downloading a Certificate | hcloud SMN DownloadHttpCert | This API is used to download an HTTP message verification certificate. | |
| Downloading an HTTP Signature Certificate | hcloud SMN DownloadHttpSignCert | This API is used to download an HTTP signature certificate. |
Keys
| API Name | Command | Description | Operation |
|---|---|---|---|
| Binding a KMS Key to a Topic | hcloud SMN CreateKmsKey | This API is used to bind a KMS key to a topic. A KMS key is applied 5 minutes later after being bound to a topic. After a KMS key is applied, all messages published to the topic, including subscription confirmation messages, subscription cancellation messages, and topic messages, are encrypted and decrypted using the data key of the KMS key, and then transmitted in SMN. Before binding a KMS key, create an agency named smn_kms_agency on IAM and assign resource operation permissions to SMN. SMN uses this agency to create a data key. | |
| Querying the KMS Key Bound to a Topic | hcloud SMN ShowKmsKey | This API is used to query the ID of the key bound to a topic. Before binding a KMS key, create an agency named smn_kms_agency on IAM and assign resource operation permissions to SMN. SMN uses this agency to query key information. | |
| Updating the KMS Key Bound to a Topic | hcloud SMN UpdateKmsKey | This API is used to update the key ID. Before updating a KMS key, create an agency named smn_kms_agency on IAM and assign resource operation permissions to SMN. SMN uses this agency to query the key status and create a data key. | |
| Deleting the KMS Key Bound to a Topic | hcloud SMN DeleteKmsKey | This API is used to delete the key bound to a topic. |
What is your overall rating for this page?
Thank 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