Updating an Event Subscription Source
Function
This API is used to update the source of an event subscription.
URI
PUT /v1/{project_id}/subscriptions/{subscription_id}/sources/{source_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Tenant resource space ID. |
subscription_id |
Yes |
String |
ID of the event subscription. |
source_id |
Yes |
String |
ID of the event source. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
ID of an enterprise project used for creating a subscription. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
No |
String |
ID of the subscription source, which must be globally unique. If the subscription source with the specified ID exists, the subscription source is updated. Otherwise, the subscription source is created. If no ID is specified, the system automatically generates an ID when creating the subscription source. Only lowercase letters, digits, and hyphens (-) are allowed. It must start with a letter or digit. |
name |
Yes |
String |
Name of the event subscription source. |
provider_type |
Yes |
String |
Provider type of the event subscription source. |
detail |
No |
Object |
List of event subscription source parameters. The total length of this field after serialization cannot exceed 1024 bytes. |
filter |
Yes |
Object |
Filtering rule of the event subscription source. The total length of this field after serialization cannot exceed 2048 bytes. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
X-Request-Id |
String |
This field is the request ID number for task tracking. Format is request_uuid-timestamp-hostname. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
ID of the event subscription source. |
name |
String |
Name of the event subscription source. |
provider_type |
String |
Provider type of the event subscription source. |
detail |
Object |
List of event subscription source parameters. |
filter |
Object |
Filtering rule of the event subscription source. |
created_time |
String |
Time when the event subscription is created. |
updated_time |
String |
Time when the event subscription is updated. |
Example Requests
Update an event subscription source.
PUT https://{endpoint}/v1/{project_id}/subscriptions/{subscription_id}/sources/{source_id} { "id" : "3a0eeff2-78a4-4122-dfge-7ty5e37f64er", "name" : "HC.OBS", "provider_type" : "OFFICIAL", "detail" : { "name" : "name" }, "filter" : { "data" : { "count" : [ { "op" : "NumberIn", "values" : [ 1, 2 ] } ] } } }
Example Responses
Status code: 200
Information
{ "id" : "3a0eeff2-78a4-4122-dfge-7ty5e37f64er", "name" : "HC.OBS", "provider_type" : "OFFICIAL", "detail" : { "name" : "name" }, "filter" : { "data" : { "count" : [ { "op" : "NumberIn", "values" : [ 1, 2 ] } ] } }, "created_time" : "2021-12-09 09:00:00", "updated_time" : "2021-12-09 09:00:00" }
Status Codes
Status Code |
Description |
---|---|
200 |
Information |
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