CreateMaintainWindow
Creates a silence policy.
Operation description
Creates a silence policy in a specified workspace. A silence policy filters events by using filterSetting. When the policy is enabled and the current time hits the configured effective period rules, the hit events do not trigger subscribe notifications, direct notifications, or global subscribe notifications, but the events are still stored normally.
When you create a silence policy, maintainWindowName and filterSetting are required, and filterSetting must contain at least one condition. You can choose not to configure any effective period. In this case, the policy does not hit any events. If you configure effective, you must also configure at least one of startTime, endTime, or effectTimeRange. Otherwise, the validation failed. If the policy name already exists in the same workspace, InvalidParameterValue is returned. After the policy is created, the silence policy ID is returned.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:CreateMaintainWindow |
create |
*MaintainWindow
|
None | None |
Request syntax
POST /maintainWindows HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| workspace |
string |
No |
The name of the workspace. This parameter is required by the backend and is used to isolate silence policy resources across different business workspaces. |
default-cms-xxxx-cn-hangzhou |
| body | MaintainWindowForModify |
No |
The request body. This parameter is required by the backend. Pass in a complete MaintainWindowForModify configuration object. |
The request body uses the MaintainWindowForModify structure: maintainWindowName is the policy name, which cannot exceed 120 characters and must be unique within the same workspace; description is the policy description, which cannot exceed 120 characters; filterSetting defines the filtering conditions for matched events and must contain at least one condition; startTime and endTime define the one-time effective interval in millisecond timestamps; effective is a crontab expression; effectTimeRange defines the periodic effective time period, where dayInWeek ranges from 0 to 6 and 0 indicates Sunday, and startTimeInMinute and endTimeInMinute represent the minutes of the day and cannot span across days.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response content structure. |
||
| requestId |
string |
The unique ID of the request, which is used for troubleshooting and ticket tracking. |
0B9377D9-C56B-5C2E-A8A4-A01D6CC3F4B8 |
| maintainWindowId |
string |
The ID of the created silence policy. |
3ff3fbd0-8a0b-4b31-9b1c-8e3f0a2c5d71 |
Examples
Success response
JSON format
{
"requestId": "0B9377D9-C56B-5C2E-A8A4-A01D6CC3F4B8",
"maintainWindowId": "3ff3fbd0-8a0b-4b31-9b1c-8e3f0a2c5d71"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameterValue | Illegal parameters. | Illegal parameters. |
| 500 | InternalUnknownError | The request processing has failed due to some unknown error. | A service runtime error occurred. |
| 403 | Forbidden | You are not authorized to operate the specified resource. | No permission, please use RAM to authorize |
| 404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.