Create¶
POST /api/v1/crontab_report/add
Overview¶
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| title | string | Y | Scheduled Report Name Allow Empty: True Max Length: 200 |
| content | string | Scheduled Report Content Allow Empty: True Max Length: 1000 Allow Empty String: True |
|
| dashboardUUID | string | Y | Dashboard uuid Allow Empty: False |
| recipient | array | Y | Recipient Information Example: [acnt_xxxx, xxx@guance.com, acnt_yyy] Allow Empty: False |
| variables | json | View Variable Information Allow Empty: True |
|
| timeRange | string | Y | Query Time Range Example: 1d Allow Empty: True |
| crontab | string | Crontab for the Scheduled Task Example: 1 2 * * * Allow Empty: True Allow Empty String: True |
|
| singleExecuteTime | int | Timestamp for Single Execution Allow Empty: True |
|
| extend | json | Extended Information Allow Empty: True |
|
| timezone | string | Y | Scheduled Report Timezone Example: Asia/Shanghai Allow Empty: True |
| notifyType | string | Y | Scheduled Report Notification Type Example: email Allow Empty: True Options: ['email', 'dingTalkRobot', 'wechatRobot', 'feishuRobot', 'HTTPRequest', 'slackIncomingWebhook', 'teamsWorkflowWebhook'] |
Parameter Additional Explanation¶
Data Description.*
- Request Parameter Description
| Parameter Name | type | Description |
|---|---|---|
| title | string | Scheduled Report Name |
| content | string | Scheduled Report Content |
| dashboardUUID | string | Scheduled Report Dashboard UUID |
| recipient | list | Scheduled Report Recipient Information List, User Account/Email/Notification Target UUID |
| variables | json | View Variable Information |
| timeRange | string | Query Time Range, Integer plus d/h/m format, e.g., 3d, 15m, 2h |
| crontab | string | Crontab for Recurring Scheduled Tasks |
| singleExecuteTime | int | Timestamp for Single Execution |
| extend | json | Extended Information, Used for Displaying Information on the Frontend Interface |
| timezone | string | Timezone |
| notifyType | string | Notification Type |
- extend Extension Field Description
| Parameter Name | type | Description |
|---|---|---|
| shareConfig | json | Scheduled Report Sharing Configuration |
| shareConfig.shareMethod | string | Scheduled Report Sharing Configuration public or encipher Public and Encrypted Default Public |
| shareConfig.password | string | Scheduled Report Sharing Password Encrypted Sharing Password |
Request Example¶
curl 'https://openapi.guance.com/api/v1/crontab_report/add' \
-H 'Accept-Language: zh' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json, text/plain, */*' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"title":"ceshi2","content":"","dashboardUUID":"dsbd_xxxx32","recipient":["acnt_xxxx32"],"timeRange":"1d","singleExecuteTime":1698718800,"crontab":"","extend":{"cycleTimeType":"once","hour":"10","minutes":"20","dashboardInfo":{"value":"dsbd_xxxx32","label":"whytest"}},"timezone":"Asia/Shanghai","notifyType":"email"}' \
--compressed
Response¶
{
"code": 200,
"content": {
"content": "",
"createAt": 1698665760,
"creator": "wsak_xxxxx",
"crontab": "",
"dashboardUUID": "dsbd_xxxx32",
"deleteAt": -1,
"executed": 0,
"extend": {
"cycleTimeType": "once",
"dashboardInfo": {
"label": "whytest",
"value": "dsbd_xxxx32"
},
"hour": "10",
"minutes": "20"
},
"id": 205,
"isLocked": 0,
"notifyType": "email",
"recipient": [
"acnt_xxxx32"
],
"singleExecuteTime": 1698718800,
"status": 0,
"timeRange": "1d",
"timezone": "Asia/Shanghai",
"title": "ceshi2",
"updateAt": 1698665760,
"updator": "wsak_xxxxx",
"uuid": "cron_xxxx32",
"variables": {},
"workspaceUUID": "wksp_xxxx32"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-F4667E68-FB26-4987-891B-F00909A2948D"
}