Creates a notification 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:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis 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 |
|---|---|---|---|---|
| edas:CreateSchedulerxNotificationPolicy | create | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| RegionId | string | Yes | The region ID. | cn-hangzhou |
| PolicyName | string | Yes | The name of the notification policy. | test-weekdays |
| Description | string | No | The description of the notification policy. | Monday-Friday only |
| ChannelTimeRange | string | Yes | The configuration for the effective time periods of notification channels. Note
Please see the detailed explanation of this parameter below.
| { "sendChannel": "sms,webhook,mail,phone", "timezone": "UTC+08:00", "webhookIsAtAll": "false", "timeRanges": { "all": [ { "startTime": "08:00", "endTime": "18:00", "daysOfWeek": [1, 2, 3, 4, 5] } ] } } |
ChannelTimeRange configuration description
Configuration for the effective time of notification channels. Supports two modes: unified configuration and separate configuration.
Format
This field must be in JSON format and supports the following core properties:
Properties
sendChannel: Notification channel configuration (required)
- A required field that specifies the notification channels to be configured.
- Format: Multiple channels separated by commas, e.g., "sms,webhook,mail,phone".
- Supported channels: sms, webhook (e.g., DingTalk, WeCom), mail, and phone.
timezone: Time zone setting
- Supports GMT or UTC format.
- Example: GMT+8 or UTC+08:00.
- Note: The time zone determines the reference standard for the effective time of alerts and is independent of the actual geographical location. For example, if you are in the Beijing region but configure "New York Time Zone (UTC-4), Monday 00:00-03:00", the system will operate based on the local time in New York.
webhookIsAtAll: Webhook notification configuration
- The value is "true" or "false".
- Indicates whether to @all members in a Webhook notification.
timeRanges: Time range configuration (required)
-
Supports two configuration modes:
- Unified Configuration: Use "all" as the key to set a single time period for all selected channels.
- Separate Configuration: Configure a time period for each channel individually, with the key being the specific channel identifier.
Time period configuration items
Each time period includes the following properties:
- startTime: The start time, in HH:mm format (required).
- endTime: The end time, in HH:mm format (required).
- daysOfWeek: The effective days of the week, in an array format. 1-7 represent Monday to Sunday (optional. If empty, this time period is not effective).
Example configurations
Example 1: Unified configuration mode
{
"sendChannel": "sms,webhook,mail,phone",
"timezone": "UTC+08:00",
"webhookIsAtAll": "false",
"timeRanges": {
"all": [
{
"startTime": "08:00",
"endTime": "18:00",
"daysOfWeek": [1, 2, 3, 4, 5]
}
]
}
}
Example 2: Separate configuration mode
{
"sendChannel": "sms,webhook,mail,phone",
"timezone": "GMT+8",
"webhookIsAtAll": "false",
"timeRanges": {
"webhook": [
{
"startTime": "08:00",
"endTime": "18:00",
"daysOfWeek": [1, 2, 3, 4, 5]
}
],
"sms": [
{
"startTime": "08:00",
"endTime": "18:00",
"daysOfWeek": [1, 2, 3, 4, 5]
}
],
"mail": [
{
"startTime": "08:00",
"endTime": "18:00",
"daysOfWeek": [1, 2, 3, 4, 5]
}
],
"phone": [
{
"startTime": "08:00",
"endTime": "18:00",
"daysOfWeek": [1, 2, 3, 4, 5]
}
]
}
}
Note
- The sendChannel field is required and can only contain supported notification channels.
- When timeRanges contains "all", it signifies the unified configuration mode. In this case, it cannot contain configurations for other individual channels.
- When timeRanges does not contain "all", you need to configure each channel specified in sendChannel separately.
- Time must use the 24-hour format (HH:mm).
- Days of the week are represented by numbers from 1 to 7, corresponding to Monday through Sunday.
- The time zone supports configuration in both GMT and UTC formats.
Response parameters
Examples
Sample success responses
JSONformat
{
"Code": 200,
"Message": "Invalid parameter: Notification policy already exists: test-weekdays\n",
"RequestId": "39090022-1F3B-4797-8518-6B61095F1AF0",
"Success": true,
"AccessDeniedDetail": {
"AuthAction": "edas:CreateSchedulerxNotificationPolicy",
"AuthPrincipalDisplayName": "209312833131416xxx",
"AuthPrincipalOwnerId": "1827811800526xxx",
"AuthPrincipalType": "SubUser",
"EncodedDiagnosticMessage": "AQFn/cLPZ/3Cz0YxQkZBMjVGLTY0REUtNTlGNS05NzUwLTgyMUE4M0MwMTFDRQ==",
"NoPermissionType": "ImplicitDeny",
"PolicyType": "AccountLevelIdentityBasedPolicy"
}
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-10-29 | Add Operation | View Change Details |
