Querying SMN Topics
Function
This API is used to query the SMN topics of a user. You can obtain their key information, such as topic names, IDs, and the quantity, helping you learn about the message push channels and statuses.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
lts:alarmNoticeTemplate:list
List
-
-
- lts:sqlalarmrules:get
smn:topic:list
URI
GET /v2/{project_id}/lts/notifications/topics
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID. It can be obtained by calling an API or from the console. For details, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
offset |
Yes |
Integer |
Definition Offset of the SMN topic list. The initial value is 0. For all subsequent requests, use the offset value provided in the previous API response. Constraints N/A Range N/A Default Value N/A |
|
limit |
Yes |
Integer |
Definition Maximum number of results that can be returned in a single query of the SMN topic list. Constraints N/A Range
Default Value 10 |
|
fuzzy_name |
No |
String |
Definition Name of the topic to be searched for. Fuzzy match is performed based on the prefix match mode. Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token obtained from IAM. For details about how to obtain it, see Obtaining a User Token. Constraints: N/A Range N/A Default Value N/A |
|
Content-Type |
Yes |
String |
Definition Message body format. Set this parameter to application/json;charset=utf8. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
request_id |
String |
Definition Unique ID of the request. Range N/A |
|
topic_count |
Integer |
Definition Total number of SMN topic information records. Range N/A |
|
topics |
Array of Topics objects |
Definition SMN topic information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Definition SMN topic name. Range N/A |
|
topic_urn |
String |
Definition Unique resource ID of the SMN topic. Range N/A |
|
display_name |
String |
Definition Sender name displayed in an email. Range N/A |
|
push_policy |
Integer |
Definition Message push policy. Currently, this attribute is not modifiable. Support for modifying this setting will be added in a future update. Range
|
Example Requests
Query SMN topics.
GET https://{endpoint}/v2/{project_id}/lts/notifications/topics
/v2/{project_id}/lts/notifications/topics?offset={offset}&limit={limit}
Example Responses
Status code: 200
The request is successful.
{
"request_id" : "1",
"topic_count" : 100,
"topics" : [ {
"name" : "huawei",
"topic_urn" : "urn:smn:cn-north-7:{projectId}:fyy",
"display_name" : "",
"push_policy" : 0
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
The request is successful. |
Error Codes
See Error Codes.
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