Modifying an Alarm Masking Rule
Function
This API is used to modify an alarm notification masking rule.
You cannot modify the alarm masking rules for masking alarms by alarm rules, but you can modify those for masking alarms by resource, policy, and event.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
ces:alarms:putNotificationMaskRules
Write
-
g:EnterpriseProjectId
ces:notificationMasks:update
-
URI
PUT /v2/{project_id}/notification-masks/{notification_mask_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. It is used to specify the project that an asset belongs to. You can query the assets of a project by project ID. You can obtain the project ID from the API or console. For details, see Obtaining a Project ID. Constraints N/A Range 1 to 64 characters. Default Value N/A |
| notification_mask_id | Yes | String | Definition Masking rule ID. Constraints N/A Range The value allows 1 to 64 characters and can only contain letters and digits. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | No | String | Definition MIME type of the request body. Constraints: None Value range: The value can contain 1 to 64 characters. Default value: The default type is application/json; charset=UTF-8. |
| X-Auth-Token | No | String | Definition User token. Constraints: None Value range: The value can contain 1 to 16,384 characters. Default value: None |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| mask_name | Yes | String | Definition Masking rule name. Constraints N/A Range The value allows 1 to 64 characters. It can only contain letters, digits, hyphens (-), and underscores (_). Default Value N/A |
| relation_ids | No | Array of strings | Definition Association ID, which is an alarm rule ID or alarm policy ID. Constraints You can specify 1 to 100 IDs. If relation_type is set to RESOURCE_POLICY_NOTIFICATION, enter the ID of the masked alarm policy. |
| relation_type | No | String | Definition Method for masking alarm notifications. Constraints N/A Range The value allows 1 to 32 characters and can only be: Default Value N/A |
| metric_names | No | Array of strings | Definition List of associated metrics. Constraints This parameter is optional when relation_type is set to RESOURCE. If this parameter is left blank, the masking rule will be applied to all metrics of the resource. The number of metrics ranges from 0 to 50. |
| product_metrics | No | Array of ProductMetric objects | Definition Metric information when the masking rule is applied by cloud product. Constraints 0 to 50 metrics. |
| resource_level | No | String | Definition Resource level. Constraints N/A Range The value can be: Default Value N/A |
| product_name | No | String | Definition Name of a cloud product when the resource level is cloud product. Constraints N/A Range 0 to 128 characters. Default Value N/A |
| resources | Yes | Array of Resource objects | Definition Associated resources. Constraints Array length: [1,100] |
| mask_type | Yes | String | Definition Masking type. Constraints N/A Range The value can be: Default Value N/A |
| start_date | No | String | Definition Masking start date. Constraints N/A Range The value contains 10 characters and is in the yyyy-MM-dd format. Default Value N/A |
| start_time | No | String | Definition Masking start time. Constraints N/A Range The value contains eight characters in the HH:mm:ss format. Default Value N/A |
| end_date | No | String | Definition Masking end date. Constraints N/A Range The value contains 10 characters and is in the yyyy-MM-dd format. Default Value N/A |
| end_time | No | String | Definition Masking end time. Constraints N/A Range The value contains eight characters in the HH:mm:ss format. Default Value N/A |
| effective_timezone | No | String | Definition Time zone, for example, GMT-08:00, GMT+08:00, or GMT+0:00. Constraints N/A Range 1 to 16 characters Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| dimension_name | Yes | String | Definition Resource dimension information when the masking rule is applied by cloud product. Constraints N/A Range The value contains up to 128 characters. Multiple dimensions are separated by commas (,). Default Value N/A |
| metric_name | Yes | String | Definition Metric name of a resource. For details about the metric names of each resource, see their service documentation. You can navigate there from Services Interconnected with Cloud Eye. Constraints N/A Range The value must start with a letter and can only contain letters, digits, underscores (_), and hyphens (-). It allows 1 to 96 characters. For example, the ECS metric cpu_util indicates the CPU usage of an ECS. The DDS metric mongo001_command_ps indicates the command execution frequency. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| namespace | Yes | String | Definition Namespace of the service. For details, see Services Interconnected with Cloud Eye. Constraints N/A Range The value is in the service.item format. The values of service and item must start with a letter and contain only letters, digits, and underscores (_). It can contain 3 to 32 characters. Default Value N/A |
| dimensions | Yes | Array of ResourceDimension objects | Definition Resource dimension information. The value * indicates all resources. Constraints You can specify 1 to 4 dimensions. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Definition Dimension of a resource. For example, the dimension of an ECS is instance_id . For details about the dimension names of each resource, see their service documentation. You can navigate there from Services Interconnected with Cloud Eye. Constraints N/A Range The value starts with a letter and allows 1 to 32 characters. It can contain only letters, digits, underscores (_), and hyphens (-). Default Value N/A |
| value | Yes | String | Definition Resource dimension value, which is an instance ID, for example, 4270ff17-aba3-4138-89fa-820594c39755. Constraints N/A Range 1 to 256 characters Default Value N/A |
Response Parameters
Status code: 204
No Content
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Status codes customized by each cloud service when a request error occurs. |
| error_msg | String | Request error message. |
| request_id | String | Request ID. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Status codes customized by each cloud service when a request error occurs. |
| error_msg | String | Request error message. |
| request_id | String | Request ID. |
Example Requests
{
"mask_name" : "mn_test",
"relation_type" : "EVENT.SYS",
"resources" : [ {
"namespace" : "SYS.SecMaster",
"dimensions" : [ {
"name" : "instance_id",
"value" : "5461xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
} ]
} ],
"mask_type" : "START_END_TIME",
"start_date" : "yyyy-MM-dd",
"start_time" : "HH:mm:ss",
"end_date" : "yyyy-MM-dd",
"end_time" : "HH:mm:ss"
} Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 204 | No Content |
| 400 | Parameter verification failed. |
| 500 | Internal system error. |
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