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. Default: None Minimum: 32 Maximum: 32 |
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. Minimum: 0 Maximum: 1024 |
limit |
Yes |
Integer |
Number of records on each page. The maximum value is 100. Minimum: 0 Maximum: 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. Default: None Minimum: 1000 Maximum: 2000 |
Content-Type |
Yes |
String |
Set this parameter to application/json;charset=UTF-8. Default: None Minimum: 30 Maximum: 30 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
request_id |
String |
request_id Minimum: 1 Maximum: 64 |
topic_count |
Integer |
Number of topics. Minimum: 0 Maximum: 1000 |
topics |
Array of Topics objects |
Topic information. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Topic name. Minimum: 1 Maximum: 1024 |
topic_urn |
String |
Specifies the resource identifier of the topic, which is unique. Minimum: 1 Maximum: 1024 |
display_name |
String |
Specifies the topic display name, which is presented as the name of the email sender in email messages. Minimum: 1 Maximum: 1024 |
push_policy |
Integer |
Specifies the message push policy. Minimum: 1 Maximum: 1024 |
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