Create¶
POST /api/v1/notification_schedule/add
Overview¶
Create a schedule
Body Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Y | Name Allow empty: False Max length: 256 Allow empty string: False |
| timezone | string | Timezone, default Asia/Shanghai Example: Asia/Shanghai Allow empty: False Max length: 48 |
|
| start | string | Y | Time period start time Example: 00:00 Allow empty: False Max length: 48 |
| end | string | Y | Time period end time Example: 23:59 Allow empty: False Max length: 48 |
| notifyTargets | array | Y | Notification targets, including account uuid, notification target uuid, email Example: ['acnt_xxx', 'notify_', 'xxx@guance.com'] Allow empty: False |
| extend | json | Extended information, including rotate notification target configuration Allow empty: False |
|
| extend.enableRotateNotification | boolean | Whether to enable rotation, default off Example: False Allow empty: False |
|
| extend.rotationCycle | string | Rotation cycle, day: day, week: week, month: month, workday: workDay, weekend: weekend Example: day Allow empty: False Options: ['day', 'week', 'month', 'workDay', 'weekend'] |
|
| extend.effectiveTime | json | Schedule effective time, default the schedule is permanently effective, start/end time is 11-digit timestamp Example: {'start': 1719990196, 'end': 1729990196} Allow empty: False |
Parameter Details¶
1. Request Parameter Details
| Parameter | type | Required | Description |
|---|---|---|---|
| name | String | Required | Schedule name |
| start | String | Required | Time period start time |
| end | String | Required | Time period end time |
| timezone | String | Timezone | |
| notifyTargets | array | Required | Notification targets, including account uuid, notification target uuid, email |
| extend | Json | Extended information |
2. **extend Parameter Details
| Parameter | type | Required | Description |
|---|---|---|---|
| enableRotateNotification | Boolean | Whether to enable notification target rotation, default off | |
| rotationCycle | string | Rotation cycle after enabling notification target rotation | |
| effectiveTime | json | Schedule effective time configuration, default the schedule is permanently effective, start/end time is 11-digit timestamp |
Request Example¶
curl 'https://openapi.guance.com/api/v1/notification_schedule/add' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"name":"schecule_add","timezone":"Asia/Shanghai","start":"00:00","end":"23:59","notifyTargets":["acnt_8b4bd2b8782646f3ba8f6554193f5997","notify_1c08db8458ba4ecabd27b8ce805e8502"],"extend":{"enableRotateNotification":true,"rotationCycle":"workDay","effectiveTime":{"start":1735747200,"end":1737603472}}}' \
--compressed
Response¶
{
"code": 200,
"content": {
"createAt": 1735797896,
"creator": "wsak_f2ba9858f4414655be39efc882b120dd",
"declaration": {},
"deleteAt": -1,
"effectiveTimeInfos": {
"expired": false,
"timeStr": "2025/01/02 00:00:00~2025/01/23 11:37:52"
},
"end": "23:59",
"extend": {
"effectiveTime": {
"end": 1737603472,
"start": 1735747200
},
"enableRotateNotification": true,
"rotationCycle": "workDay"
},
"id": null,
"name": "schecule_add",
"notifyTargets": [
"acnt_8b4bd2b8782646f3ba8f6554193f5997",
"notify_1c08db8458ba4ecabd27b8ce805e8502"
],
"rotationUpdateAt": 1735797896,
"start": "00:00",
"status": 0,
"timezone": "Asia/Shanghai",
"updateAt": null,
"updator": null,
"uuid": "nsche_3512c1f4d176433484676225b547ef7a",
"workspaceUUID": "wksp_798c5e0f589e4992994196832f64b6ba"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-2655C615-0DA5-4391-8528-E46D1783B3F6"
}