Modifying a Key Event Notification
Function
This API is used to modify a key event notification. The notification_id field specifies the notification to be modified. A valid and existing notification_id must be provided for the request to succeed.
Calling Method
For details, see Calling APIs.
URI
PUT /v3/{project_id}/notifications
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details, see Obtaining an Account ID and Project ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| notification_name | Yes | String | Key event notification name. |
| operation_type | Yes | String | Operation type. Possible options include complete and customized. If you choose complete, notifications will be triggered for any supported operation on any connected cloud service. If you choose customized, notifications will only be sent when the specific operations defined in operations occur. |
| operations | No | Array of Operations objects | Operation list. |
| notify_user_list | No | Array of NotificationUsers objects | List of users whose operations will trigger notifications. Currently, up to 50 users in 10 user groups can be configured. |
| status | Yes | String | Notification status. Possible options include enabled and disabled. |
| topic_id | No | String | SMN topic URN or FunctionGraph function URN. This parameter is mandatory when status is set to enabled. To obtain the topic URN, call the SMN API for querying topics. Example URN: urn:smn:regionId:f96188c7ccaf4ffba0c9aa149ab2bd57:test_topic_v2 To obtain the function URN, call the FunctionGraph API for querying functions. Example URN urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test |
| notification_id | Yes | String | Key event notification ID. |
| filter | No | Filter object | Advanced filter of the key event notification. |
| agency_name | No | String | Cloud service agency name. If this parameter is set to cts_admin_trust, a cloud service agency named cts_admin_trust is automatically created during key event notification creation. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| service_type | Yes | String | Cloud service. The value must be the uppercase acronym of a cloud service connected with CTS. For cloud services that can be connected with CTS, see section "Supported Services and Operations" in Cloud Trace Service User Guide. You can click the document link of each cloud service to view its acronym. |
| resource_type | Yes | String | Resource type. |
| trace_names | Yes | Array of strings | Trace name. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| user_group | Yes | String | IAM user group. |
| user_list | Yes | Array of strings | IAM user. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| condition | Yes | String | Relationship between conditions.
|
| is_support_filter | Yes | Boolean | Whether to enable the advanced filter. |
| rule | Yes | Array of strings | Advanced filter criteria rule. Example: key != value. Format: field rule value- Field value range: api_version, code, trace_rating, trace_type, resource_id, and resource_name.- Rule: != or =.- Value: api_version: ^(a-zA-Z0-9_-.){1,64}$; code: 1 to 256 characters; trace_rating: normal, warning, or incident; trace_type: *ConsoleAction, ApiCall, or SystemAction; *resource_id: 1 to 350 characters; resource_name: 1 to 256 characters. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| notification_name | String | Key event notification name. |
| operation_type | String | Operation type. Possible options include complete and customized. If you choose complete, notifications will be triggered for any supported operation on any connected cloud service. If you choose customized, notifications will only be sent when the specific operations defined in operations occur. |
| operations | Array of Operations objects | Operation list. |
| notify_user_list | Array of NotificationUsers objects | List of users whose operations will trigger notifications. Currently, up to 50 users in 10 user groups can be configured. |
| status | String | Notification status. Possible options include enabled and disabled. |
| topic_id | String | SMN topic URN or FunctionGraph function URN. To obtain the topic URN, call the SMN API for querying topics. Example URN: urn:smn:regionId:f96188c7ccaf4ffba0c9aa149ab2bd57:test_topic_v2 To obtain the function URN, call the FunctionGraph API for querying functions. Example URN urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test |
| notification_id | String | Unique notification ID. |
| notification_type | String | Notification type identified based on topic_id. Possible options include SMN (smn) and FunctionGraph (fun). |
| project_id | String | Project ID. |
| create_time | Long | Timestamp when a notification was created. |
| filter | Filter object | Advanced filter of the key event notification. |
| agency_name | String | Cloud service agency name. If this parameter is set to cts_admin_trust, a cloud service agency named cts_admin_trust is automatically created during key event notification modification. |
| Parameter | Type | Description |
|---|---|---|
| service_type | String | Cloud service. The value must be the uppercase acronym of a cloud service connected with CTS. For cloud services that can be connected with CTS, see section "Supported Services and Operations" in Cloud Trace Service User Guide. You can click the document link of each cloud service to view its acronym. |
| resource_type | String | Resource type. |
| trace_names | Array of strings | Trace name. |
| Parameter | Type | Description |
|---|---|---|
| user_group | String | IAM user group. |
| user_list | Array of strings | IAM user. |
| Parameter | Type | Description |
|---|---|---|
| condition | String | Relationship between conditions.
|
| is_support_filter | Boolean | Whether to enable the advanced filter. |
| rule | Array of strings | Advanced filter criteria rule. Example: key != value. Format: field rule value- Field value range: api_version, code, trace_rating, trace_type, resource_id, and resource_name.- Rule: != or =.- Value: api_version: ^(a-zA-Z0-9_-.){1,64}$; code: 1 to 256 characters; trace_rating: normal, warning, or incident; trace_type: *ConsoleAction, ApiCall, or SystemAction; *resource_id: 1 to 350 characters; resource_name: 1 to 256 characters. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. Format: CTS.XXX. |
| error_msg | String | Error message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. Format: CTS.XXX. |
| error_msg | String | Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. Format: CTS.XXX. |
| error_msg | String | Error message. |
Status code: 404
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. Format: CTS.XXX. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. Format: CTS.XXX. |
| error_msg | String | Error message. |
Status code: 503
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. Format: CTS.XXX. |
| error_msg | String | Error message. |
Example Requests
Modify a key event notification.
PUT https://{endpoint}/v3/{project_id}/notifications
{
"notification_id" : "6d4a09bb-aa8e-40db-9e87-0d5e203823a8",
"notification_name" : "test",
"agency_name" : "cts_admin_trust",
"operation_type" : "customized",
"operations" : [ {
"service_type" : "CTS",
"resource_type" : "tracker",
"trace_names" : [ "createTracker", "deleteTracker" ]
}, {
"service_type" : "CTS",
"resource_type" : "notification",
"trace_names" : [ "deleteNotification", "updateNotification" ]
}, {
"service_type" : "AOM",
"resource_type" : "pe",
"trace_names" : [ "deletePolicyGroup", "updatePolicyGroup", "createPolicyGroup" ]
} ],
"notify_user_list" : [ {
"user_group" : "admin",
"user_list" : [ "test", "test1" ]
}, {
"user_group" : "CTS view",
"user_list" : [ "test2", "test3" ]
} ],
"status" : "enabled",
"topic_id" : "urn:smn:{regionid}:24edf66e79d04187acb99a463e610764:foo"
} Example Responses
Status code: 200
The key event notification is modified.
{
"notification_id" : "6d4a09bb-aa8e-40db-9e87-0d5e203823a8",
"notification_name" : "test",
"agency_name" : "cts_admin_trust",
"operation_type" : "customized",
"operations" : [ {
"service_type" : "CTS",
"resource_type" : "tracker",
"trace_names" : [ "createTracker", "deleteTracker" ]
}, {
"service_type" : "CTS",
"resource_type" : "notification",
"trace_names" : [ "deleteNotification", "updateNotification" ]
}, {
"service_type" : "AOM",
"resource_type" : "pe",
"trace_names" : [ "deletePolicyGroup", "updatePolicyGroup", "createPolicyGroup" ]
} ],
"notify_user_list" : [ {
"user_group" : "admin",
"user_list" : [ "test", "test1" ]
}, {
"user_group" : "CTS view",
"user_list" : [ "test2", "test3" ]
} ],
"status" : "enabled",
"project_id" : "24edf66e79d04187acb99a463e610764",
"notification_type" : "smn",
"create_time" : 1634001495876,
"topic_id" : "urn:smn:{regionid}:24edf66e79d04187acb99a463e610764:foo"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The key event notification is modified. |
| 400 | The server failed to process the request. |
| 401 | The request is rejected due to authentication failure. |
| 403 | The server understood the request but refused to authorize it. |
| 404 | The server failed to find the requested resource or some key event notifications failed to be deleted. |
| 500 | The request failed to be executed or some trackers failed to be deleted. |
| 503 | The requested service is invalid. The client should not repeat the request without modifications. |
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