Updating an Event Subscription
Function
This API is used to update an event subscription.
Calling Method
For details, see Calling APIs.
URI
PUT /v1/{project_id}/event-subs/{subscription_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID. For how to obtain it, see Obtaining a Project ID. Constraints N/A Range The value can contain 1 to 64 characters. Only letters and digits are allowed. Default Value N/A |
|
subscription_id |
Yes |
String |
Definition Subscription ID. Constraints N/A Range The value can contain 1 to 64 characters. Only letters and digits are allowed. Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. You can obtain it by calling the IAM API for obtaining a user token. The user token is the value of X-Subject-Token in the response header. For details, see Token-based Authentication. Constraints N/A Range The value can contain 1 to 32,768 characters. Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
enable |
No |
Boolean |
Definition Whether to enable subscription Constraints N/A Range
Default Value false |
|
event_ids |
No |
Array |
Definition IDs of events contained in the subscription. Event IDs are separated by commas (,). Each event type corresponds to a fixed event ID. Constraints N/A Range
Default Value N/A |
|
event_streamids |
No |
Array |
Definition IDs of the streams to subscribe to. If stream subscription is disabled, all streams are subscribed to by default. If stream subscription is enabled, you can select the IDs of the streams to subscribe to. The IDs are separated by commas (,). Constraints N/A Range N/A Default Value N/A |
|
name |
No |
String |
Definition Name of the subscription to be updated Constraints N/A Range The value can contain 1 to 64 characters. Only letters and digits are allowed. Default Value N/A |
|
topic_name |
Yes |
String |
Definition SMN topic name or DIS stream name, which cannot be left blank. If the subscription type is SMN, this parameter indicates the name of the selected SMN topic. If the subscription type is DIS, this parameter indicates the name of the selected DIS stream. Constraints There must be an SMN topic or DIS stream. Otherwise, you must create one. Range N/A Default Value N/A |
|
topic_type |
No |
Integer |
Definition Subscription type, which can be SMN notification or DIS stream Constraints N/A Range
Default Value N/A |
|
topic_urn |
No |
String |
Definition Uniform resource name of the topic Constraints If the subscription type is DIS, the value is null. If the subscription type is SMN, the value is a string in the following format: urn:smn:region_id:projectid:smn topic. Range N/A Default Value N/A |
Response Parameters
Status code: 200
Normal response
None
Example Requests
-
Update the event subscription type to SMN notification.
PUT https://{Endpoint}/v1/{project_id}/event-subs/{subscription_id} { "enable" : true, "events_ids" : "0: \"dis_event.000\"\n1: \"dis_event.001\"", "event_streamids" : [ ], "name" : "dis-test1", "topic_name" : "test", "topic_type" : 0, "topic_urn" : "urn:smn:cn-southwest-2:575ae927fc644f22b5c5af5209b7cf51:test" } -
Update the event subscription type to DIS stream.
{ "enable" : true, "events_ids" : "0: \"dis_event.000\"\n1: \"dis_event.001\"", "event_streamids" : "0: \"Xs5eBSKtWBbFJR2xxxx\"\n1: \"e4CH131AqCyjucWxxxx\"", "name" : "dis-test1", "topic_name" : "dis-boce-notelete", "topic_type" : 1, "topic_urn" : null }
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Normal response |
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