Skip to content

Create Scheduled Reports



POST /api/v1/crontab_report/add

Overview

Body Request Parameters

Parameter Name Type Required Description
title string Y Scheduled report name
Allow empty: True
Maximum length: 200
content string Scheduled report content
Allow empty: True
Maximum 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 scheduled tasks
Example: 1 2 * * *
Allow empty: True
Allow empty string: True
singleExecuteTime int Timestamp for single execution
Allow empty: True
extend json Additional 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
Optional values: ['email', 'dingTalkRobot', 'wechatRobot', 'feishuRobot', 'HTTPRequest', 'slackIncomingWebhook', 'teamsWorkflowWebhook']

Parameter Supplementary Explanation

Data description.*

  • Request parameter explanation
Parameter Name Type Description
title string Scheduled report name
content string Scheduled report content
dashboardUUID string Scheduled report dashboard UUID
recipient list List of recipients for the scheduled report, user account acnt_/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 repeated execution of scheduled tasks
singleExecuteTime int Timestamp for single execution
extend json Extended information used for displaying interface information
timezone string Timezone
notifyType string Notification type
  • Extend extended field explanation
Parameter Name Type Description
shareConfig json Scheduled report sharing configuration
shareConfig.shareMethod string Scheduled report sharing configuration public or enciphered default is 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: en' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json, text/plain, */*' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"title":"test2","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": "test2",
        "updateAt": 1698665760,
        "updator": "wsak_xxxxx",
        "uuid": "cron_xxxx32",
        "variables": {},
        "workspaceUUID": "wksp_xxxx32"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-F4667E68-FB26-4987-891B-F00909A2948D"
} 

Feedback

Is this page helpful? ×