CreateMaintainWindow

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cms:CreateMaintainWindow

create

*MaintainWindow

acs:cms:{#regionId}:{#accountId}: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.