1 Star 0 Fork 66

haiyongou / bk-sops

forked from 腾讯蓝鲸智云 / bk-sops 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
get_periodic_task_list.md 3.01 KB
一键复制 编辑 原始数据 按行查看 历史
pagezhou 提交于 2019-06-21 20:31 . minor: 优化本地文档格式 #391

功能描述

查询某个业务下所有的周期任务

请求参数

通用参数

字段 类型 必选 描述
bk_app_code string 应用ID
bk_app_secret string 安全密钥(应用 TOKEN),可以通过 蓝鲸智云开发者中心 -> 点击应用ID -> 基本信息 获取
bk_token string 当前用户登录态,bk_token与bk_username必须一个有效,bk_token可以通过Cookie获取
bk_username string 当前用户用户名,应用免登录态验证白名单中的应用,用此字段指定当前用户

接口参数

字段 类型 必选 描述
bk_biz_id string 任务所属业务ID

请求参数示例

{
    "bk_app_code": "esb_test",
    "bk_app_secret": "xxx",
    "bk_token": "xxx",
    "bk_biz_id": "2"
}

返回结果示例

{
    "data": [
        {
            "cron": "*/1 15 * * * (m/h/d/dM/MY)",
            "total_run_count": 1,
            "name": "from api 3",
            "creator": "admin",
            "last_run_at": "2018-11-28 15:57:01 +0900",
            "enabled": false,
            "id": 11,
            "template_id": "2"
        },
        {
            "cron": "1,2,3-19/2 2 3 4 5 (m/h/d/dM/MY)",
            "total_run_count": 0,
            "name": "from api 1",
            "creator": "admin",
            "last_run_at": "",
            "enabled": false,
            "id": 6,
            "template_id": "2"
        },
        {
            "cron": "*/5 * * * * (m/h/d/dM/MY)",
            "total_run_count": 0,
            "name": "定时",
            "creator": "admin",
            "last_run_at": "",
            "enabled": false,
            "id": 4,
            "template_id": "2"
        }
    ],
    "result": true
}

返回结果参数说明

名称 类型 说明
result bool true/false 操作是否成功
data dict result=true 时成功数据,详细信息请见下面说明
message string result=false 时错误信息

data

名称 类型 说明
cron string 周期调度表达式
total_run_count int 周期任务运行次数
name string 周期任务名
creator string 创建者
last_run_at string 上次运行时间
enabled bool 是否激活
id int 周期任务ID
template_id string 用于创建该任务的模板ID
Python
1
https://gitee.com/hiopro/bk-sops.git
git@gitee.com:hiopro/bk-sops.git
hiopro
bk-sops
bk-sops
master

搜索帮助