Querying an SMN Topic
Function
This API is used to query an SMN topic.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/lts/notifications/topics
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see Obtaining the Project ID, Account ID, Log Group ID, and Log Stream ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
offset |
Yes |
Integer |
Query cursor. Set the value to 0 in the first query. In subsequent queries, obtain the value from the response to the last request. |
limit |
Yes |
Integer |
Number of records on each page. The maximum value is 100. |
fuzzy_name |
No |
String |
Specifies the name of the topic to be searched for, which is fuzzy match. startwith is used for the fuzzy match. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token obtained from IAM. For details about how to obtain a user token, see Obtaining a User Token. |
Content-Type |
Yes |
String |
Set this parameter to application/json;charset=UTF-8. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
request_id |
String |
request_id |
topic_count |
Integer |
Number of topics. |
topics |
Array of Topics objects |
Topic information. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Topic name. |
topic_urn |
String |
Specifies the resource identifier of the topic, which is unique. |
display_name |
String |
Specifies the topic display name, which is presented as the name of the email sender in email messages. |
push_policy |
Integer |
Specifies the message push policy. |
Example Requests
Querying an SMN topic
POST 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