Creates or modifies a silence policy.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
arms:CreateDispatchRule | none |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Id | long | No | The ID of the silence policy.
| 1234 |
Name | string | Yes | The name of the silence policy. | silencepolicy_test |
MatchingRules | string | No | The matching rules. The following code shows the format of matching rules:
| [ { "matchingConditions": [ { "value": "test", "key": "altertname", "operator": "eq" } ] } ] |
RegionId | string | No | The ID of the region. | cn-hangzhou |
State | string | No | Specifies whether to enable the silence policy. Valid values: enable and disable. | enable |
EffectiveTimeType | string | No | The effective duration of the silence policy. Valid values: PERMANENT, CUSTOM_TIME, and CYCLE_EFFECT. | PERMANENT |
TimePeriod | string | No | The recurring period. This parameter is required when EffectiveTimeType is set to CYCLE_EFFECT. DAY: The silence policy is effective by day. WEEK: The silence policy is effective by week. | DAY |
TimeSlots | string | No | The time period during which the silence policy is effective. If you set EffectiveTimeType to CUSTOM_TIME, specify a custom time period in the following format: [{"startTime":"2024-08-04 22:13","endTime":"2024-08-04 22:21"}] If you set EffectiveTimeType to CYCLE_EFFECT and TimePeriod to DAY, specify a custom time period in the following format: [{"startTime":"22:13","endTime":"22:21"}]. The start time cannot be later than the end time. If you set EffectiveTimeType to CYCLE_EFFECT and TimePeriod to WEEK, specify a custom time period in the following format: [{"startWeek":"1", "endWeek":"2" "startTime":"22:13","endTime":"22:21"}]. Valid values of startWeek and endWeek: 1 to 7. The start time cannot be later than the end time. | [{"startTime":"2024-08-04 22:13","endTime":"2024-08-04 22:21"}] |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "A5EC8221-08F2-4C95-9AF1-49FD998C****",
"SilencePolicy": {
"Id": 1234,
"Name": "silencepolicy_test",
"MatchingRules": [
{
"MatchingConditions": [
{
"Key": "altertname",
"Value": "test",
"Operator": "eq"
}
]
}
],
"State": "enable",
"EffectiveTimeType": "",
"TimePeriod": "",
"TimeSlots": ""
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-08-12 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2024-05-24 | The response structure of the API has changed | View Change Details |
2024-05-24 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2022-02-24 | Add Operation | View Change Details |