diff --git a/docs/apidoc/bk-api-gateway/v3/zh/batch_get_job_instance_ip_log.md b/docs/apidoc/bk-api-gateway/v3/zh/batch_get_job_instance_ip_log.md new file mode 100644 index 0000000000..d8786e573b --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/batch_get_job_instance_ip_log.md @@ -0,0 +1,187 @@ +### 功能描述 + +根据主机列表批量查询作业执行日志 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Body参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| job_instance_id | long | 是 | 作业实例ID | +| step_instance_id | long | 是 | 步骤实例ID | +| ip_list | array | 是 | 源/目标主机IP列表,定义见ip | + +##### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | int | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +### 请求参数示例 +- POST +```json +{ + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100, + "step_instance_id": 200, + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ] +} +``` + +### 返回结果示例 + +#### 脚本执行步骤 +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 1, + "task_instance_id": 100, + "step_instance_id": 200, + "script_task_logs": [ + { + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "log_content": "[2018-03-15 14:39:30][PID:56875] job_start\n" + }, + { + "ip": "10.0.0.2", + "bk_cloud_id": 0, + "log_content": "[2018-03-15 14:39:30][PID:16789] job_start\n" + } + ] + } +} +``` + +#### 文件分发步骤 + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 2, + "task_instance_id": 100, + "step_instance_id": 200, + "file_task_logs": [ + { + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "file_logs": [ + { + "mode": 1, + "src_ip": { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "dest_ip": { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + "dest_path": "/tmp/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success" + } + ] + }, + { + "ip": "10.0.0.2", + "bk_cloud_id": 0, + "file_logs": [ + { + "mode": 0, + "src_ip": { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /data/1.log FileSize: 9.0 Bytes State: source agent success upload file Speed: 1 KB/s Progress: 100% StatusDesc: source agent success upload file Detail: success upload" + } + ] + } + ] + } +} +``` + +**文件任务返回结果说明** + +- 如果需要返回文件源的上传日志,需要在ip_list添加源文件服务器IP + +### 返回结果说明 + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| bk_cloud_id | int | 目标服务器管控区域ID | +| ip | string | 目标服务器IP地址 | +| log_type | int | 日志类型。1-脚本执行任务日志;2-文件分发任务日志 | +| script_task_logs | array | 脚本执行任务日志。定义见script_task_log| +| file_task_logs | array | 文件分发任务日志。定义见file_task_log| + +##### script_task_log + +| 字段 | 类型 | 描述 | +|-----------|------------|--------| +| bk_cloud_id | long | 管控区域ID | +| ip | string | 目标IP地址 | +| log_content | string | 脚本执行日志内容 | + +##### file_task_log + +| 字段 | 类型 | 描述 | +|-----------|------------|--------| +| bk_cloud_id | long | 管控区域ID | +| ip | string | 源/目标IP地址 | +| file_logs | array | 文件分发日志内容。定义见file_log | + +##### file_log + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| mode | 分发模式 | 0:上传;1:下载| +| src_ip | object |文件源主机IP。定义见ip | +| src_path | string | 源文件路径 | +| dest_ip | object | 分发目标主机IP,mode=1时有值。定义见ip | +| dest_path | string | 目标路径,mode=1时有值 | +| status | int | 任务状态。1-等待开始;2-上传中;3-下载中;4-成功;5-失败 | +| log_content | string | 文件分发日志内容 | + +##### ip + +| 字段 | 类型 | 描述 | +|-----------|------------|--------| +| bk_cloud_id | long | 管控区域ID | +| ip | string | IP地址 | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/callback_protocol.md b/docs/apidoc/bk-api-gateway/v3/zh/callback_protocol.md new file mode 100644 index 0000000000..0d4949dbfc --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/callback_protocol.md @@ -0,0 +1,43 @@ +### 功能描述 + +此组件仅用于展示回调协议文档。 + +对作业执行类的请求传入的回调 callback_url 地址进行回调时所传递的报文结构描述。 + +### 请求参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|------------|--------|------------| +| job_instance_id | long | 是 | 作业实例ID | +| status | int | 是 | 作业状态码: 1.等待执行; 2.正在执行; 3.执行成功; 4.执行失败; 5.跳过; 6.忽略错误; 7.等待用户; 8.强制终止; 9.状态异常; 10.强制终止中; 11.强制终止成功,13.确认终止 | +| step_instance_list | array | 是 | 步骤块中包含的各个步骤执行状态 | + +#### step_instances + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|------------|--------|------------| +| step_instance_id | long | 是 | 作业步骤实例ID | +| status | int | 是 | 作业步骤状态码: 1.等待执行; 2.正在执行; 3.执行成功; 4.执行失败; 5.跳过; 6.忽略错误; 7.等待用户; 8.强制终止; 9.状态异常; 10.强制终止中; 11.强制终止成功,13.确认终止 | + +### 请求参数示例 + +```json +{ + "job_instance_id": 12345, + "status": 2, + "step_instance_list": [ + { + "step_instance_id": 16271, + "status": 3 + }, + { + "step_instance_id": 16272, + "status": 2 + } + ] +} +``` + +### 回调响应 + +回调成功以HTTP状态为准,如果成功,则状态码200,其他表示失败,Job会对失败的做一次重试,如还失败,则忽略失败,不再回调。 \ No newline at end of file diff --git a/docs/apidoc/bk-api-gateway/v3/zh/common.md b/docs/apidoc/bk-api-gateway/v3/zh/common.md new file mode 100644 index 0000000000..293b33e8ec --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/common.md @@ -0,0 +1,45 @@ +## 通用字段和约定 + +#### global_var + +| 字段 | 类型 | 必选 | 描述 | +|-------------|------------|--------|------------| +| id | long | 否 | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 否 | 全局变量名 | +| description | string | 否 | 全局变量描述 | +| type | int | 否 | 全局变量类型 | +| required | int | 否 | 模版/执行方案中该变量是否必填 | +| value | string | 否 | 字符、密码、数组类型的全局变量的值 | +| server | object | 否 | 主机类型全局变量的值 | + +#### server +| 字段 | 类型 | 必选 | 描述 | +|-----------------------|-------|--------|------------| +| ip_list | array | 否 | 静态 IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +#### ip +| 字段 | 类型 | 必选 | 描述 | +|-------------|---------|--------|---------| +| bk_cloud_id | int | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +#### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +#### topo_node + +| 字段 | 类型 | 必选 | 描述 | +|------------------|--------|--------|------------| +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| + +#### account +| 字段 | 类型 | 必选 | 描述 | +|-------|--------|--------|------------| +| id | long | 否 | 账号 ID | +| name | string | 否 | 账号名 | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/execute_job_plan.md b/docs/apidoc/bk-api-gateway/v3/zh/execute_job_plan.md new file mode 100644 index 0000000000..cc723fe0bf --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/execute_job_plan.md @@ -0,0 +1,138 @@ +### 功能描述 + +启动作业执行方案 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Body参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| job_plan_id | long | 是 | 作业执行方案ID | +| global_var_list | array | 否 | 全局变量。对于作业执行方案中的全局变量值,如果请求参数中包含该变量,则使用传入的变量值;否则使用执行方案当前已配置的默认值。定义见global_var | +| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 | + +##### global_var + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| id | long | 否 | 全局变量id,唯一标识。如果id为空,那么使用name作为唯一标识 | +| name | string | 否 | 全局变量name | +| value | string | 否 | 字符、密码、数组、命名空间类型的全局变量的值 | +| server | object | 否 | 主机类型全局变量的值,见server定义 | + +##### server + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ----------------------------------- | +| ip_list | array | 否 | 静态 IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +##### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | int | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +##### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +##### topo_node + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set" | + +### 请求参数示例 + +- POST +```json +{ + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100, + "global_var_list": [ + { + "id": 436, + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } + }, + { + "name": "param_name", + "value": "param_value" + } + ] +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "Test", + "job_instance_id": 10000 + } +} +``` + +### 返回结果参数说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| job_instance_name | long | 作业实例名称 | + diff --git a/docs/apidoc/bk-api-gateway/v3/zh/fast_execute_script.md b/docs/apidoc/bk-api-gateway/v3/zh/fast_execute_script.md new file mode 100644 index 0000000000..a08654e815 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/fast_execute_script.md @@ -0,0 +1,143 @@ +### 功能描述 + +快速执行脚本 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Body参数 + +| 字段 | 类型 | 必选 | 描述 | +|---------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| script_version_id | long | 否 | 脚本版本ID。当script_version_id不为空的时候,使用script_version_id对应的脚本版本 | +| script_id | string | 否 | 脚本ID。当传入script_id,且script_version_id为空的时候,使用脚本的上线版本 | +| script_content | string | 否 | 脚本内容Base64。如果不存在script_version_id和script_id,那么使用script_content。优先级:script_version_id>script_id>script_content | +| task_name | string | 否 | 自定义作业名称 | +| script_param | string | 否 | 脚本参数Base64。注意:如果有多个参数,比如"param1 param2"这种,需要对"param1 param2"整体进行base64编码,而不是对每个参数进行base64编码再拼接起来 | +| timeout | long | 否 | 脚本执行超时时间,秒。默认7200,取值范围1-86400 | +| account_alias | string | 否 | 执行账号别名。与account_id必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | +| account_id | long | 否 | 执行账号ID。与account_alias必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | +| is_param_sensitive | int | 否 | 敏感参数将会在执行详情页面上隐藏, 0:不是(默认),1:是 | +| script_language | int | 否 | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell。当使用script_content传入自定义脚本的时候,需要指定script_language | +| target_server | object | 否 | 目标服务器,见server定义 | +| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 | +| rolling_config | object | 否 | 滚动配置,见rolling_config定义 | + +##### server +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ----------------------------------- | +| ip_list | array | 否 | 静态 IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +##### ip + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_cloud_id | long | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +##### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +##### topo_node_list + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| + +##### rolling_config + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| expression | string | 是 | 滚动策略表达式 | +| mode | int | 是 | 滚动机制,1-执行失败则暂停;2-忽略失败,自动滚动下一批;3-人工确认 | + +### 请求参数示例 + +- POST +```json +{ + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_version_id": 1, + "script_content": "ZWNobyAkMQ==", + "script_param": "aGVsbG8=", + "timeout": 1000, + "account_id": 1000, + "is_param_sensitive": 0, + "script_language": 1, + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API Quick execution script1521100521303", + "job_instance_id": 10000, + "step_instance_id": 10001 + } +} +``` + +### 返回结果参数说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| job_instance_name | long | 作业实例名称 | +| step_instance_id | long | 步骤实例ID | \ No newline at end of file diff --git a/docs/apidoc/bk-api-gateway/v3/zh/fast_execute_sql.md b/docs/apidoc/bk-api-gateway/v3/zh/fast_execute_sql.md new file mode 100644 index 0000000000..a3d23b8653 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/fast_execute_sql.md @@ -0,0 +1,128 @@ +### 功能描述 + +快速执行SQL脚本 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Body参数 + +| 字段 | 类型 | 必选 | 描述 | +|---------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| task_name | string | 否 | 自定义作业名称 | +| script_version_id | long | 否 | SQL脚本版本ID | +| script_id | string | 否 | 脚本ID。当传入script_id,且script_version_id为空的时候,使用当前脚本的上线版本 | +| script_content | string | 否 | 脚本内容Base64。如果不存在script_version_id和script_id,那么使用script_content。优先级:script_version_id>script_id>script_content | +| timeout | int | 否 | 脚本超时时间,秒。默认7200,取值范围1-86400 | +| db_account_id | long | 是 | SQL执行的db账号ID,必填, 从账号管理-DB账号处获得。 | +| target_server | object | 否 | 目标服务器,见server定义 | +| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 | + +##### server + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ----------------------------------- | +| ip_list | array | 否 | 静态 IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +##### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | long | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +##### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +##### topo_node_list + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set" | + +### 请求参数示例 + +- POST +```json +{ + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_version_id": 1, + "timeout": 1000, + "db_account_id": 32, + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API Quick SQL Execution1524454292038", + "job_instance_id": 10000, + "step_instance_id": 10001 + } +} +``` + +### 返回结果参数说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| job_instance_name | long | 作业实例名称 | +| step_instance_id | long | 步骤实例ID | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/fast_transfer_file.md b/docs/apidoc/bk-api-gateway/v3/zh/fast_transfer_file.md new file mode 100644 index 0000000000..13cd49f05d --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/fast_transfer_file.md @@ -0,0 +1,199 @@ +### 功能描述 +快速分发文件 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------------------- | ------ | ---- | ------------------------------------------------------------ | +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json | +| Content-Type | string | 是 | 固定值。application/json | + +#### Body参数 +| 字段 | 类型 | 必选 | 描述 | +|------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| task_name | string | 否 | 自定义作业名称 | +| account_alias | string | 否 | 目标执行账号别名,可从账号页面获取,推荐使用。与account_id必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | +| account_id | long | 否 | 目标执行账号ID,可从get_account_list接口获取。与account_alias必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | +| file_target_path | string | 是 | 文件传输目标路径 | +| file_source_list | array | 是 | 源文件对象数组,见下面file_source定义 | +| timeout | int | 否 | 任务超时时间,秒,默认值为7200。取值范围1-86400。| +| download_speed_limit| int | 否 | 下载限速,单位MB。如果未传入该参数,表示不限速| +| upload_speed_limit| int | 否 | 上传限速,单位MB。如果未传入该参数,表示不限速| +| transfer_mode | int | 否 | 传输模式。1-严谨模式,2-强制模式。默认使用强制模式 | +| target_server | object | 否 | 目标服务器,见server定义 | +| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 | +| rolling_config | object | 否 | 滚动配置,见rolling_config定义 | + +##### file_source +| 字段 | 类型 | 必选 | 描述 | +|---------------|------------|--------|------------| +| file_list | array | 是 | 支持多个文件,若文件源类型为服务器文件,填写源文件的绝对路径数组;若文件源类型为第三方文件源,COS文件源填写的路径为"bucket名称/文件路径",例如:testbucket/test.txt | +| account | object | 是 | 文件源账号,见account定义,文件源类型为服务器文件源时必填,文件源类型为第三方文件源时无需填写 | +| server | object | 否 | 源文件服务器,见server定义 | +| file_type | int | 否 | 文件源类型,1:服务器文件,3:第三方文件源文件,不传默认为1 | +| file_source_id | int | 否 | file_type为3时,file_source_id与file_source_code选择一个填写,若都填写,优先使用file_source_id,第三方文件源Id,可从get_job_detail接口返回结果中的步骤详情获取 | +| file_source_code| string | 否 | file_type为3时,file_source_id与file_source_code选择一个填写,若都填写,优先使用file_source_id,第三方文件源标识,可从作业平台的文件分发页面->选择文件源文件弹框中获取 | + +##### account + +| 字段 | 类型 | 必选 | 描述 | +| ----- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 否 | 源执行账号ID,可从get_account_list接口获取。与alias必须存在一个。当同时存在alias和id时,id优先。 | +| alias | string | 否 | 源执行账号别名,可从账号页面获取,推荐使用。与alias必须存在一个。当同时存在alias和id时,id优先。 | + +##### server + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| ip_list | array | 否 | 静态IP列表 | +| dynamic_group_list | array | 否 | 动态分组ID列表 | +| topo_node_list | array | 否 | 动态topo节点列表 | + +##### ip_list +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_cloud_id | long | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +##### topo_node_list +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| + +##### rolling_config + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| expression | string | 是 | 滚动策略表达式 | +| mode | int | 是 | 滚动机制,1-执行失败则暂停;2-忽略失败,自动滚动下一批;3-人工确认 | + +### 请求参数示例 + +- POST +```json +{ + "bk_scope_type": "biz", + "bk_scope_id": "1", + "file_target_path": "/tmp/", + "transfer_mode": 1, + "file_source_list": [ + { + "file_list": [ + "/tmp/REGEX:[a-z]*.txt" + ], + "account": { + "id": 100 + }, + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + }, + "file_type": 1 + }, + { + "file_list": [ + "testbucket/test.txt" + ], + "file_type": 3, + "file_source_id": 1 + }, + { + "file_list": [ + "testbucket/test2.txt" + ], + "file_type": 3, + "file_source_code": "testInnerCOS" + } + ], + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + }, + "account_id": 101 +} +``` +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API Quick Distribution File1521101427176", + "job_instance_id": 10000, + "step_instance_id": 10001 + } +} +``` + +### 返回结果参数说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| job_instance_name | long | 作业实例名称 | +| step_instance_id | long | 步骤实例ID | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_account_list.md b/docs/apidoc/bk-api-gateway/v3/zh/get_account_list.md new file mode 100644 index 0000000000..aa4d0bd528 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_account_list.md @@ -0,0 +1,100 @@ +### 功能描述 + +查询业务下的执行账号列表 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| category | int | 否 | 账号用途(1:系统账号,2:DB账号),不传则不区分 | +| start | int | 否 | 分页记录起始位置,不传默认为0 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +- GET +```json +/api/v3/get_account_list?bk_scope_type=biz&bk_scope_id=1&category=1&start=0&length=1 +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "message": null, + "result": true, + "data": { + "start": 0, + "total": 12, + "data": [ + { + "id": 70, + "account": "aaa", + "alias": "aaa", + "category": 1, + "type": 1, + "os": "Linux", + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "create_time": 1614659536108, + "last_modify_user": "admin", + "last_modify_time": 1614659536116 + } + ], + "length": 1 + } +} +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|----------|-----------|-----------| +| start | int | 分页记录起始位置 | +| total | int | 查询结果总量 | +| data | long | 分页数据,见data.data定义 | + +##### data.data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 账号ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| account | string | 账号名称 | +| alias | string | 账号别名 | +| category | int | 账号用途(1:系统账号,2:DB账号) | +| type | int | 账号类型(1:Linux,2:Windows,9:MySQL,10:Oracle,11:DB2)| +| db_system_account_id | long | 账号用途为DB账号时该字段生效,表示DB账号对应的系统账号ID | +| os | string | 账号用途为系统账号时该字段生效,账号对应的OS | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_cron_detail.md b/docs/apidoc/bk-api-gateway/v3/zh/get_cron_detail.md new file mode 100644 index 0000000000..1b72eedf04 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_cron_detail.md @@ -0,0 +1,146 @@ +### 功能描述 + +查询定时作业详情 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| id | long | 否 | 定时任务 ID | + +### 请求参数示例 + +- GET +```json +/api/v3/get_cron_detail?bk_scope_type=biz&bk_scope_id=1&id=1 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100, + "id": 1, + "name": "test", + "status": 1, + "expression": "0/5 * * * ?", + "global_var_list": [ + { + "id": 436, + "name": "ip", + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } + }, + { + "id": 437, + "name": "text", + "value": "new String value" + } + ], + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1577807999999 + } +} +``` + +### 返回结果参数说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data +| 字段 | 类型 | 描述 | +|------------------|-----------|-----------| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 执行方案 ID | +| id | long | 定时作业 ID | +| name | string | 定时作业名称 | +| status | int | 定时作业状态:1.已启动、2.已暂停 | +| expression | string | 定时任务crontab的定时规则,新建时必填,修改时选填。各字段含义为:分 时 日 月 周,如: 0/5 * * * ? 表示每5分钟执行一次 | +| global_var_list | array | 全局变量信息 | +| creator | string | 作业创建人账号 | +| create_time | long | 创建时间,Unix 时间戳 | +| last_modify_user | string | 作业修改人账号 | +| last_modify_time | long | 最后修改时间,Unix 时间戳 | + +##### global_var + +| 字段 | 类型 | 描述 | +|-----------|-----------|------------| +| id | long | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 全局变量 name | +| value | string | 字符、密码、数组类型的全局变量的值 | +| server | object | 主机类型全局变量的值 | + +##### server +| 字段 | 类型 | 描述 | +|-----------------------|-------|------------| +| ip_list | array | 静态 IP 列表 | +| dynamic_group_list | array | 动态分组 列表 | +| topo_node_list | array | 动态 topo 节点列表 | + +##### ip + +| 字段 | 类型 | 描述 | +|-------------|---------|---------| +| bk_cloud_id | int | 管控区域ID | +| ip | string | IP地址 | + +##### topo_node +| 字段 | 类型 | 描述 | +|------------------|--------|------------| +| id | long | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_cron_list.md b/docs/apidoc/bk-api-gateway/v3/zh/get_cron_list.md new file mode 100644 index 0000000000..b5818c16a7 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_cron_list.md @@ -0,0 +1,95 @@ +### 功能描述 + +查询业务下定时作业信息 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| name | string | 否 | 定时作业名称 | +| id | long | 否 | 定时任务 ID,如果存在则忽略其他筛选条件,只查询这个指定的作业信息 | +| status | int | 否 | 定时作业状态:1.已启动、2.已暂停 | +| creator | string | 否 | 定时作业创建人账号 | +| create_time_start | long | 否 | 创建起始时间,Unix 时间戳(s) | +| create_time_end | long | 否 | 创建结束时间,Unix 时间戳(s) | +| last_modify_user | string | 否 | 作业修改人账号 | +| last_modify_time_start | long | 否 | 最后修改起始时间,Unix 时间戳(s) | +| last_modify_time_end | long | 否 | 最后修改结束时间,Unix 时间戳(s) | +| start | int | 否 | 默认 0 表示从第 1 条记录开始返回 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +- GET +```json +/api/v3/get_cron_detail?bk_scope_type=biz&bk_scope_id=1&name=test&id=1000031&status=1&status=admin&create_time_start=1601371525&create_time_end=1617285956&last_modify_user=admin&last_modify_time_start=1601371525&last_modify_time_end=1617286227&start=0&length=1 +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "start": 0, + "total": 8, + "data": [ + { + "id": 1000031, + "name": "tylertest动态分组ID变更", + "status": 1, + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 1000193, + "expression": "* * * * * *", + "create_time": 1617285956, + "last_modify_user": "admin", + "last_modify_time": 1617286227 + } + ], + "length": 1 + } +} +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data +| 字段 | 类型 | 描述 | +|------------------|-----------|-----------| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 执行方案 ID | +| id | long | 定时作业 ID | +| name | string | 定时作业名称 | +| status | int | 定时作业状态:1.已启动、2.已暂停 | +| expression | string | 定时任务crontab的定时规则,新建时必填,修改时选填。各字段含义为:分 时 日 月 周,如: 0/5 * * * ? 表示每5分钟执行一次 | +| creator | string | 作业创建人账号 | +| create_time | long | 创建时间,Unix 时间戳(s) | +| last_modify_user | string | 作业修改人账号 | +| last_modify_time | long | 最后修改时间,Unix 时间戳(s) | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_global_var_value.md b/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_global_var_value.md new file mode 100644 index 0000000000..ed7ac3f2dd --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_global_var_value.md @@ -0,0 +1,132 @@ +### 功能描述 + +获取作业实例全局变量的值 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| job_instance_id | long | 是 | 作业实例ID | + +### 请求参数示例 + +- GET +```json +/api/v3/get_job_instance_global_var_value?bk_scope_type=biz&bk_scope_id=1&job_instance_id=100 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "job_instance_id": 100, + "step_instance_var_list": [{ + "step_instance_id": 292778, + "global_var_list": [{ + "name": "aa", + "value": "AA", + "type": 1 + }, { + "name": "password", + "value": "mypassword", + "type": 4 + } + ] + }, { + "step_instance_id": 292779, + "global_var_list": [{ + "name": "aa", + "value": "AAAA", + "type": 1 + }, { + "name": "password", + "value": "mypassword", + "type": 4 + } + ] + } + ] + } +} + +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| step_instance_var_list | array | 作业步骤实例全局变量值。定义见step_instance_var | + +##### step_instance_var + +| 字段 | 类型 | 描述 | +| ---------------- | ----- | -------------------------------- | +| step_instance_id | long | 步骤实例ID | +| global_var_list | array | 全局变量值列表,定义见global_var | + +##### global_var + +| 字段 | 类型 | 必选 | 描述 | +| ------ | ------ | ---- | ---------------------------------------------------------- | +| id | long | 否 | 全局变量id,唯一标识。如果id为空,那么使用name作为唯一标识 | +| name | string | 否 | 全局变量name | +| value | string | 否 | 字符、密码、数组类型的全局变量的值 | +| server | object | 否 | 主机类型全局变量的值,见server定义 | + +##### server + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ----------------------------------- | +| ip_list | array | 否 | 静态 IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +##### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | int | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +##### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +##### topo_node + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set" | \ No newline at end of file diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_ip_log.md b/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_ip_log.md new file mode 100644 index 0000000000..817a6c8661 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_ip_log.md @@ -0,0 +1,136 @@ +### 功能描述 + +根据主机查询作业执行日志 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| job_instance_id | long | 是 | 作业实例ID | +| step_instance_id | long | 是 | 步骤实例ID | +| bk_cloud_id | int | 是 | 目标服务器管控区域ID | +| ip | string | 是 | 目标服务器IP | + +### 请求参数示例 +- GET +```json +/api/v3/get_job_instance_ip_log?bk_scope_type=biz&bk_scope_id=1&job_instance_id=50&step_instance_id=100&bk_cloud_id=0&ip=10.0.0.1 +``` + +### 返回结果示例 + +#### 脚本执行步骤 +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 1, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "log_content": "[2018-03-15 14:39:30][PID:56875] job_start\n" + } +} +``` + +#### 文件分发步骤 + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 2, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "file_logs": [ + { + "mode": 1, + "src_ip": { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "dest_ip": { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + "dest_path": "/tmp/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success" + }, + { + "mode": 0, + "src_ip": { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /data/1.log FileSize: 9.0 Bytes State: source agent success upload file Speed: 1 KB/s Progress: 100% StatusDesc: source agent success upload file Detail: success upload" + } + ] + } +} +``` + +**文件任务返回结果说明** + +- 文件分发日志,除了目标服务器的文件下载任务日志,也会返回源服务器的文件上传任务日志(mode=0) +- dest_ip 与请求参数的bk_cloud_id/ip对应 + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| bk_cloud_id | int | 目标服务器管控区域ID | +| ip | string | 目标服务器IP地址 | +| log_type | int | 日志类型。1-脚本执行任务日志;2-文件分发任务日志 | +| log_content | string | 作业脚本输出的日志内容 | +| file_logs | array | 文件分发任务日志。定义见file_log| + +##### file_log + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| mode | 分发模式 | 0:上传;1:下载| +| src_ip | object |文件源主机IP。定义见ip | +| src_path | string | 源文件路径 | +| dest_ip | object | 分发目标主机IP,mode=1时有值。定义见ip | +| dest_path | string | 目标路径,mode=1时有值 | +| status | int | 任务状态。1-等待开始;2-上传中;3-下载中;4-成功;5-失败 | +| log_content | string | 文件分发日志内容 | + +##### ip + +| 字段 | 类型 | 描述 | +|-----------|------------|--------| +| bk_cloud_id | long | 管控区域ID | +| ip | string | IP地址 | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_list.md b/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_list.md new file mode 100644 index 0000000000..b8e9f43817 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_list.md @@ -0,0 +1,104 @@ +### 功能描述 + +查询作业实例列表(执行历史) + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ------------------------------------------------------------ | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| create_time_start | long | 是 | 创建起始时间,Unix 时间戳,单位毫秒 | +| create_time_end | long | 是 | 创建结束时间,Unix 时间戳,单位毫秒 | +| job_instance_id | long | 否 | 任务实例ID。 如果出入job_instance_id,将忽略其他查询条件 | +| job_cron_id | long | 否 | 定时任务ID | +| operator | string | 否 | 执行人,精准匹配 | +| name | string | 否 | 任务名称,模糊匹配 | +| launch_mode | int | 否 | 执行方式。1 - 页面执行,2 - API调用,3 - 定时执行 | +| type | int | 否 | 任务类型。0 - 作业执行,1 - 脚本执行,2 - 文件分发 | +| status | int | 否 | 任务状态。1 - 等待执行,2 - 正在执行,3 - 执行成功,4 - 执行失败,7 - 等待确认,10 - 强制终止中,11 - 强制终止成功,13 - 确认终止 | +| ip | string | 否 | 执行目标服务器IP, 精准匹配 | +| start | int | 否 | 默认0表示从第1条记录开始返回 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +- GET +```json +/api/v3/get_job_instance_list?bk_scope_type=biz&bk_scope_id=1&type=0&launch_mode=1&status=3&operator=admin&name=test&create_time_start=1546272000000&create_time_end=1577807999999&start=0&length=20 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 100, + "job_template_id": 1, + "job_plan_id": 1, + "name": "test", + "operator": "admin", + "create_time": 1546272000000, + "start_time": 1546272000000, + "end_time": 1546272001000, + "total_time": 1000, + "launch_mode": 1, + "task_status": 3, + "task_type": 0 + } + ], + "start": 0, + "length": 20, + "total": 1 + } +} +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +| --------------- | ------ | ------------------------------------------------------------ | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | long | 执行方案 ID | +| job_template_id | long | 作业模版 ID,当任务为执行方案的时候有值 | +| job_plan_id | long | 作业执行方案 ID,当任务为执行方案的时候有值 | +| name | string | 任务名称 | +| operator | string | 操作者 | +| create_time | long | 创建时间,Unix 时间戳,单位毫秒 | +| status | int | 任务状态。1 - 等待执行,2 - 正在执行,3 - 执行成功,4 - 执行失败,7 - 等待确认,10 - 强制终止中,11 - 强制终止成功,13 - 确认终止 | +| type | int | 任务类型。0 - 作业执行,1 - 脚本执行,2 - 文件分发 | +| launch_mode | int | 执行方式。1 - 页面执行,2 - API调用,3 - 定时执行 | +| start_time | long | 任务启动时间,Unix 时间戳,单位毫秒 | +| end_time | long | 任务结束时间,Unix 时间戳,单位毫秒 | +| total_time | long | 任务执行时间,Unix 时间戳,单位毫秒 \ No newline at end of file diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_status.md b/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_status.md new file mode 100644 index 0000000000..6633474e93 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_status.md @@ -0,0 +1,143 @@ +### 功能描述 + +根据作业实例 ID 查询作业执行状态 + +### 请求参数说明 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| job_instance_id | long | 是 | 作业实例ID | +| return_ip_result | boolean | 否 | 是否返回每个ip上的任务详情,对应返回结果中的step_ip_result_list。默认值为false。 | + +### 请求参数示例 + +- GET +```json +/api/v3/get_job_instance_status?bk_scope_type=biz&bk_scope_id=1&job_instance_id=100&return_ip_result=true +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "finished": true, + "job_instance": { + "job_instance_id": 100, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "API Quick execution script1521089795887", + "create_time": 1605064271000, + "status": 4, + "start_time": 1605064271000, + "end_time": 1605064272000, + "total_time": 1000 + }, + "step_instance_list": [ + { + "status": 4, + "total_time": 1000, + "name": "API Quick execution scriptxxx", + "step_instance_id": 75, + "execute_count": 0, + "create_time": 1605064271000, + "end_time": 1605064272000, + "type": 1, + "start_time": 1605064271000, + "step_ip_result_list": [ + { + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "status": 9, + "tag": "", + "exit_code": 0, + "error_code": 0, + "start_time": 1605064271000, + "end_time": 1605064272000, + "total_time": 1000 + } + ] + } + ] + } +} +``` +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| finished | bool | 作业是否结束 | +| job_instance | object | 作业实例基本信息。见job_instance定义 | +| step_instance_list | array | 作业步骤列表。见step_instance定义 | + +##### job_instance + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| name | string | 作业实例名称 | +| status | int | 作业状态码: 1.未执行; 2.正在执行; 3.执行成功; 4.执行失败; 5.跳过; 6.忽略错误; 7.等待用户; 8.手动结束; 9.状态异常; 10.步骤强制终止中; 11.步骤强制终止成功 | +| create_time | long | 作业创建时间,Unix时间戳,单位毫秒 | +| start_time | long | 开始执行时间,Unix时间戳,单位毫秒 | +| end_time | long | 执行结束时间,Unix时间戳,单位毫秒 | +| total_time | int | 总耗时,单位毫秒 | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_instance_id | long | 作业实例ID | + +##### step_instance + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| step_instance_id | long | 作业步骤实例ID | +| type | int | 步骤类型:1.脚本步骤; 2.文件步骤; 4.SQL步骤 | +| name | string | 步骤名称 | +| status | int | 作业步骤状态码: 1.未执行; 2.正在执行; 3.执行成功; 4.执行失败; 5.跳过; 6.忽略错误; 7.等待用户; 8.手动结束; 9.状态异常; 10.步骤强制终止中; 11.步骤强制终止成功; 12.步骤强制终止失败 | +| create_time | long | 作业步骤实例创建时间,Unix时间戳,单位毫秒 | +| start_time | long | 开始执行时间,Unix时间戳,单位毫秒 | +| end_time | long | 执行结束时间,Unix时间戳,单位毫秒 | +| total_time | int | 总耗时,单位毫秒 | +| execute_count | int | 步骤重试次数 | +| step_ip_result_list | array | 每个主机的任务执行结果,定义见step_ip_result | + + +##### step_ip_result + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| ip | string | IP | +| bk_cloud_id | long | 管控区域ID | +| status | int | 作业执行状态:1.Agent异常; 5.等待执行; 7.正在执行; 9.执行成功; 11.执行失败; 12.任务下发失败; 403.任务强制终止成功; 404.任务强制终止失败 | +| tag | string | 用户通过job_success/job_fail函数模板自定义输出的结果。仅脚本任务存在该参数 | +| exit_code | int | 脚本任务exit code | +| error_code | int | 主机任务状态码,1.Agent异常; 3.上次已成功; 5.等待执行; 7.正在执行; 9.执行成功; 11.任务失败; 12.任务下发失败; 13.任务超时; 15.任务日志错误; 101.脚本执行失败; 102.脚本执行超时; 103.脚本执行被终止; 104.脚本返回码非零; 202.文件传输失败; 203.源文件不存在; 310.Agent异常; 311.用户名不存在; 320.文件获取失败; 321.文件超出限制; 329.文件传输错误; 399.任务执行出错 | +| start_time | long | 开始执行时间,Unix时间戳,单位毫秒 | +| end_time | long | 执行结束时间,Unix时间戳,单位毫秒 | +| total_time | int | 总耗时,单位毫秒 | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_job_plan_detail.md b/docs/apidoc/bk-api-gateway/v3/zh/get_job_plan_detail.md new file mode 100644 index 0000000000..7044e08f94 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_job_plan_detail.md @@ -0,0 +1,356 @@ +### 功能描述 + +根据作业执行方案 ID 查询作业执行方案详情 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|-------------|-------------|--------|--------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| job_plan_id | long | 是 | 作业执行方案 ID | + +### 请求参数示例 + +- GET +```json +/api/v3/get_job_plan_detail?bk_scope_type=biz&bk_scope_id=1&job_plan_id=100 +``` + +### 返回结果示例 +```json +{ + "result": true, + "code": 0, + "message": "", + "data": + { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100, + "name": "test", + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1577807999999, + "global_var_list": + [ + { + "id": 11, + "type": 1, + "name": "varName", + "value": "value is Me", + "description": "hello", + "required": 1, + "used": false + }, + { + "id": 12, + "type": 3, + "name": "servers", + "description": "", + "required": 0, + "used": true, + "server": + { + "dynamic_group_list": + [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": + [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": + [ + { + "id": 1000, + "node_type": "module" + } + ] + } + } + ], + "step_list": + [ + { + "id": 1059, + "type": 1, + "name": "run local script", + "script_info": + { + "script_type": 1, + "script_timeout": 1000, + "script_content": "ZWNobyAkMSAkMiAkMw==", + "script_param": "YTEgYTIgYTM=", + "is_param_sensitive": 0, + "account": + { + "id": 1, + "name": "root", + "alias": "root" + }, + "server": + { + "ip_list": + [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ] + } + } + }, + { + "id": 1060, + "type": 1, + "name": "run cite script", + "script_info": + { + "script_type": 2, + "script_id": "aaaaa-bbb-ccc-ddddd", + "script_version_id": 1078, + "script_timeout": 1000, + "script_param": "YTEgYTIgYTM=", + "is_param_sensitive": 1, + "account": + { + "id": 1, + "name": "root", + "alias": "root" + }, + "server": + { + "variable": "servers" + } + } + }, + { + "id": 1061, + "type": 2, + "name": "xxx", + "file_info": + { + "file_source": + [ + { + "file_list": + [ + "/tmp/REGEX:[a-z]*.txt" + ], + "server": + { + "variable": "servers" + }, + "account": + { + "id": 1, + "name": "root", + "alias": "root" + }, + "file_type": 1 + }, + { + "file_list": + [ + "testbucket/test.txt" + ], + "file_type": 3, + "file_source_id": 1 + } + ], + "file_destination": + { + "path": "/tmp/", + "account": + { + "id": 1, + "name": "root", + "alias": "root" + }, + "server": + { + "variable": "", + "dynamic_group_list": + [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": + [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.3" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.4" + } + ], + "topo_node_list": + [ + { + "id": 1000, + "node_type": "module" + } + ] + } + }, + "timeout": 60, + "transfer_mode": 1, + "upload_speed_limit": 1000, + "download_speed_limit": 1000 + } + } + ] + } +} +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|------------------|-----------|-----------| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 执行方案 ID | +| name | string | 作业名称 | +| creator | string | 作业创建人账号 | +| create_time | long | 创建时间,Unix 时间戳 | +| last_modify_user | string | 作业修改人账号 | +| last_modify_time | long | 最后修改时间,Unix 时间戳 | +| step_list | array | 步骤对象 | +| global_var_list | array | 全局变量信息 | + +##### step + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 作业步骤ID | +| name | string | 作业步骤名称 | +| type | int | 步骤类型:1.脚本步骤; 2.文件步骤; 3.人工确认步骤 | +| script_info | object | 脚本信息。当 type=1 时才有这个字段。 | +| file_info | object | 文件传输步骤信息。当 type=2 时才有这个字段 | + +##### script_info +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| script_type | int | 脚本类型:1 本地脚本 2 引用脚本 3 公共脚本 | +| script_id | string | 脚本 ID。当 script_type=2,3 时才有这个字段。 | +| script_version_id | long | 脚本版本 ID。当 script_type=2,3 时才有这个字段。 | +| script_content | string | 脚本内容。当 type=1 时才有这个字段。 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - SQL | +| script_param | string | 脚本参数 | +| script_timeout | int | 脚本超时时间,秒。默认3600,取值范围60-86400 | +| is_param_sensitive | int | 是否敏感参数, 0.不是(默认),1.是。| +| account | object | 执行账号名/别名 | + +##### file_info +| 字段 | 类型 | 描述 | +|----------------------|--------|-----------| +| file_source_list | array | 源文件信息 | +| file_destination | object | 目标信息 | +| timeout | int | 文件传输超时设置 | +| transfer_mode | int | 文件传输模式 | +| upload_speed_limit | int | 上传限速 | +| download_speed_limit | int | 下载限速 | + +##### global_var + +| 字段 | 类型 | 描述 | +|-------------|-----------|------------| +| id | long | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 全局变量名 | +| description | string | 全局变量描述 | +| type | int | 全局变量类型 | +| required | int | 模版/执行方案中该变量是否必填 | +| value | string | 字符、密码、数组类型的全局变量的值 | +| server | object | 主机类型全局变量的值 | +| used | bool | 变量是否被执行方案引用 | + +##### server +| 字段 | 类型 | 描述 | +|-----------------------|-------|------------| +| variable | string | 引用的变量名 | +| ip_list | array | 静态 IP 列表 | +| dynamic_group_list | array | 动态分组 ID 列表 | +| topo_node_list | array | 动态 topo 节点列表 | + +##### ip +| 字段 | 类型 | 描述 | +|-------------|---------|---------| +| bk_cloud_id | int | 管控区域ID | +| ip | string | IP地址 | + +##### dynamic_group +| 字段 | 类型 | 描述 | +|-----|---------|------------| +| id | string | 动态分组 ID | + +##### topo_node +| 字段 | 类型 | 描述 | +|------------------|--------|------------| +| id | long | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| + +##### account +| 字段 | 类型 | 必选 | 描述 | +|-------|--------|--------|------------| +| id | long | 否 | 账号 ID | +| name | string | 否 | 账号名 | + +##### file_source +| 字段 | 类型 | 描述 | +|-----------------|---------|-----------| +| file_list | array | 源文件的绝对路径数组,支持多个文件 | +| account | object | 执行账号名/别名 | +| server | object | 目标服务器 | +| file_type | int | 文件源类型,1:服务器文件,2:本地文件,3:第三方文件源文件 | +| file_source_id | int | 文件源类型为第三方文件源文件时的第三方文件源Id | + +##### file_destination +| 字段 | 类型 | 描述 | +|-----------------|---------|-----------| +| path | string | 目标文件存放的路径 | +| account | object | 执行账号名/别名| +| server | object | 目标服务器 | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_job_plan_list.md b/docs/apidoc/bk-api-gateway/v3/zh/get_job_plan_list.md new file mode 100644 index 0000000000..115677a60e --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_job_plan_list.md @@ -0,0 +1,92 @@ +### 功能描述 + +查询执行方案列表 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| job_template_id | long | 否 | 作业模版 ID | +| creator | string | 否 | 作业执行方案创建人账号 | +| name | string | 否 | 作业执行方案名称,模糊匹配 | +| create_time_start | long | 否 | 创建起始时间,Unix 时间戳 | +| create_time_end | long | 否 | 创建结束时间,Unix 时间戳 | +| last_modify_user | string | 否 | 作业执行方案修改人账号 | +| last_modify_time_start | long | 否 | 最后修改起始时间,Unix 时间戳 | +| last_modify_time_end | long | 否 | 最后修改结束时间,Unix 时间戳 | +| start | int | 否 | 默认0表示从第1条记录开始返回 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +-GET +```json +/api/v3/get_job_plan_list?bk_scope_type=biz&bk_scope_id=1&job_template_id=1&creator=admin&name=test&create_time_start=1546272000000&create_time_end=1577807999999&start=0&length=20 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 100, + "job_template_id": 1, + "name": "test", + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1546272000000 + } + ], + "start": 0, + "length": 20, + "total": 1 + } +} +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|------------------|-----------|-----------| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | long | 执行方案 ID | +| job_template_id | long | 作业模版 ID | +| name | string | 执行方案名称 | +| creator | string | 创建人账号 | +| create_time | long | 创建时间,Unix 时间戳 | +| last_modify_user | string | 修改人账号 | +| last_modify_time | long | 最后修改时间,Unix 时间戳 | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_job_template_list.md b/docs/apidoc/bk-api-gateway/v3/zh/get_job_template_list.md new file mode 100644 index 0000000000..e9a15d1ec4 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_job_template_list.md @@ -0,0 +1,89 @@ +### 功能描述 + +查询作业模版列表 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| creator | string | 否 | 作业执行方案创建人账号 | +| name | string | 否 | 作业执行方案名称,模糊匹配 | +| create_time_start | long | 否 | 创建起始时间,Unix 时间戳 | +| create_time_end | long | 否 | 创建结束时间,Unix 时间戳 | +| last_modify_user | string | 否 | 作业执行方案修改人账号 | +| last_modify_time_start | long | 否 | 最后修改起始时间,Unix 时间戳 | +| last_modify_time_end | long | 否 | 最后修改结束时间,Unix 时间戳 | +| start | int | 否 | 默认0表示从第1条记录开始返回 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +- GET +```json +/api/v3/get_job_template_list?bk_scope_type=biz&bk_scope_id=1&creator=admin&start=0&length=20&create_time_start=1546272000000&create_time_end=1577807999999 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 100, + "name": "test", + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1546272000000 + } + ], + "start": 0, + "length": 20, + "total": 1 + } +} +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|------------------|-----------|-----------| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | long | 作业模版 ID | +| name | string | 作业模版名称 | +| creator | string | 创建人账号 | +| create_time | long | 创建时间,Unix 时间戳 | +| last_modify_user | string | 修改人账号 | +| last_modify_time | long | 最后修改时间,Unix 时间戳 | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_list.md b/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_list.md new file mode 100644 index 0000000000..89b983353d --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_list.md @@ -0,0 +1,82 @@ +### 功能描述 + +查询公共脚本列表 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| name | string | 否 | 脚本名称,支持模糊查询 | +| script_language | int | 否 | 脚本语言。1:shell,2:bat,3:perl,4:python,5:powershell,6:sql。如果不传,默认返回所有脚本语言 | +| start | int | 否 | 分页记录起始位置,不传默认为0 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +- GET +```json +/api/v3/get_public_script_list?name=script1&script_language=1&start=0&length=10 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": "000dbdddc06c453baf1f2decddf00c69", + "name": "script1", + "script_language": 1, + "public": false, + "online_script_version_id": 100, + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### 返回结果参数说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言。1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - SQL | +| online_script_version_id | long | 已上线脚本版本ID;如果脚本没有已上线版本,该值为空 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user| string | 最近一次修改人 | +| last_modify_time| long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_version_detail.md b/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_version_detail.md new file mode 100644 index 0000000000..28fe76a354 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_version_detail.md @@ -0,0 +1,77 @@ +### 功能描述 + +查询公共脚本版本详情 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| id | long | 否 | 脚本版本ID,若传入则以此条件为准屏蔽其他条件 | +| script_id | string | 否 | 脚本ID(可与version一起传入定位某个脚本版本) | +| version | string | 否 | 脚本版本(可与script_id一起传入定位某个脚本版本) | + +### 请求参数示例 + +- GET +```json +/api/v3/get_public_script_version_detail?id=1 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": 1, + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "版本描述" + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } +} +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 脚本版本ID | +| script_id | string | 脚本版本所属的脚本ID | +| version | string | 版本号 | +| content | string | 脚本版本内容 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| version_desc | string | 版本描述 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_version_list.md b/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_version_list.md new file mode 100644 index 0000000000..489fba3cb4 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_version_list.md @@ -0,0 +1,85 @@ +### 功能描述 + +查询公共脚本版本列表 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| script_id | string | 是 | 脚本ID | +| return_script_content | bool | 否 | 是否需要返回脚本内容。true:返回脚本内容;false:不返回脚本内容。默认为false。 | +| start | int | 否 | 分页记录起始位置,不传默认为0 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +- GET +```json +/api/v3/get_public_script_version_list?script_id=000dbdddc06c453baf1f2decddf00c69&return_script_content=true&start=0&length=10 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": 1, + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "版本描述", + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 脚本版本ID | +| script_id | string | 脚本版本所属的脚本ID | +| version | string | 版本号 | +| content | string | 脚本内容 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| version_desc | string | 版本描述 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_script_list.md b/docs/apidoc/bk-api-gateway/v3/zh/get_script_list.md new file mode 100644 index 0000000000..f34968276f --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_script_list.md @@ -0,0 +1,88 @@ +### 功能描述 + +查询业务脚本列表 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| name | string | 否 | 脚本名称,支持模糊查询 | +| script_language | int | 否 | 脚本语言。0:所有脚本类型,1:shell,2:bat,3:perl,4:python,5:powershell,6:sql。默认值为0 | +| start | int | 否 | 分页记录起始位置,不传默认为0 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +- GET +```json +/api/v3/get_script_list?bk_scope_type=biz&bk_scope_id=1&name=script1&script_language=1&start=0&length=10 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": "000dbdddc06c453baf1f2decddf00c69", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "a.sh", + "script_language": 1, + "online_script_version_id": 100, + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### 返回结果参数说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | string | 脚本ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言。1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - SQL | +| online_script_version_id | long | 已上线脚本版本ID;如果脚本没有已上线版本,该值为空 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user| string | 最近一次修改人 | +| last_modify_time| long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_script_version_detail.md b/docs/apidoc/bk-api-gateway/v3/zh/get_script_version_detail.md new file mode 100644 index 0000000000..f936675499 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_script_version_detail.md @@ -0,0 +1,84 @@ +### 功能描述 + +查询业务脚本版本详情 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| id | long | 否 | 脚本版本ID,若传入则以此条件为准屏蔽其他条件 | +| script_id | string | 否 | 脚本ID(可与version一起传入定位某个脚本版本) | +| version | string | 否 | 脚本版本(可与script_id一起传入定位某个脚本版本) | + +### 请求参数示例 + +- GET +```json +/api/v3/get_script_version_detail?bk_scope_type=biz&bk_scope_id=1&id=1 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "版本描述" + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } +} +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 脚本版本ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 脚本版本所属的脚本ID | +| version | string | 版本号 | +| content | string | 脚本版本内容 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| version_desc | string | 版本描述 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/get_script_version_list.md b/docs/apidoc/bk-api-gateway/v3/zh/get_script_version_list.md new file mode 100644 index 0000000000..95d4d0c42e --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/get_script_version_list.md @@ -0,0 +1,92 @@ +### 功能描述 + +查询业务脚本版本列表 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Query参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| script_id | string | 是 | 脚本ID | +| return_script_content | bool | 否 | 是否需要返回脚本内容。true:返回脚本内容;false:不返回脚本内容。默认为false。 | +| start | int | 否 | 分页记录起始位置,不传默认为0 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +- GET +```json +/api/v3/get_script_version_list?bk_scope_type=biz&bk_scope_id=1&script_id=000dbdddc06c453baf1f2decddf00c69&return_script_content=true&start=0&length=10 +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash", + "status": 1, + "version_desc": "版本描述", + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### 返回结果说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 脚本版本ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 脚本版本所属的脚本ID | +| version | string | 版本号 | +| content | string | 脚本内容 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| version_desc | string | 版本描述 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/operate_job_instance.md b/docs/apidoc/bk-api-gateway/v3/zh/operate_job_instance.md new file mode 100644 index 0000000000..280e3f455b --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/operate_job_instance.md @@ -0,0 +1,53 @@ +### 功能描述 + +用于对执行的作业实例进行操作 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Body参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| job_instance_id | long | 是 | 作业实例ID | +| operation_code | int | 是 | 操作类型:1、终止作业 | + +### 请求参数示例 + +- POST +```json +{ + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100, + "operation_code": 1 +} +``` + +### 返回结果示例 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/operate_step_instance.md b/docs/apidoc/bk-api-gateway/v3/zh/operate_step_instance.md new file mode 100644 index 0000000000..002ea106d8 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/operate_step_instance.md @@ -0,0 +1,82 @@ +### 功能描述 + +用于对执行的实例的步骤进行操作 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Body参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| job_instance_id | long | 是 | 作业实例ID | +| step_instance_id | long | 是 | 步骤实例ID | +| operation_code | int | 是 | 操作类型:2、失败IP重做,3、忽略错误,4、执行,5、跳过,6、确认继续 8、全部重试,9、终止确认流程,10-重新发起确认 | + +##### operation_code 详细说明 +| operation_code | 操作类型 | 适用步骤 | 描述 | +|-----------|------------|--------|------------| +| 2 | 失败IP重做 | 脚本执行,文件分发步骤 | 对失败的IP重新下发任务 | +| 3 | 忽略错误 | 脚本执行,文件分发步骤 | 忽略错误,继续执行 | +| 6 | 确认继续 | 人工确认步骤 | 确认继续执行 | +| 8 | 全部重试 | 脚本执行,文件分发步骤 | 对所有的IP重新下发任务 | +| 9 | 终止确认流程 | 人工确认步骤 | 确认终止执行 | +| 10 | 重新发起确认 | 人工确认步骤 | 重新发起确认 | +| 11 | 进入下一步 | 脚本执行,文件分发步骤 | 当步骤状态为终止成功,用于继续执行后续步骤 | +| 12 | 强制跳过 | 脚本执行,文件分发步骤 | 当步骤状态为终止中,用于强制跳过当前步骤,执行后续步骤| + +### 请求参数示例 + +- POST +```json +{ + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100, + "step_instance_id": 200, + "operation_code": 2 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success",s + "data": { + "step_instance_id": 200, + "job_instance_id": 100 + } +} +``` + +### 返回结果参数说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| step_instance_id | long | 步骤实例ID | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/push_config_file.md b/docs/apidoc/bk-api-gateway/v3/zh/push_config_file.md new file mode 100644 index 0000000000..074c19a7a0 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/push_config_file.md @@ -0,0 +1,122 @@ +### 功能描述 + +分发配置文件,此接口用于分发配置文件等小的纯文本文件 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Body参数 + +| 字段 | 类型 | 必选 | 描述 | +|-------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| task_name | string | 否 | 自定义作业名称 | +| account_alias | string | 是 | 执行账号别名 | +| file_target_path | string | 是 | 文件传输目标路径 | +| file_list | array | 是 | 源文件对象数组,见下面file定义 | +| target_server | object | 是 | 目标服务器,见server定义 | + +##### file + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| file_name | string | 是 | 文件名称 | +| content | string | 是 | 文件内容Base64 | + +##### server + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ----------------------------------- | +| ip_list | array | 否 | 静态 IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +##### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | long | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +##### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +##### topo_node_list + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set" | + +### 请求参数示例 + +- POST +```json +{ + "bk_scope_type": "biz", + "bk_scope_id": "1", + "account": "root", + "file_target_path": "/tmp/", + "file_list": [ + { + "file_name": "a.txt", + "content": "aGVsbG8gd29ybGQh" + } + ], + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } +} +``` + +### 返回结果示例 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| job_instance_name | long | 作业实例名称 | +| step_instance_id | long | 步骤实例ID | diff --git a/docs/apidoc/bk-api-gateway/v3/zh/save_cron.md b/docs/apidoc/bk-api-gateway/v3/zh/save_cron.md new file mode 100644 index 0000000000..c421c23aff --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/save_cron.md @@ -0,0 +1,388 @@ +### 功能描述 + +新建或保存定时任务;新建定时任务,定时任务状态默认为暂停,如有需要可调用update_cron_status接口开启。 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Body参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| job_plan_id | long | 是 | 要定时执行的作业的执行方案 ID | +| id | long | 否 | 定时任务 ID,更新定时任务时,必须传这个值 | +| name | string | 否 | 定时作业名称,新建时必填,修改时选填 | +| expression | string | 否 | 定时任务 crontab 的定时规则,新建时必填,修改时选填,各字段含义为:分 时 日 月 周,如: 0/5 * * * * 表示每5分钟执行一次,注意:不支持? | +| execute_time | long | 否 | 定时任务单次执行的执行时间,Unix时间戳,新建定时任务时不可与expression同时为空 | +| global_var_list | array | 否 | 全局变量信息,可使用 查询执行方案详情 接口查询方案可设置的变量信息 | + +##### global_var + +| 字段 | 类型 | 必选 | 描述 | +|-----------|-----------|--------|------------| +| id | long | 否 | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 否 | 全局变量 name | +| value | string | 否 | 字符、密码、数组类型的全局变量的值 | +| server | object | 否 | 主机类型全局变量的值 | + +##### server +| 字段 | 类型 | 必选 | 描述 | +|-----------------------|-------|--------|------------| +| ip_list | array | 否 | 静态 IP 列表 | +| dynamic_group_list | array | 否 | 动态分组列表 | +| topo_node_list | array | 否 | 动态 topo 节点列表 | + +##### ip + +| 字段 | 类型 | 必选 | 描述 | +|-------------|---------|--------|---------| +| bk_cloud_id | int | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +##### topo_node +| 字段 | 类型 | 必选 | 描述 | +|------------------|--------|--------|------------| +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| + + +### 请求参数示例 +- POST +#### 1.创建定时任务 +```json +{ + "bk_scope_type": "biz", + "bk_scope_id": "1", + "execute_time": 0, + "expression": "0 0/5 * * *", + "job_plan_id": 1023060, + "name": "test API", + "global_var_list": [ + { + "name": "stringVar", + "value": "value11112" + }, + { + "name": "nsVar", + "value": "nsvalue11112" + }, + { + "name": "secretVar", + "value": "secretvalue11112" + }, + { + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)" + }, + { + "name": "indexArrVar", + "value": "(2 3 4)" + }, + { + "name": "hostVar", + "server": { + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ] + } + } + ] +} +``` +#### 2.更新定时任务 +```json +{ + "id": 1000064, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "execute_time": 0, + "expression": "0 0/5 * * *", + "job_plan_id": 1023060, + "name": "test API", + "global_var_list": [ + { + "name": "stringVar", + "value": "value111333312" + }, + { + "name": "nsVar", + "value": "nsvalue111333312" + }, + { + "name": "secretVar", + "value": "secretvalue111333312" + }, + { + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)" + }, + { + "name": "indexArrVar", + "value": "(22 3 4)" + }, + { + "name": "hostVar", + "server": { + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ] + } + } + ] +} +``` + +### 返回结果示例 +#### 1.创建定时任务 +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000067, + "name": "test API", + "status": 2, + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 1023060, + "expression": "0 0/5 * * *", + "global_var_list": [ + { + "id": 1001101, + "name": "stringVar", + "value": "value11112", + "description": null, + "type": 1, + "required": null, + "server": null + }, + { + "id": 1001102, + "name": "nsVar", + "value": "nsvalue11112", + "description": null, + "type": 2, + "required": null, + "server": null + }, + { + "id": 1001104, + "name": "secretVar", + "value": "secretvalue11112", + "description": null, + "type": 4, + "required": null, + "server": null + }, + { + "id": 1001105, + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)", + "description": null, + "type": 5, + "required": null, + "server": null + }, + { + "id": 1001106, + "name": "indexArrVar", + "value": "(2 3 4)", + "description": null, + "type": 6, + "required": null, + "server": null + }, + { + "id": 1001103, + "name": "hostVar", + "value": null, + "description": null, + "type": 3, + "required": null, + "server": { + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ], + "dynamic_group_list": null, + "topo_node_list": null + } + } + ], + "create_time": 1642045370, + "last_modify_user": "admin", + "last_modify_time": 1642045370 + } +} +``` +#### 2.更新定时任务 +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000064, + "name": "test API", + "status": 2, + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 1023060, + "expression": "0 0/5 * * *", + "global_var_list": [ + { + "id": 1001101, + "name": "stringVar", + "value": "value111333312", + "description": null, + "type": 1, + "required": null, + "server": null + }, + { + "id": 1001102, + "name": "nsVar", + "value": "nsvalue111333312", + "description": null, + "type": 2, + "required": null, + "server": null + }, + { + "id": 1001104, + "name": "secretVar", + "value": "secretvalue111333312", + "description": null, + "type": 4, + "required": null, + "server": null + }, + { + "id": 1001105, + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)", + "description": null, + "type": 5, + "required": null, + "server": null + }, + { + "id": 1001106, + "name": "indexArrVar", + "value": "(22 3 4)", + "description": null, + "type": 6, + "required": null, + "server": null + }, + { + "id": 1001103, + "name": "hostVar", + "value": null, + "description": null, + "type": 3, + "required": null, + "server": { + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ], + "dynamic_group_list": null, + "topo_node_list": null + } + } + ], + "create_time": 1641990674, + "last_modify_user": "admin", + "last_modify_time": 1641995052 + } +} +``` + +### 返回结果参数说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------------|------------|-------------| +| id | long | 定时任务 ID| +| name | string | 定时作业名称| +| status | int | 定时任务状态| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 要定时执行的作业的执行方案 ID | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(s) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(s) | +| expression | string | 定时任务 crontab 的定时规则,| +| execute_time | long | 定时任务单次执行的执行时间,Unix时间戳| +| global_var_list | array | 全局变量信息,定义见global_var | + +##### global_var + +| 字段 | 类型 | 描述 | +|-------------|-----------|------------| +| id | long | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 全局变量名 | +| description | string | 全局变量描述 | +| type | int | 全局变量类型 | +| required | int | 模版/执行方案中该变量是否必填 | +| value | string | 字符、密码、数组类型的全局变量的值 | +| server | object | 主机类型全局变量的值 | + +##### server +| 字段 | 类型 | 描述 | +|-----------------------|-------|------------| +| variable | string | 引用的变量名 | +| ip_list | array | 静态 IP 列表 | +| dynamic_group_list | array | 动态分组 ID 列表 | +| topo_node_list | array | 动态 topo 节点列表 | + +##### ip +| 字段 | 类型 | 描述 | +|-------------|---------|---------| +| bk_cloud_id | int | 管控区域ID | +| ip | string | IP地址 | + +##### dynamic_group +| 字段 | 类型 | 描述 | +|-----|---------|------------| +| id | string | 动态分组 ID | + +##### topo_node +| 字段 | 类型 | 描述 | +|------------------|--------|------------| +| id | long | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| diff --git a/docs/apidoc/bk-api-gateway/v3/zh/update_cron_status.md b/docs/apidoc/bk-api-gateway/v3/zh/update_cron_status.md new file mode 100644 index 0000000000..f782963ec3 --- /dev/null +++ b/docs/apidoc/bk-api-gateway/v3/zh/update_cron_status.md @@ -0,0 +1,64 @@ +### 功能描述 + +更新定时作业状态,如启动或暂停 + +### 请求参数 + +{{ bkapi_authorization_description }} + +#### Header参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | +| Accept | string | 是 | 固定值。application/json| +| Content-Type | string | 是 | 固定值。application/json| + +#### Body参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------- |------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | +| id | long | 是 | 定时作业 ID | +| status | int | 是 | 定时状态,1.启动、2.暂停 | + +### 请求参数示例 + +- POST +```json +{ + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 2, + "status": 1 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": 2 +} +``` + +### 返回结果参数说明 + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +##### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| data | long | 定时任务ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/batch_get_job_instance_ip_log.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/batch_get_job_instance_ip_log.md new file mode 100644 index 0000000000..21d9788380 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/batch_get_job_instance_ip_log.md @@ -0,0 +1,166 @@ +### Function Description + +Bulk query of job execution logs by host list + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business, biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_instance_id | long | yes | Job instance ID | +| step_instance_id | long | yes | Step instance ID | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Host IP list. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | + +##### ip + +| Fields | Type | Required | Description | +| ----------- | ------ | -------- | ------------- | +| bk_cloud_id | int | yes | BK-Net ID | +| ip | string | yes | IP address | + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100, + "step_instance_id": 200, + "host_id_list": [ + 101,102 + ] +} +``` + +### Example of response + +#### Script execution steps +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 2, + "task_instance_id": 100, + "step_instance_id": 200, + "file_task_logs": [ + { + "bk_host_id": 101, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "file_logs": [ + { + "mode": 1, + "src_ip": { + "bk_host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "dest_ip": { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + "dest_path": "/tmp/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success" + } + ] + }, + { + "ip": "10.0.0.2", + "bk_cloud_id": 0, + "file_logs": [ + { + "mode": 0, + "src_ip": { + "bk_host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /data/1.log FileSize: 9.0 Bytes State: source agent success upload file Speed: 1 KB/s Progress: 100% StatusDesc: source agent success upload file Detail: success upload" + } + ] + } + ] + } +} +``` + +**File distribution task return result description** + +- If you need to return the upload log of the file source, you need to add the source file server IP to ip_list + +### Return Result Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Request success or failure. true: Request successful; false: Request failed | +| code | int | Error code. 0 means SUCCESS, >0 means FAIL | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | +| request_id | string | Request chain id | + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| bk_host_id | long | Host ID | +| bk_cloud_id | int | Target server BK-Net ID | +| ip | string | Target server IP address | +| log_type | int | Log type. 1 - Script execution task log; 2 - File distribution task log | +| script_task_logs | array | Log of script execution task. See script_task_log for definition | +| file_task_logs | array | File distribution task log. See file_task_log for definition | + +#### script_task_log + +| Fields | Type | Description | +|-----------|------------|--------| +| bk_host_id | long | Host ID | +| bk_cloud_id | long | BK-Net ID | +| ip | string | Target IP address | +| log_content | string | Script execution log content | + +#### file_task_log + +| Fields | Type | Description | +|-----------|------------|--------| +| bk_host_id | long | Host ID | +| bk_cloud_id | long | BK-Net ID | +| ip | string | Source/target IP address | +| file_logs | array | File distribution log content. See file_log for definition | + +#### file_log + +| Fields | Type | Description | +|-----------|-----------|-----------| +| mode | int | Distribution mode. 0: Upload; 1: Download | +| src_ip | object |File source host IP. see ip for definition | +| src_path | string | Source file paths | +| dest_ip | object | Distribute the target host IP, with value for mode=1. See ip for definition. | +| dest_path | string | Target path, with value for mode=1 | +| status | int | Task status. 1-Waiting; 2-Uploading; 3-Downloading; 4- Success; 5- Failure | +| log_content | string | File distribution log contents | + +#### ip + +| Fields | Type | Description | +|-----------|------------|--------| +| bk_host_id | long | Host ID | +| bk_cloud_id | long | BK-Net ID | +| ip | string | IP Address | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/callback_protocol.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/callback_protocol.md new file mode 100644 index 0000000000..8dad1af2de --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/callback_protocol.md @@ -0,0 +1,42 @@ +### Function Description + +This component is only used to present the callback protocol when job finished. + + +### Request Parameters + +| Fields | Type | Required | Description | +|-----------------|------------|--------|------------| +| job_instance_id | long | yes | Job instance ID | +| status | int | yes | Job status code. 1 - Pending; 2 - Running 3 - Successful; 4 - Failed; 5 - Skipped; 6 - Ignore Error; 7 - Waiting; 8 - Terminated; 9 - Abnormal; 10 - Terminating; 11 - Terminate Success; 13 - Termination Confirmed; 14 - Abandoned| +| step_instance_list | array | yes | The execution result of steps | + +#### step_instances + +| Fields | Type | Required | Description | +|-----------------|------------|--------|------------| +| step_instance_id | long | yes | Job step instance ID | +| status | int | yes | Job step status code: 1 - Pending; 2 - Running 3 - Successful; 4 - Failed; 5 - Skipped; 6 - Ignore Error; 7 - Waiting; 8 - Terminated; 9 - Abnormal; 10 - Terminating; 11 - Terminate Success; 13 - Termination Confirmed; 14 - Abandoned| + +### Example of request + +```json +{ + "job_instance_id": 12345, + "status": 2, + "step_instance_list": [ + { + "step_instance_id": 16271, + "status": 3 + }, + { + "step_instance_id": 16272, + "status": 2 + } + ] +} +``` + +### Callback response + +The success of the callback is based on HTTP status, if it succeeds, the status code 200, the other indicates failure, Job will do a retry for the failed one, if it still fails, the failure will be ignored and no more callbacks. \ No newline at end of file diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/common.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/common.md new file mode 100644 index 0000000000..c106d51491 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/common.md @@ -0,0 +1,45 @@ +## Common Fields and Conventions + +#### global_var + +| Fields | Type | **Required** | **Description** | +|-------------|------------|--------|------------| +| id | long | no | Global variables ID . If id is empty, then name is used as the unique identifier | +| name | string | no | Global variables name | +| description | string | no | Global variables description | +| type | int | no | Global variables types | +| required | int | no | Is this variable required | +| value | string | no | Values of global variables of String, Ciphertext, Namespace, and Array types | +| server | object | no | Value of global variable of Host type | + +#### server +| Fields | Type | **Required** | **Description** | +|-----------------------|-------|--------|------------| +| ip_list | array | no | Static IP list, see ip for definition | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | + +#### ip +| Fields | Type | **Required** | **Description** | +|-------------|---------|--------|---------| +| bk_cloud_id | int | yes | BK-Net ID | +| ip | string | yes | IP Address | + +#### dynamic_group + +| Fields | Type | **Required** | **Description** | +| ------ | ------ | ------------ | --------------------- | +| id | string | yes | CMDB Dynamic Group ID | + +#### topo_node + +| Fields | Type | **Required** | **Description** | +|------------------|--------|--------|------------| +| id | long | yes | Dynamic topo node ID, corresponding to bk_inst_id in CMDB API | +| node_type | string | yes | Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module", "set" | + +#### account +| Fields | Type | **Required** | **Description** | +|-------|--------|--------|------------| +| id | long | no | Account ID | +| name | string | no | Account name | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_credential.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_credential.md new file mode 100644 index 0000000000..d3f53f2c87 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_credential.md @@ -0,0 +1,70 @@ +### **Description** Function Description + +Create credential. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| name | string | yes | Required Credential Name | +| type | string | yes | Credential type,value can be ACCESS_KEY_SECRET_KEY,PASSWORD,USERNAME_PASSWORD,SECRET_KEY | +| description | string | no | Credentials Description | +| credential_access_key | string | no | When the credential type is ACCESS_KEY_SECRET_KEY, required | +| credential_secret_key | string | no | When the credential type is ACCESS_KEY_SECRET_KEY/SECRET_KEY, required | +| credential_username | string | no | When the credential type is USERNAME_PASSWORD, required | +| credential_password | string | no | When the credential type is USERNAME_PASSWORD/PASSWORD, required | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "testCredential", + "type": "USERNAME_PASSWORD", + "description": "This is a test credential", + "credential_username": "admin", + "credential_password": "password" +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": "06644309e10e4068b3c7b32799668210" + } +} +``` + +### Response Description + +#### response +| **Fields** | **Type** | **Description** | +|-----------|-----------|-----------| +| result | bool | Success or failure of the request. true: request successful; false: request failed | +| code | int | Error code. 0 means SUCCESS, >0 means FAIL | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | +| request_id | string | Request chain id | + +#### data + +| Fields | **Type** |Whether the field must exist | **Description** | +|-----------|-------|---------------|---------| +| id | string |yes | Credential ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_file_source.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_file_source.md new file mode 100644 index 0000000000..e7d5d58014 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_file_source.md @@ -0,0 +1,87 @@ +### Description Function Description + +Create a new file source, currently only BlueKing Repository file sources that are associated with automatically selected public access points are supported. +The created file source has the following default features: + +| Characteristic | Value | +|-----------------|------------| +|Storage Type|Object Storage| +|File Source Type|BlueKing Repository| +|Whether it is a public file source|no| +| Access Point Selection Range |Public Access Point| +|Access Point Selection Mode|Automatic| + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| **Fields** | **Type** | **Required** | **Description** | +|-----------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| code | string | yes | File source identification, beginning with English characters, 1-32 English characters, underscores, numbers, cannot be changed after creation | +| alias | string | yes | File source alias | +| type | string | yes | File Source Type, Currently only the BlueKing Repository is supported,BLUEKING_ARTIFACTORY | +| access_params | object | yes | File source access parameters, pass in different objects according to type, see subsequent instructions | +| credential_id | string | no | Credential Id used by the file source | +| file_prefix | string | no | JOB prefix for files distributed from this source, no prefix by default | + +### access_params +Type is BLUEKING_ARTIFACTORY + +| **Fields** | **Type** | **Required** | **Description** | +|-----------------|------------|--------|------------| +| base_url | string | yes | The root url of the BlueKing Repository instance, for example: https://bkrepo.com | + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "code": "sopsArtifactory", + "alias": "SOPS BK-REPO File Source ", + "type": "BLUEKING_ARTIFACTORY", + "access_params": { + "base_url": "https://bkrepo.com" + }, + "credential_id": "06644309e10e4068b3c7b32799668210", + "file_prefix": "" +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": 1 + } +} +``` + +### Response Description + +#### response +| **Fields** | **Type** | **Description** | +|-----------|-----------|-----------| +| result | bool | Request success or failure. true: Request successful; false: Request failed | +| code | int | Error code. 0 means SUCCESS, >0 means FAIL | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | +| request_id | string | Request chain id | + +#### data + +| Fields | **Type** | Whether the field must exist | **Description** | +|-----------|-------|---------------|---------| +| id | int |yes | File Source ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_public_script.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_public_script.md new file mode 100644 index 0000000000..49d90b522f --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_public_script.md @@ -0,0 +1,89 @@ +### Function Description + +Create public script + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| --------------- | ------ | -------- | ------------------------------------------------------------ | +| name | string | yes | Public script name | +| description | string | no | Public script description | +| script_language | int | yes | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | yes | Script content, requiring Base64 encoding | +| version | string | yes | Version | +| version_desc | string | no | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "name": "public script test", + "description": "public script test", + "script_language": "1", + "content": "IyEvYmluL2Jhc2gKbHM=", + "version": "1.0" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000018, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "public_script": true, + "content": "IyEvYmluL2Jhc2gKbHM=", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691739630000, + "version": "1.0", + "status": 0, + "description": "public script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | Public script or not | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_public_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_public_script_version.md new file mode 100644 index 0000000000..0092543d19 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_public_script_version.md @@ -0,0 +1,87 @@ +### Function Description + +Create Public Script Version + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------------ | ------ | -------- | ----------------------------------------- | +| script_id | string | yes | Script id | +| content | string | yes | Script content, requiring Base64 encoding | +| version | string | yes | Version | +| version_desc | string | 否 | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "content": "IyEvYmluL2Jhc2gKbHM=", + "version": "2.0", + "version_desc": "version 2" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000020, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "public_script": true, + "content": "IyEvYmluL2Jhc2gKbHM=", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691739630000, + "version": "1.0", + "version_desc": "version 2", + "status": 0, + "description": "public script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | Public script or not | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_script.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_script.md new file mode 100644 index 0000000000..4039eed751 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_script.md @@ -0,0 +1,98 @@ +### Function Description + +Create Script + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| --------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| name | string | yes | Script name | +| description | string | no | Script description | +| script_language | int | yes | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | yes | Script content, requiring Base64 encoding | +| version | string | yes | Version | +| version_desc | string | no | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "name": "script test", + "description": "script test", + "script_language": "1", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version": "1.0" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "public_script": false, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "creator": "admin", + "create_time": 1691741073000, + "last_modify_user": "admin", + "last_modify_time": 1691741073000, + "version": "1.0", + "status": 0, + "description": "script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | Public script or not | +| bk_scope_type | string | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | + diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_script_version.md new file mode 100644 index 0000000000..b113f3ab62 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_script_version.md @@ -0,0 +1,95 @@ +### Function Description + +Create Script Version + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| content | string | yes | Script content, requiring Base64 encoding | +| version | string | yes | Version | +| version_desc | string | no | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version": "2.0", + "version_desc": "version 2" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000021, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "public_script": false, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "creator": "admin", + "create_time": 1691743535000, + "last_modify_user": "admin", + "last_modify_time": 1691743535000, + "version": "2.0", + "version_desc": "version 2", + "status": 0, + "description": "script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | Public script or not | +| bk_scope_type | string | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_public_script.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_public_script.md new file mode 100644 index 0000000000..3b1fd4e372 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_public_script.md @@ -0,0 +1,50 @@ +### Function Description + +Delete public script will also delete all script versions under that script. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| --------- | ------ | -------- | ---------------- | +| script_id | string | yes | Public script id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +null diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_public_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_public_script_version.md new file mode 100644 index 0000000000..b300ba2aac --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_public_script_version.md @@ -0,0 +1,52 @@ +### Function Description + +Delete script version + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------ | +| script_id | string | yes | Public script id | +| script_version_id | long | yes | Public script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": "1000017" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +null diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_script.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_script.md new file mode 100644 index 0000000000..7e5f0d9c8b --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_script.md @@ -0,0 +1,54 @@ +### Function Description + +Delete script will also delete all script versions under that script + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | long | yes | Script id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +null diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_script_version.md new file mode 100644 index 0000000000..421e4c3be7 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_script_version.md @@ -0,0 +1,56 @@ +### Function Description + +Delete script version + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| script_version_id | long | yes | Script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +null diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/disable_public_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/disable_public_script_version.md new file mode 100644 index 0000000000..8c5511fa32 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/disable_public_script_version.md @@ -0,0 +1,61 @@ +### Function Description + +Disable the public script version. Once disabled successfully, it cannot be restored! And any job steps that reference this version online will not be able to be executed, please be cautious when operating. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------ | +| script_id | string | yes | Public script id | +| script_version_id | long | yes | Public script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000018 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000018, + "id": "4537fb49ec0840a1b91cef4179c99f9c", + "status": 3 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | string | Script id | +| script_version_id | long | Script version id | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/disable_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/disable_script_version.md new file mode 100644 index 0000000000..f66b76fc4e --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/disable_script_version.md @@ -0,0 +1,65 @@ +### Function Description + +Disable script version, once successfully disabled, cannot be restored! And any job steps that reference this version online will not be able to be executed, please be cautious when operating. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| script_version_id | long | yes | Script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000019, + "id": "4a350b0e0707450e93326f6ace921072", + "status": 3 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | string | Script id | +| script_version_id | long | Script version id | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/execute_job_plan.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/execute_job_plan.md new file mode 100644 index 0000000000..572a025329 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/execute_job_plan.md @@ -0,0 +1,128 @@ +### Function Description + +Start Job Plan + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_plan_id | long | yes | JOB plan ID | +| global_var_list | array | no | Global variables. For global variable values in a job execution plan, the value of the incoming variable is used if it is included in the request parameters; otherwise, the default value currently configured by the JOB Plan is used. See global_var for definition | +| callback_url | string | no | Callback URL, when the task execution is completed, JOB will call this URL to inform the task execution result. The callback protocol refers to the callback_protocol component documentation | + +#### global_var + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| id | long | no | Global variable id, unique identifier. If id is empty, then name is used as the unique identifier | +| name | string | no | Global variable name | +| value | string | no | Values of global variables of String, Ciphertext, Array, and Namespace types | +| server | object | no | The value of the global variable of the Host type, see server definition | + +#### server + +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | + +#### ip + +| Fields | Type | Required | Description | +| ----------- | ------ | -------- | ------------- | +| bk_cloud_id | int | yes | BK-Net ID | +| ip | string | yes | IP Address | + +#### dynamic_group + +| Fields | Type | Required | Description | +| ------ | ------ | -------- | --------------------- | +| id | string | yes | CMDB Dynamic Group ID | + +#### topo_node + +| Fields | Type | Required | Description | +| --------- | ------ | -------- | ------------------------------------------------------------ | +| id | long | yes | Dynamic topo node ID, corresponding to bk_inst_id in CMDB API | +| node_type | string | yes | Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module", "set" | + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100, + "global_var_list": [ + { + "id": 436, + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "host_id_list": [ + 101, + 102 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } + }, + { + "name": "param_name", + "value": "param_value" + } + ] +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "Test", + "job_instance_id": 10000 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Success or failure of the request. true: request successful; false: request failed | +| code | int | Error code. 0 means SUCCESS, >0 means FAIL | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | +| request_id | string | Request chain id | + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| job_instance_id | long | Job instance ID | +| job_instance_name | long | Job instance name | + diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/fast_execute_script.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/fast_execute_script.md new file mode 100644 index 0000000000..23aad4be69 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/fast_execute_script.md @@ -0,0 +1,125 @@ +### Function Description + +Start Job Plan + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|---------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_version_id | long | no | Script version ID. When script_version_id is not empty, the script version corresponding to script_version_id is used| +| script_id | string | no |Script id. When script_id is passed in and script_version_id is empty, the online version of the script is used| +| script_content | string | no |Script content Base64. If script_version_id and script_id do not exist, script_content is used. Priority: script_version_id>script_id>script_content| +| task_name | string | no | Custom job name| +| script_param | string | no | Script parameter Base64 encoding.| +| timeout | long | no | Script execution timeout in seconds. The default value is 7200, and the value range is [1,86400]| +| account_alias | string | no | Execution account alias. The account_id takes precedence when both account_alias and account_id exist. | +| account_id | long | no |Execution account ID. The account_id takes precedence when both account_alias and account_id exist. | +| is_param_sensitive | int | no | Sensitive parameters will be hidden on the execution details page, 0: No (default), 1: Yes| +| script_language | int | no |Scripting languages: 1 - shell, 2 - bat, 3 - Perl, 4 - Python, 5 - PowerShell. Script_language needs to be specified when you pass in a custom script using script_content| +| target_server | object | no | Target server, see server definition| +| callback_url | string | no | Callback URL, when the task execution is completed, the JOB will call this URL to inform the task execution result. Callback protocol refer to the callback_protocol component documentation| + +#### server +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | + +#### ip + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_cloud_id | long | yes | BK-Net ID | +| ip | string | yes | IP Address | + +#### dynamic_group + +| Fields | Type | Required | Description | +| ------ | ------ | -------- | -------------- | +| id | string | yes | CMDB dynamic grouping ID| + +#### topo_node_list + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| id | long | yes |Dynamic topo node ID, corresponding to bk_inst_id in CMDB API| +| node_type | string | yes |Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module" and "set"| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_version_id": 1, + "script_content": "ZWNobyAkMQ==", + "script_param": "aGVsbG8=", + "timeout": 1000, + "account_id": 1000, + "is_param_sensitive": 0, + "script_language": 1, + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "host_id_list": [ + 101, + 102 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API Quick execution script1521100521303", + "job_instance_id": 10000, + "step_instance_id": 10001 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| job_instance_id | long | Job instance ID| +| job_instance_name | long | Job instance name| +| step_instance_id | long | Step instance ID| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/fast_execute_sql.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/fast_execute_sql.md new file mode 100644 index 0000000000..82fd6575b3 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/fast_execute_sql.md @@ -0,0 +1,117 @@ +### Function Description + +Quick execution of SQL scripts + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|---------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_version_id | long | no | SQL script version ID| +| script_id | string | no |Script id. When script_id is passed in and script_version_id is empty, the online version of the current script is used| +| script_content | string | no | Script content Base64. If script_version_id and script_id do not exist, script_content is used. Priority: script_version_id>script_id>script_content| +| timeout | int | no | Script timeout in seconds. Default 7200, value range 1 86400| +| db_account_id | long | yes |Db account ID for SQL execution| +| target_server | object | no | Target server, see server definition| +| callback_url | string | no | Callback URL, when the task execution is completed, the JOB will call this URL to inform the task execution result. Callback protocol refer to the callback_protocol component documentation| + +#### server + +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | + +#### ip + +| Fields | Type | Required | Description | +| ----------- | ------ | -------- | ------------- | +| bk_cloud_id | long | yes | BK-Net ID | +| ip | string | yes | IP Address | + +#### dynamic_group + +| Fields | Type | Required | Description | +| ------ | ------ | -------- | -------------- | +| id | string | yes | CMDB dynamic grouping ID| + +#### topo_node_list + +| Fields | Type | Required | Description | +| --------- | ------ | -------- | ------------------------------------------------------------ | +| id | long | yes | Dynamic topo node ID, corresponding to bk_inst_id in CMDB API | +| node_type | string | yes | Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module,""set"| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_version_id": 1, + "timeout": 1000, + "db_account_id": 32, + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "host_id_list": [ + 101, + 102 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API Quick SQL Execution1524454292038", + "job_instance_id": 10000, + "step_instance_id": 10001 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| job_instance_id | long | Job instance ID| +| job_instance_name | long | Job instance name| +| step_instance_id | long | Step instance ID| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/fast_transfer_file.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/fast_transfer_file.md new file mode 100644 index 0000000000..d1c6610a93 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/fast_transfer_file.md @@ -0,0 +1,173 @@ +### Function Description +Quick File transfer + +### Request Parameters +{{ common_args_desc }} + +#### Interface parameters +| Fields | Type | Required | Description | +|------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| account_alias | string | no |Target execution account alias, available from the account page, recommended. When both account_alias and account_id exist, account_id takes precedence. | +| account_id | long | no |Target execution account ID, available from the get_account_List api. When both account_alias and account_id exist, account_id takes precedence. | +| file_target_path | string | yes |File transfer destination path| +| file_source_list | array | yes |File source object array, see file_source Definition below| +| timeout | int | no | Task timeout in seconds, default is 7200. Value range 1 86400.| +| download_speed_limit| int | no | Download speed limit in MB. If this parameter is not passed in, it means no speed limit| +| upload_speed_limit| int | no | Upload speed limit, in MB. If this parameter is not passed in, it means no speed limit| +| transfer_mode | int | no |Transmission mode. 1 - Strict mode, 2 - Forced mode. Force mode is used by default| +| target_server | object | no | Target server, see server definition| +| callback_url | string | no | Callback URL, when the task execution is completed, the JOB will call this URL to inform the task execution result. Callback protocol refer to the callback_protocol component documentation| + +#### file_source +| Fields | Type | Required | Description | +|---------------|------------|--------|------------| +| file_list | array | yes |Multiple files are supported. If the file source type is a server file, fill in the absolute path array of the source file; If the file source type is a third-party file source, the path filled in by COS file source is "bucketName/file path," for example: testbucket/test.txt| +| account | object | yes |For file source account number, see account definition. It is required when the file source type is server file source, but not required when the file source type is third-party file source| +| server | object | no | Source file server, see server definition| +| file_type | int | no | File source type, 1: server file, 3: Third-party file source file. Default value is 1 if not transferred| +| file_source_id | int | no |File source ID. When file_type is 3, select one of file_source_id and file_source_code to fill in. If both are filled in, file_source_id, the third-party file source Id, is preferred, which can be obtained from the step details in the returned result of get_job_detail api| +| file_source_code| string | no |File source code. When file_type is 3, select one of file_source_id and file_source_code to fill in. If both of them are filled in, file_source_id, the third-party file source ID, is preferred. It can be obtained from the file distribution page> Select File source file pop-up box of the operation platform| + +#### account + +| Fields | Type | Required | Description | +| ------ | ------ | -------- | ------------------------------------------------------------ | +| id | long | no | Source execution account ID. When alias and id exist at the same time, id takes precedence. | +| alias | string | no | Source execution account alias. When alias and id exist at the same time, id takes precedence. | + +#### server + +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | + +#### ip_list + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_cloud_id | long | yes | BK-Net ID | +| ip | string | yes | IP Address | + +#### topo_node_list + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| id | long | yes |Dynamic topo node ID, corresponding to bk_inst_id in CMDB API| +| node_type | string | yes |Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module" and "set"| + +### Example of request +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "file_target_path": "/tmp/", + "transfer_mode": 1, + "file_source_list": [ + { + "file_list": [ + "/tmp/REGEX:[a-z]*.txt" + ], + "account": { + "id": 100 + }, + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "host_id_list": [ + 101, + 102 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + }, + "file_type": 1 + }, + { + "file_list": [ + "testbucket/test.txt" + ], + "file_type": 3, + "file_source_id": 1 + }, + { + "file_list": [ + "testbucket/test2.txt" + ], + "file_type": 3, + "file_source_code": "testInnerCOS" + } + ], + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "host_id_list": [ + 103, + 104 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + }, + "account_id": 101 +} +``` +### Example of responses +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API Quick Distribution File1521101427176", + "job_instance_id": 10000, + "step_instance_id": 10001 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| job_instance_id | long | Job instance ID| +| job_instance_name | long | Job instance name| +| step_instance_id | long | Step instance ID| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/generate_local_file_upload_url.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/generate_local_file_upload_url.md new file mode 100644 index 0000000000..0e76c96b7e --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/generate_local_file_upload_url.md @@ -0,0 +1,72 @@ +### Function Description + +Generate the local file upload URL. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| file_name_list | string [] | yes |List of file names to upload| + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "file_name_list": [ + "file1.txt", + "file2.txt" + ] +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "url_map": { + "file1.txt": { + "upload_url": "http://bkrepo.com/generic/temporary/upload/bkjob/localupload/1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file1.txt?token=30adf862fdce4b02b909e6a1a1c762c6", + "path": "1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file1.txt" + }, + "file2.txt": { + "upload_url": "http://bkrepo.com/generic/temporary/upload/bkjob/localupload/1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file2.txt?token=30adf862fdce4b02b909e6a1a1c762c6", + "path": "1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file2.txt" + } + } + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type |Whether the field must exist | Description | +|-----------|----------|---------------|---------| +| url_map | map | yes | key: file name passed in, value: Upload_url is the file upload address with credentials, and path is the path to the file distribution interface when distributing the file| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_account_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_account_list.md new file mode 100644 index 0000000000..a95cc678c3 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_account_list.md @@ -0,0 +1,94 @@ +### Function Description + +Query the list of executive accounts to which users have access under the business + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| category | int | no | Account usage (1: system account, 2: DB account)| +| start | int | no | Start position of paging record, default 0| +| length | int | no |The maximum number of records returned in a single time is 1000 at most, default 20| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "category": 1, + "start": 0, + "length": 1 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "message": null, + "result": true, + "data": { + "start": 0, + "total": 12, + "data": [ + { + "id": 70, + "account": "aaa", + "alias": "aaa", + "category": 1, + "type": 1, + "os": "Linux", + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "create_time": 1614659536108, + "last_modify_user": "admin", + "last_modify_time": 1614659536116 + } + ], + "length": 1 + }, + "request_id": "4e7acb216087eb96" +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data.data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| id | long | Account ID| +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| account | string | Account name| +| alias | string | Account alias| +| category | int | Account usage (1: system account, 2: DB account)| +| type | int | Account type (1: Linux, 2: Windows,9:MySQL,10: Oracle,11:DB2)| +| db_system_account_id | long | This field takes effect when the account usage is DB account, indicating the system account ID corresponding to DB account| +| os | string | This field takes effect when the account is used as a system account. The OS corresponding to the account| +| creator | string | creator| +| create_time | long | Creation time Unix timestamp (ms)| +| last_modify_user | string | Last modify user| +| last_modify_time | long | Last modified time Unix timestamp (ms)| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_cron_detail.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_cron_detail.md new file mode 100644 index 0000000000..bf6448bffc --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_cron_detail.md @@ -0,0 +1,147 @@ +### Function Description + +Query Cron job details + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|------------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| id | long | no | Cron Job ID | + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 1 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100, + "id": 1, + "name": "test", + "status": 1, + "expression": "0/5 * * * ?", + "global_var_list": [ + { + "id": 436, + "name": "ip", + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": [ + { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } + }, + { + "id": 437, + "name": "text", + "value": "new String value" + } + ], + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1577807999999 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data +| Fields | Type | Description | +|------------------|-----------|-----------| +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_plan_id | long | Job Plan ID | +| id | long | Cron job ID | +| name | string | Cron job name | +| status | int | Cron job status: 1. Started, 2. Paused | +| expression | string | Timing rules for Cron Job crontab, required when creating, optional when modifying. The meaning of each field is: minute hour day month week, for example: 0/5 * * * * ? means execute every 5 minutes | +| global_var_list | array | Global variable information| +| creator | string | Cron job creator| +| create_time | long | Creation time, Unix timestamp| +| last_modify_user | string | Cron job modifier| +| last_modify_time | long | Last modified time, Unix timestamp| + +#### global_var + +| Fields | Type | Description | +|-----------|-----------|------------| +| id | long | Global variable id, unique identification. If the id is empty, then name is used as the unique identification| +| name | string | Global variable name| +| value | string | Character, password, value of global variable of array type| +| server | object | Host type global variable value| + +#### server +| Fields | Type | Description | +|-----------------------|-------|------------| +| ip_list | array |Static IP list| +| dynamic_group_list | array |Dynamic grouping list| +| topo_node_list | array |Dynamic topo node list| + +#### ip + +| Fields | Type | Description | +|-------------|---------|---------| +| bk_cloud_id | int | BK-Net ID | +| ip | string | IP Address | + +#### topo_node +| Fields | Type | Description | +|------------------|--------|------------| +| id | long | Dynamic topo node ID, corresponding to bk_inst_id in CMDB API| +| node_type | string |Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module" and "set"| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_cron_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_cron_list.md new file mode 100644 index 0000000000..dc9d199cb0 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_cron_list.md @@ -0,0 +1,105 @@ +### Function Description + +Query information of cron jobs under business + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|------------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| name | string | no | Cron job name | +| id | long | no | Cron Job ID. If it exists, ignore other filtering criteria and only query the specified job information | +| status | int | no | Cron job status: 1. Started, 2. Paused | +| creator | string | no | Cron job creator | +| create_time_start | long | no | Creation time start, Unix timestamp| +| create_time_end | long | no |Create time end, Unix timestamp| +| last_modify_user | string | no | Job modifier | +| last_modify_time_start | long | no | Last modification time start, Unix timestamp| +| last_modify_time_end | long | no | Last modification time end, Unix timestamp| +| start | int | no | Start position of paging record, default 0| +| length | int | no | The maximum number of records returned in a single time is 1000 at most, default 20| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "test", + "id": 1000031, + "status": 1, + "creator": "admin", + "create_time_start": 1601371525, + "create_time_end": 1617285956, + "last_modify_user": "admin", + "last_modify_time_start": 1601371525, + "last_modify_time_end": 1617286227, + "start": 0, + "length": 1 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "start": 0, + "total": 8, + "data": [ + { + "id": 1000031, + "name": "test", + "status": 1, + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 1000193, + "expression": "* * * * * *", + "create_time": 1617285956, + "last_modify_user": "admin", + "last_modify_time": 1617286227 + } + ], + "length": 1 + }, + "request_id": "9720d3549c49a48a" +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data +| Fields | Type | Description | +|------------------|-----------|-----------| +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_plan_id | long | Job Plan ID | +| id | long | Cron job ID | +| name | string | Cron job name | +| status | int | Cron job status: 1. Started, 2. Paused | +| expression | string | Timing rules for Cron Job crontab, required when creating, optional when modifying. The meaning of each field is: minute hour day month week, for example: 0/5 * * * ? means execute every 5 minutes | +| creator | string | Job creator| +| create_time | long | Created time, Unix timestamp| +| last_modify_user | string | Job modifier | +| last_modify_time | long | Last modified time, Unix timestamp| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_global_var_value.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_global_var_value.md new file mode 100644 index 0000000000..3fcb3170be --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_global_var_value.md @@ -0,0 +1,136 @@ +### Function Description + +Gets the value of the job instance global variable + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_instance_id | long | yes |Job instance ID| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "job_instance_id": 100, + "step_instance_var_list": [ + { + "step_instance_id": 292778, + "global_var_list": [ + { + "name": "aa", + "value": "AA", + "type": 1 + }, + { + "name": "password", + "value": "mypassword", + "type": 4 + } + ] + }, + { + "step_instance_id": 292779, + "global_var_list": [ + { + "name": "aa", + "value": "AAAA", + "type": 1 + }, + { + "name": "password", + "value": "mypassword", + "type": 4 + } + ] + } + ] + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message returned by request failure| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| job_instance_id | long | Job instance ID| +| step_instance_var_list | array | Job step instance global variable value. See step_instance_var for definitions| + +#### step_instance_var + +| Fields | Type | Description | +| ---------------- | ----- | -------------------------------- | +| step_instance_id | long |Step instance ID | +| global_var_list | array |For global variable value list, see global_var for definition| + +#### global_var + +| Fields | Type | Required | Description | +| ------ | ------ | ---- | ---------------------------------------------------------- | +| id | long | no |Global variable id, unique identification. If the id is empty, then name is used as the unique identification| +| name | string | no |Global variable name | +| value | string | no | Values of global variables of String, Ciphertext, Namespace, and Array types | +| server | object | no |For the value of the host type global variable, see server definition | + +#### server + +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ----------------------------------- | +| ip_list | array | no | Static IP list, as defined in ip | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | For dynamic topo node list, see topo_node for definition| + +#### ip + +| Fields | Type | Required | Description | +| ----------- | ------ | -------- | ------------- | +| bk_cloud_id | int | yes | BK-Net ID | +| ip | string | yes | IP Address | + +#### dynamic_group + +| Fields | Type | Required | Description | +| ------ | ------ | -------- | -------------- | +| id | string | yes | CMDB dynamic grouping ID| + +#### topo_node + +| Fields | Type | Required | Description | +| --------- | ------ | -------- | ------------------------------------------------------------ | +| id | long | yes | Dynamic topo node ID, corresponding to bk_inst_id in CMDB API | +| node_type | string | yes | Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module" and "set"| \ No newline at end of file diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_ip_log.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_ip_log.md new file mode 100644 index 0000000000..ba1138351e --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_ip_log.md @@ -0,0 +1,144 @@ +### Function Description + +Query job execution log by host + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_instance_id | long | yes |Job instance ID| +| step_instance_id | long | yes |Step instance ID| +| bk_cloud_id | int | no |Target server BK-Net ID| +| ip | string | no |Destination server IP. ***Deprecated, it is recommended to use the bk_host_id parameter| +| bk_host_id | string | no | Host ID| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 50, + "step_instance_id": 100, + "bk_host_id": 101 +} +``` + +### Example of responses + +#### Script execution steps +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 1, + "bk_host_id": 101, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "log_content": "[2018-03-15 14:39:30][PID:56875] job_start\n" + } +} +``` + +#### File distribution steps + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 2, + "bk_host_id": 101, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "file_logs": [ + { + "mode": 1, + "src_ip": { + "host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "dest_ip": { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + "dest_path": "/tmp/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success" + }, + { + "mode": 0, + "src_ip": { + "bk_host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /data/1.log FileSize: 9.0 Bytes State: source agent success upload file Speed: 1 KB/s Progress: 100% StatusDesc: source agent success upload file Detail: success upload" + } + ] + } +} +``` + +**Return result description** + +- The file distribution log returns the file upload task log of the source server in addition to the file download task log of the target server (mode=0) +- Dest_ip corresponds to the bk_Cloud_id/IP of the request parameter + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Request success or failure. true: Request successful; false: Request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| bk_cloud_id | int | Target server cloud area ID | +| ip | string | Destination server IP address| +| log_type | int | Log type. 1 - Script execution task log; 2 - File distribution task log | +| log_content | string | Log content of job script output| +| file_logs | array | File distribution task log. See file_log for definition| + +#### file_log + +| Fields | Type | Description | +|-----------|-----------|-----------| +| mode | int | Distribution mode. 0: Upload; 1: Download | +| src_ip | object |File source host IP. see ip for definition | +| src_path | string | Source file paths | +| dest_ip | object | Distribute the target host IP, with value for mode=1. See ip for definition. | +| dest_path | string | Target path, with value for mode=1 | +| status | int | Task status. 1-Waiting; 2-Uploading; 3-Downloading; 4- Success; 5- Failure | +| log_content | string | File distribution log contents | + +#### ip + +| Fields | Type | Description | +|-----------|------------|--------| +| bk_cloud_id | long | BK-Net ID | +| ip | string | IP Address | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_list.md new file mode 100644 index 0000000000..da443c2910 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_list.md @@ -0,0 +1,111 @@ +### Function Description + +Query job instance list (execution history) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | ---- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| create_time_start | long | yes |Creation time start, Unix timestamp, in milliseconds | +| create_time_end | long | yes |Creation time end, Unix timestamp, in milliseconds | +| job_instance_id | long | no |Task instance ID. If job_instance_id is in or out, other query criteria are ignored | +| job_cron_id | long | no |Cron Job ID | +| operator | string | no |Executor, accurate match | +| name | string | no |Task name, fuzzy match | +| launch_mode | int | no |Launch mode. 1 - Web UI, 2 - API, 3 - Cron Job | +| type | int | no |Task type. 0 - Job Execution, 1 - Script Execution, 2 - File Transfer | +| status | int | no | Job status code. 1 - Pending; 2 - Running 3 - Successful; 4 - Failed; 5 - Skipped; 6 - Ignore Error; 7 - Waiting; 8 - Terminated; 9 - Abnormal; 10 - Terminating; 11 - Terminate Success; 13 - Termination Confirmed; 14 - Abandoned| +| ip | string | no |Execute target server IP for accurate matching | +| start | int | no |Start position of paging record, default 0 | +| length | int | no |The maximum number of records returned in a single time is 1000 at most, default 20 | + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "type": 0, + "launch_mode": 1, + "status": 3, + "operator": "admin", + "name": "test", + "create_time_start": 1546272000000, + "create_time_end": 1577807999999, + "start": 0, + "length": 20 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 100, + "job_template_id": 1, + "job_plan_id": 1, + "name": "test", + "operator": "admin", + "create_time": 1546272000000, + "start_time": 1546272000000, + "end_time": 1546272001000, + "total_time": 1000, + "launch_mode": 1, + "task_status": 3, + "task_type": 0 + } + ], + "start": 0, + "length": 20, + "total": 1 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +| --------------- | ------ | ------------------------------------------------------------ | +| bk_scope_type | string | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| id | long | Job Plan ID | +| job_template_id | long | Job Template ID, which has a value when the task is Job Plan | +| job_plan_id | long | Job Plan ID, which has a value when the task is a Job Plan | +| name | string |Task name | +| operator | string |Operator | +| create_time | long | Creation time, Unix timestamp, in milliseconds | +| status | int | Job status code. 1 - Pending; 2 - Running 3 - Successful; 4 - Failed; 5 - Skipped; 6 - Ignore Error; 7 - Waiting; 8 - Terminated; 9 - Abnormal; 10 - Terminating; 11 - Terminate Success; 13 - Termination Confirmed; 14 - Abandoned| +| type | int | Task type. 0 - Plan execution, 1 - Script execution, 2 - File distribution | +| launch_mode | int | Launch mode. 1 - Web UI, 2 - API, 3 - Cron Job | +| start_time | long | Task start time, Unix timestamp, in milliseconds | +| end_time | long | Task end time, Unix timestamp, in milliseconds | +| total_time | long | Task execution time, Unix timestamp, in milliseconds | \ No newline at end of file diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_status.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_status.md new file mode 100644 index 0000000000..c88f7f9654 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_instance_status.md @@ -0,0 +1,144 @@ +### Function Description + +Query job execution status based on job instance ID + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_instance_id | long | yes |Job instance ID| +| return_ip_result | boolean | no |Whether to return the task details on each ip corresponds to step_ip_result_list in the return result. The default value is false. | + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "finished": true, + "job_instance": { + "job_instance_id": 100, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "API Quick execution script1521089795887", + "create_time": 1605064271000, + "status": 4, + "start_time": 1605064271000, + "end_time": 1605064272000, + "total_time": 1000 + }, + "step_instance_list": [ + { + "status": 4, + "total_time": 1000, + "name": "API Quick execution scriptxxx", + "step_instance_id": 75, + "execute_count": 0, + "create_time": 1605064271000, + "end_time": 1605064272000, + "type": 1, + "start_time": 1605064271000, + "step_ip_result_list": [ + { + "bk_host_id": 101, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "status": 9, + "tag": "", + "exit_code": 0, + "error_code": 0, + "start_time": 1605064271000, + "end_time": 1605064272000, + "total_time": 1000 + } + ] + } + ] + } +} +``` +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| finished | bool | End job| +| job_instance | object | Job instance basic information. See job_instance definition| +| step_instance_list | array | List of job steps. See step_instance definition| + +#### job_instance + +| Fields | Type | Description | +|-----------|-----------|-----------| +| name | string | Job instance name| +| status | int | Job status code. 1 - Pending; 2 - Running 3 - Successful; 4 - Failed; 5 - Skipped; 6 - Ignore Error; 7 - Waiting; 8 - Terminated; 9 - Abnormal; 10 - Terminating; 11 - Terminate Success; 13 - Termination Confirmed; 14 - Abandoned| +| create_time | long | Job creation time, Unix timestamp, in milliseconds| +| start_time | long | Execution start time, Unix timestamp, in milliseconds| +| end_time | long | Execution end time, Unix timestamp, in milliseconds| +| total_time | int | Total elapsed time in milliseconds| +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_instance_id | long | Job instance ID| + +#### step_instance + +| Fields | Type | Description | +|-----------|-----------|-----------| +| step_instance_id | long | Job step instance ID| +| type | int | Step Type: 1. Script step; 2. File step; 4. SQL step| +| name | string | Step name| +| status | int | Step status code. 1 - Pending; 2 - Running 3 - Successful; 4 - Failed; 5 - Skipped; 6 - Ignore Error; 7 - Waiting; 8 - Terminated; 9 - Abnormal; 10 - Terminating; 11 - Terminate Success; 13 - Termination Confirmed; 14 - Abandoned| +| create_time | long | Job step instance creation time, Unix timestamp, in milliseconds| +| start_time | long |Execution start time, Unix timestamp, in milliseconds| +| end_time | long |Execution end time, Unix timestamp, in milliseconds| +| total_time | int |Total elapsed time in milliseconds| +| execute_count | int | Step retry times| +| step_ip_result_list | array | See step_ip_result for the task execution result of each host| + + +#### step_ip_result + +| Fields | Type | Description | +|-----------|-----------|-----------| +| bk_host_id | long | Host ID | +| ip | string | IP | +| bk_cloud_id | long | BK-Net ID | +| status | int | Agent task execution status: 1. Agent exception; Pending implementation Successful execution Failed to distribute the task; 404. Forced termination of task failed| +| tag | string |The user customizes the output results through the job_SUCCESS/job_fail function template. This parameter exists only for script tasks| +| exit_code | int |Script task exit code| +| error_code | int |Agent task status code, 1 - Agent exception; 5 - Waiting for execution; 7 - Executing; 9 - Execution succeeded; 11 - Execution failed; 12 - Task failed to deliver; 403 - Task forced termination succeeded; 404 - Task forced termination failed| +| start_time | long |Execution start time, Unix timestamp, in milliseconds| +| end_time | long |Execution end time, Unix timestamp, in milliseconds| +| total_time | int |Total elapsed time in milliseconds| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_plan_detail.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_plan_detail.md new file mode 100644 index 0000000000..4d06281ed8 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_plan_detail.md @@ -0,0 +1,311 @@ +### Function Description + +Check Job Plan details by Job Plan ID + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-------------|-------------|--------|--------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_plan_id | long | yes |Job Plan ID| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100 +} +``` + +### Example of responses +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100, + "name": "test", + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1577807999999, + "global_var_list": [ + { + "id": 11, + "type": 1, + "name": "varName", + "value": "value is Me", + "description": "hello", + "required": 1 + }, + { + "id": 12, + "type": 3, + "name": "servers", + "description": "", + "required": 0, + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": [ + { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } + } + ], + "step_list": [ + { + "id": 1059, + "type": 1, + "name": "run local script", + "script_info": { + "script_type": 1, + "script_timeout": 1000, + "script_content": "ZWNobyAkMSAkMiAkMw==", + "script_param": "YTEgYTIgYTM=", + "is_param_sensitive": 0, + "account": "root" + } + }, + { + "id": 1060, + "type": 1, + "name": "run cite script", + "script_info": { + "script_type": 2, + "script_id": "aaaaa-bbb-ccc-ddddd", + "script_version_id": 1078, + "script_timeout": 1000, + "script_param": "YTEgYTIgYTM=", + "is_param_sensitive": 1, + "account": "root" + } + }, + { + "id": 1061, + "type": 2, + "name": "xxx", + "file_info": { + "file_source": [ + { + "file_list": [ + "/tmp/REGEX:[a-z]*.txt" + ], + "server": { + "variable": "servers" + }, + "account": { + "id": 1, + "name": "root" + }, + "file_type": 1 + }, + { + "file_list": [ + "testbucket/test.txt" + ], + "file_type": 3, + "file_source_id": 1 + } + ], + "file_destination": { + "path": "/tmp/", + "account": { + "id": 1, + "name": "root" + }, + "server": { + "variable": "", + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": [ + { + "bk_host_id": 103, + "bk_cloud_id": 0, + "ip": "10.0.0.3" + }, + { + "bk_host_id": 104, + "bk_cloud_id": 0, + "ip": "10.0.0.4" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } + }, + "timeout": 60, + "transfer_mode": 1, + "upload_speed_limit": 1000, + "download_speed_limit": 1000 + } + } + ] + } +} +``` + + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|------------------|-----------|-----------| +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_plan_id | long | Job Plan ID | +| name | string | Job name| +| creator | string | Job creator account number| +| create_time | long | Creation time, Unix timestamp| +| last_modify_user | string | Job latest modifier | +| last_modify_time | long | Last modified time, Unix timestamp| +| step_list | array | Step object| +| global_var_list | array | Global variable information| + +#### step + +| Fields | Type | Description | +|-----------|-----------|-----------| +| id | long | Job step ID| +| name | string | Job step name| +| type | int | Step Type: 1. Script step; Manual confirmation step| +| script_info | object | Script information. This field is only available when type=1. | +| file_info | object | File transfer step information. This field is only available when type=2| + +#### script_info +| Fields | Type | Description | +|-----------|-----------|-----------| +| script_type | int | Script Type: 1 local Script 2 reference Script 3 public script| +| script_id | string | Script id. This field is only available when script_type=2,3. | +| script_version_id | long | Script version ID. This field is only available when script_type=2,3. | +| script_content | string | Script content. This field is only available when type=1. | +| script_language | int |Scripting languages: 1 byte shell, 2 byte bat, 3 byte Perl, 4 byte Python, 5 byte PowerShell, 6 byte SQL| +| script_param | string | Script parameter| +| script_timeout | int | Script timeout in seconds. Default 3600, value range 60-86400| +| is_param_sensitive | int | Sensitive parameter, 0. Not (default), 1. Yes.| +| account | object | Execution account name/alias| + +#### file_info +| Fields | Type | Description | +|----------------------|--------|-----------| +| file_source_list | array |Source file information| +| file_destination | object |Target information| +| timeout | int | File transfer timeout settings| +| transfer_mode | int | File transfer mode| +| upload_speed_limit | int | Upload speed limit| +| download_speed_limit | int | Download speed limit| + +#### global_var + +| Fields | Type | Description | +|-------------|-----------|------------| +| id | long | Global variable id. If the id is empty, then name is used as the unique identification| +| name | string | Global variable name| +| description | string | Global variable description| +| type | int | Global variable type| +| required | int | Is this variable required | +| value | string | Values of global variables of String, Ciphertext, Namespace, and Array types| +| server | object | Value of global variable of Host type| + +#### server +| Fields | Type | Description | +|-----------------------|-------|------------| +| variable | string |Referenced variable name| +| ip_list | array |Static IP list| +| dynamic_group_list | array |Dynamic group ID list| +| topo_node_list | array |Dynamic topo node list| + +#### ip +| Fields | Type | Description | +|-------------|---------|---------| +| bk_host_id | long | Host ID | +| bk_cloud_id | int | BK-Net ID | +| ip | string | IP Address | + +#### dynamic_group +| Fields | Type | Description | +|-----|---------|------------| +| id | string | Dynamic Group ID | + +#### topo_node +| Fields | Type | Description | +|------------------|--------|------------| +| id | long | Dynamic topo node ID, corresponding to bk_inst_id in CMDB API| +| node_type | string |Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module" and "set"| + +#### account +| Fields | Type | Required | Description | +|-------|--------|--------|------------| +| id | long | no | Account ID| +| name | string | no | Account name| + +#### file_source +| Fields | Type | Description | +|-----------------|---------|-----------| +| file_list | array | Absolute path array of source file, supporting multiple files| +| account | object |Execution account name/alias| +| server | object |Target server| +| file_type | int | File source type, 1: server file, 2: Local files, 3: third-party file source files| +| file_source_id | int | Third-party file source Id when file source type is third-party file source file| + +#### file_destination +| Fields | Type | Description | +|-----------------|---------|-----------| +| path | string |Path where the target file is stored| +| account | object |Execution account name/alias| +| server | object |Target server| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_plan_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_plan_list.md new file mode 100644 index 0000000000..168fb15d46 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_plan_list.md @@ -0,0 +1,100 @@ +### Function Description + +Search Job Plan list + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|------------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_template_id | long | no | Job template ID| +| creator | string | no | Job Plan creator | +| name | string | no |Job Plan name, fuzzy match| +| create_time_start | long | no | Creation time start, Unix timestamp| +| create_time_end | long | no | Creation time end, Unix timestamp| +| last_modify_user | string | no | Last modify user | +| last_modify_time_start | long | no | Last modification time start, Unix timestamp| +| last_modify_time_end | long | no | Last modification time end, Unix timestamp| +| start | int | no | Start position of paging record, default 0| +| length | int | no | The maximum number of records returned in a single time is 1000 at most, default 20| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_template_id": 1, + "creator": "admin", + "name": "test", + "create_time_start": 1546272000000, + "create_time_end": 1577807999999, + "last_modify_user": "admin", + "last_modify_time_start": 1546272000000, + "last_modify_time_end": 1577807999999, + "start": 0, + "length": 20 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 100, + "job_template_id": 1, + "name": "test", + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1546272000000 + } + ], + "start": 0, + "length": 20, + "total": 1 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|------------------|-----------|-----------| +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| id | long | Job Plan ID | +| job_template_id | long | Job Template ID | +| name | string | Job Plan name | +| creator | string | Creator account number| +| create_time | long | Creation time, Unix timestamp| +| last_modify_user | string | Modified by acct No.| +| last_modify_time | long | Last modified time, Unix timestamp| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_template_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_template_list.md new file mode 100644 index 0000000000..9a297fe77a --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_job_template_list.md @@ -0,0 +1,96 @@ +### Function Description + +Query job template list + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|------------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| creator | string | no | Job Plan creator account | +| name | string | no | Job Plan name, fuzzy match | +| create_time_start | long | no | Creation time start, Unix timestamp| +| create_time_end | long | no | Creation time end, Unix timestamp| +| last_modify_user | string | no | Last modify user| +| last_modify_time_start | long | no | Last modification time start, Unix timestamp| +| last_modify_time_end | long | no | Last modification time end, Unix timestamp| +| start | int | no | Start position of paging record, default 0| +| length | int | no |The maximum number of records returned in a single time is 1000 at most, default 20| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "creator": "admin", + "name": "test", + "create_time_start": 1546272000000, + "create_time_end": 1577807999999, + "last_modify_user": "admin", + "last_modify_time_start": 1546272000000, + "last_modify_time_end": 1577807999999, + "start": 0, + "length": 20 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 100, + "name": "test", + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1546272000000 + } + ], + "start": 0, + "length": 20, + "total": 1 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|------------------|-----------|-----------| +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| id | long | Job template ID| +| name | string | Job template name| +| creator | string | Creator account number| +| create_time | long | Creation time, Unix timestamp| +| last_modify_user | string | Modified by acct No.| +| last_modify_time | long | Last modified time, Unix timestamp| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_list.md new file mode 100644 index 0000000000..2b9d70403a --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_list.md @@ -0,0 +1,83 @@ +### Function Description + +Query public script list + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------------------|------------|--------|------------| +| name | string | no | Script name, supports fuzzy query| +| script_language | int | no | Scripting language. 1:shell,2:bat,3:perl,4:python,5:powershell,6:sql. | +| start | int | no | Start position of paging record, default 0| +| length | int | no | The maximum number of records returned in a single time is 1000 at most, default 20| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "name": "a.sh", + "script_language": 1, + "start": 0, + "length": 10 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": "000dbdddc06c453baf1f2decddf00c69", + "name": "a.sh", + "script_language": 1, + "public": false, + "online_script_version_id": 100, + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| id | string | Script ID| +| name | string | Script name| +| script_language | int | Scripting language. 1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - SQL | +| online_script_version_id | long | Online script version ID; null if the script does not have an online version| +| creator | string | Creator| +| create_time | long | Creation time Unix timestamp (ms)| +| last_modify_user| string | Last modify user| +| last_modify_time| long | Last modified time Unix timestamp (ms)| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_version_detail.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_version_detail.md new file mode 100644 index 0000000000..20d14aa7cf --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_version_detail.md @@ -0,0 +1,75 @@ +### Function Description + +Query public script version details + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------------------|------------|--------|------------| +| id | long | yes |Script version ID. If passed in, other conditions will be masked based on this condition| +| script_id | string | no | Script ID (can be passed in with version to locate a script version)| +| version | string | no | Script version (can be passed in with script_id to locate a script version)| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "id": 1 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": 1, + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "version description", + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| id | long | Script version ID| +| script_id | string | Script ID to which the script version belongs| +| version | string | Version| +| content | string | Script version content| +| status | int | Script version status (0: not online, 1: Online, 2: offline, 3: Disabled)| +| version_desc | string | Version description| +| creator | string | Creator| +| create_time | long | Creation time Unix timestamp (ms)| +| last_modify_user | string | Last modify user| +| last_modify_time | long | Last modified time Unix timestamp (ms)| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_version_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_version_list.md new file mode 100644 index 0000000000..26b5691bc2 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_version_list.md @@ -0,0 +1,86 @@ +### Function Description + +Query public script version list + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------------------|------------|--------|------------| +| script_id | string | yes |Script ID| +| return_script_content | bool | no | Whether the script content needs to be returned. True: returns script content; False: does not return script content. The default is false. | +| start | int | no | Start position of paging record, default 0| +| length | int | no | The maximum number of records returned in a single time is 1000 at most, default 20| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "return_script_content": true, + "start": 0, + "length": 10 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": 1, + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "version description", + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| id | long | Script version ID| +| script_id | string | Script ID to which the script version belongs| +| version | string | Version| +| content | string | Script content| +| status | int | Script version status (0: not online, 1: Online, 2: offline, 3: Disabled)| +| version_desc | string | Version description| +| creator | string | Creator| +| create_time | long | Creation time Unix timestamp (ms)| +| last_modify_user | string | Last modify user| +| last_modify_time | long | Last modified time Unix timestamp (ms)| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_script_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_script_list.md new file mode 100644 index 0000000000..64fda155ef --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_script_list.md @@ -0,0 +1,90 @@ +### Function Description + +Query business script list + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| name | string | no | Script name, supports fuzzy query| +| script_language | int | no | Scripting language. 0: all script types, 1: shell, 2: bat,3:perl,4: python,5:powershell,6: sql. Default 0| +| start | int | no | Start position of paging record, default 0| +| length | int | no | The maximum number of records returned in a single time is 1000 at most, default 20| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "a.sh", + "script_language": 1, + "start": 0, + "length": 10 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": "000dbdddc06c453baf1f2decddf00c69", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "a.sh", + "script_language": 1, + "online_script_version_id": 100, + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| id | string | Script ID| +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| name | string | Script name| +| script_language | int | Scripting language. 1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - SQL | +| online_script_version_id | long | Online script version ID; null if the script does not have an online version| +| creator | string | Creator| +| create_time | long | Creation time Unix timestamp (ms)| +| last_modify_user| string | Last modify user| +| last_modify_time| long | Last modified time Unix timestamp (ms)| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_script_version_detail.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_script_version_detail.md new file mode 100644 index 0000000000..754c4c8efb --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_script_version_detail.md @@ -0,0 +1,83 @@ +### Function Description + +Query business script version details + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| id | long | yes |Script version ID. If passed in, other conditions will be masked based on this condition| +| script_id | string | no | Script ID (can be passed in with version to locate a script version)| +| version | string | no | Script version (can be passed in with script_id to locate a script version)| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 1 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "version description", + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| id | long | Script version ID| +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | Script ID to which the script version belongs| +| version | string | Version| +| content | string | Script version content| +| status | int | Script version status (0: not online, 1: Online, 2: offline, 3: Disabled)| +| version_desc | string | Version description| +| creator | string | Creator| +| create_time | long | Creation time Unix timestamp (ms)| +| last_modify_user | string | Last modify user| +| last_modify_time | long | Last modified time Unix timestamp (ms)| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_script_version_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_script_version_list.md new file mode 100644 index 0000000000..06683d3415 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_script_version_list.md @@ -0,0 +1,94 @@ +### Function Description + +Query business script version list + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes |Script ID| +| return_script_content | bool | no | Whether the script content needs to be returned. True: returns script content; False: does not return script content. The default is false. | +| start | int | no | Start position of paging record, default 0| +| length | int | no | The maximum number of records returned in a single time is 1000 at most, default 20| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "return_script_content": true, + "start": 0, + "length": 10 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "version description", + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| id | long | Script version ID| +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | Script ID to which the script version belongs| +| version | string | Version| +| content | string | Script content| +| status | int | Script version status (0: not online, 1: Online, 2: offline, 3: Disabled)| +| version_desc | string | Version description| +| creator | string | Creator| +| create_time | long | Creation time Unix timestamp (ms)| +| last_modify_user | string | Last modify user| +| last_modify_time | long | Last modified time Unix timestamp (ms)| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/operate_job_instance.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/operate_job_instance.md new file mode 100644 index 0000000000..088ba8fe5b --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/operate_job_instance.md @@ -0,0 +1,61 @@ +### Function Description + +Use to perform actions on an executed job instance, such as terminating a job. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_instance_id | long | yes |Job instance ID| +| operation_code | int | yes |Operation Code: 1. Terminate job| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100, + "operation_code": 1 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_id": 100 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| job_instance_id | long | Job instance ID| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/operate_step_instance.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/operate_step_instance.md new file mode 100644 index 0000000000..0ca624eb23 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/operate_step_instance.md @@ -0,0 +1,78 @@ +### Function Description + +Used to perform actions on the steps of an executed instance, such as retry, ignore errors, and so on. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_instance_id | long | yes |Job instance ID| +| step_instance_id | long | yes |Step instance ID| +| operation_code | int | yes |Operation Code: 2. Retry failed IP; 3. Ignore error; 6. Confirm continue; 8. Retry all ; 9. Terminate the confirmation process; 10. Restart the confirmation; 11. Enter the next step; 12. Forcibly skip| + + +##### Operation_code details +| operation_code |Operation type| Applicable steps| Description| +|-----------|------------|--------|------------| +| 2 |Retry failed IP | Script execution, File transfer steps | Redistribute task to failed IP| +| 3 |Ignore error | Script execution, File transfer steps | Ignore error and continue | +| 6 |Confirmed | Manual confirmation step | Confirm to proceed | +| 8 |Retry all | Script execution, File transfer steps | Re-issue tasks to all IPS| +| 9 |Termination confirmation| Manual confirmation step | Confirm termination of execution | +| 10 |Re-initiate confirmation| Manual confirmation step | Re-initiate confirmation | +| 11 |Go to the next step. | Script execution, File transfer steps | If that state of the step is terminate successfully, the method is used for continue executing the subsequent steps| +| 12 |Forced skip | Script execution, File transfer steps | When the step status is terminated, it is used to forcibly skip the current step and execute the subsequent step| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100, + "step_instance_id": 200, + "operation_code": 2 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "step_instance_id": 200, + "job_instance_id": 100 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| job_instance_id | long | Job instance ID| +| step_instance_id | long | Step instance ID| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/publish_public_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/publish_public_script_version.md new file mode 100644 index 0000000000..81f2caf0df --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/publish_public_script_version.md @@ -0,0 +1,61 @@ +### Function Description + +After the public script version is launched, the previous online script will be set to offline status, but it will not affect the use of tasks. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------ | +| script_id | string | yes | Public script id | +| script_version_id | long | yes | Public script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000018 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000018, + "id": "4537fb49ec0840a1b91cef4179c99f9c", + "status": 2 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | string | Script id | +| script_version_id | long | Script version id | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/publish_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/publish_script_version.md new file mode 100644 index 0000000000..a0fa176a95 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/publish_script_version.md @@ -0,0 +1,65 @@ +### Function Description + +After the online script version is launched, the previous online script will be set to offline status, but it will not affect the use of homework. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| script_version_id | long | yes | Script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000019, + "id": "4a350b0e0707450e93326f6ace921072", + "status": 1 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | string | Script id | +| script_version_id | long | Script version id | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/push_config_file.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/push_config_file.md new file mode 100644 index 0000000000..644c858586 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/push_config_file.md @@ -0,0 +1,125 @@ +### Function Description + +Distribute configuration files, this interface is used to distribute small plain text files such as configuration files + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| task_name | string | no | Custom job name| +| account_alias | string | yes |Execute account alias| +| file_target_path | string | yes |File transfer destination path| +| file_list | array | yes |Source file object array, see file definition below| +| target_server | object | yes |Target server, see server definition | + +#### file + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| file_name | string | yes |File name| +| content | string | yes |File content Base64| + +#### server + +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | + + +#### ip + +| Fields | Type | Required | Description | +| ----------- | ------ | -------- | ------------- | +| bk_cloud_id | long | yes | BK-Net ID | +| ip | string | yes | IP Address | + +#### dynamic_group + +| Fields | Type | Required | Description | +| ------ | ------ | -------- | -------------- | +| id | string | yes | CMDB dynamic grouping ID| + +#### topo_node_list + +| Fields | Type | Required | Description | +| --------- | ------ | -------- | ------------------------------------------------------------ | +| id | long | yes | Dynamic topo node ID, corresponding to bk_inst_id in CMDB API | +| node_type | string | yes | Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module,""set"| + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "account_alias": "root", + "file_target_path": "/tmp/", + "file_list": [ + { + "file_name": "a.txt", + "content": "aGVsbG8gd29ybGQh" + } + ], + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "host_id_list": [ + 101, + 102 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API GSE PUSH FILE1521107826893", + "job_instance_id": 10000 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| job_instance_id | long | Job instance ID| +| job_instance_name | long | Job instance name| +| step_instance_id | long | Step instance ID| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/save_cron.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/save_cron.md new file mode 100644 index 0000000000..7de40b05e9 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/save_cron.md @@ -0,0 +1,381 @@ +### Function Description + +Create or update Cron Job; Create Cron Job, Cron Job status is paused by default, you can call update_cron_status interface to turn it on if needed. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_plan_id | long | yes |Job Plan ID of the job to be executed regularly| +| id | long | no | Cron Job ID, when updating a Cron Job, you must pass this value Cron Job | +| name | string | no | Cron job name, required for new creation and optional for modification | +| expression | string | no |Timing rules for Cron Job crontab, optional when modifying. The meaning of each field is: minute hour day month week, for example: 0/5 * * * * means execute every 5 minutes. caution: ? not supported. This field and execute_time cannot be empty at the same time when creating Cron Job | +| execute_time | long | no |Single execution execution time, Unix timestamp, this field and expression cannot be empty at the same time when creating Cron Job | +| global_var_list | array | no | Global variable information, you can use the Query Job Plan Details interface to query the variable information which can be set for the plan | + +#### global_var + +| Fields | Type | Required | Description | +|-----------|-----------|--------|------------| +| id | long | no | Global variable id, unique identification. If the id is empty, then name is used as the unique identification| +| name | string | no | Global variable name| +| value | string | no | Character, password, value of global variable of array type| +| server | object | no | The value of the host type global variable| + +#### server +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | + +#### ip + +| Fields | Type | Required | Description | +|-------------|---------|--------|---------| +| bk_cloud_id | int | yes | BK-Net ID | +| ip | string | yes | IP Address | + +#### topo_node +| Fields | Type | Required | Description | +|------------------|--------|--------|------------| +| id | long | yes |Dynamic topo node ID, corresponding to bk_inst_id in CMDB API| +| node_type | string | yes |Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module" and "set"| + + +### Example of request +#### 1. Create Cron Job +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxx", + "access_token": "xxx", + "bk_username": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "expression": "0 0/5 * * *", + "job_plan_id": 1023060, + "name": "test API", + "global_var_list": [ + { + "name": "stringVar", + "value": "value11112" + }, + { + "name": "nsVar", + "value": "nsvalue11112" + }, + { + "name": "secretVar", + "value": "secretvalue11112" + }, + { + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)" + }, + { + "name": "indexArrVar", + "value": "(2 3 4)" + }, + { + "name": "hostVar", + "server": { + "host_id_list": [1,2,3] + } + } + ] +} +``` +#### 2. Update Cron Job +```json +{ + "id": 1000064, + "bk_app_code": "xxx", + "bk_app_secret": "xxx", + "access_token": "xxx", + "bk_username": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "expression": "0 0/5 * * *", + "job_plan_id": 1023060, + "name": "test API", + "global_var_list": [ + { + "name": "stringVar", + "value": "value111333312" + }, + { + "name": "nsVar", + "value": "nsvalue111333312" + }, + { + "name": "secretVar", + "value": "secretvalue111333312" + }, + { + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)" + }, + { + "name": "indexArrVar", + "value": "(22 3 4)" + }, + { + "name": "hostVar", + "server": { + "host_id_list": [2,3,4] + } + } + ] +} +``` + +### Example of responses +#### 1. Create Cron Job +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000067, + "name": "test API", + "status": 2, + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 1023060, + "expression": "0 0/5 * * *", + "global_var_list": [ + { + "id": 1001101, + "name": "stringVar", + "value": "value11112", + "description": null, + "type": 1, + "required": null, + "server": null + }, + { + "id": 1001102, + "name": "nsVar", + "value": "nsvalue11112", + "description": null, + "type": 2, + "required": null, + "server": null + }, + { + "id": 1001104, + "name": "secretVar", + "value": "secretvalue11112", + "description": null, + "type": 4, + "required": null, + "server": null + }, + { + "id": 1001105, + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)", + "description": null, + "type": 5, + "required": null, + "server": null + }, + { + "id": 1001106, + "name": "indexArrVar", + "value": "(2 3 4)", + "description": null, + "type": 6, + "required": null, + "server": null + }, + { + "id": 1001103, + "name": "hostVar", + "value": null, + "description": null, + "type": 3, + "required": null, + "server": { + "ip_list": [ + { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ], + "dynamic_group_list": null, + "topo_node_list": null + } + } + ], + "create_time": 1642045370, + "last_modify_user": "admin", + "last_modify_time": 1642045370 + } +} +``` +#### 2. Update Cron Job +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000064, + "name": "test API", + "status": 2, + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 1023060, + "expression": "0 0/5 * * *", + "global_var_list": [ + { + "id": 1001101, + "name": "stringVar", + "value": "value111333312", + "description": null, + "type": 1, + "required": null, + "server": null + }, + { + "id": 1001102, + "name": "nsVar", + "value": "nsvalue111333312", + "description": null, + "type": 2, + "required": null, + "server": null + }, + { + "id": 1001104, + "name": "secretVar", + "value": "secretvalue111333312", + "description": null, + "type": 4, + "required": null, + "server": null + }, + { + "id": 1001105, + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)", + "description": null, + "type": 5, + "required": null, + "server": null + }, + { + "id": 1001106, + "name": "indexArrVar", + "value": "(22 3 4)", + "description": null, + "type": 6, + "required": null, + "server": null + }, + { + "id": 1001103, + "name": "hostVar", + "value": null, + "description": null, + "type": 3, + "required": null, + "server": { + "ip_list": [ + { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ], + "dynamic_group_list": null, + "topo_node_list": null + } + } + ], + "create_time": 1641990674, + "last_modify_user": "admin", + "last_modify_time": 1641995052 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------------|------------|-------------| +| id | long | Cron Job ID | +| name | string | Cron job name | +| status | int | Cron Job Status | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| job_plan_id | long | Job Plan ID of the job to be executed regularly | +| creator | string | Creator| +| create_time | long | Created time, Unix timestamp| +| last_modify_user | string | Last modify user| +| last_modify_time | long | Last modified time, Unix timestamp| +| expression | string | Timing rules for Cron Job crontab | +| execute_time | long | Execution time of a single Cron Job execution, Unix timestamp | +| global_var_list | array | For global variable information, see global_var| + +#### global_var + +| Fields | Type | Description | +|-------------|-----------|------------| +| id | long | Global variable id, unique identification. If the id is empty, then name is used as the unique identification| +| name | string | Global variable name| +| description | string | Global variable description| +| type | int | Global variable type| +| required | int | Whether the variable is required in the template/Job Plan | +| value | string | Character, password, value of global variable of array type| +| server | object | Host type global variable value| + +#### server +| Fields | Type | Description | +|-----------------------|-------|------------| +| variable | string |Referenced variable name| +| host_id_list | array | Host ID list | +| ip_list | array |Static IP list| +| dynamic_group_list | array |Dynamic group ID list| +| topo_node_list | array |Dynamic topo node list| + +#### ip +| Fields | Type | Description | +|-------------|---------|---------| +| bk_host_id | long | Host ID | +| bk_cloud_id | int | BK-Net ID | +| ip | string | IP Address | + +#### dynamic_group +| Fields | Type | Description | +|-----|---------|------------| +| id | string | Dynamic Group ID | + +#### topo_node +| Fields | Type | Description | +|------------------|--------|------------| +| id | long | Dynamic topo node ID, corresponding to bk_inst_id in CMDB API| +| node_type | string |Dynamic topo node type, corresponding to bk_obj_id in CMDB API, such as "module" and "set"| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_credential.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_credential.md new file mode 100644 index 0000000000..15957ceb0b --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_credential.md @@ -0,0 +1,72 @@ +### Function Description + +Update credentials. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| id | string | yes |Credential ID | +| name | string | no | Credential name | +| type | string | no | Credential type, which can be ACCESS_KEY_SECRET_KEY,PASSWORD,USERNAME_PASSWORD,SECRET_KEY| +| description | string | no | Credential description| +| credential_access_key | string | no | Required when the credential type is ACCESS_KEY_SECRET_KEY| +| credential_secret_key | string | no | Required when the credential type is ACCESS_KEY_SECRET_KEY/SECRET_KEY| +| credential_username | string | no | Required when the credential type is USERNAME_PASSWORD| +| credential_password | string | no | Required when the credential type is USERNAME_PASSWORD/PASSWORD| + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": "06644309e10e4068b3c7b32799668210", + "name": "testCredential", + "type": "USERNAME_PASSWORD", + "description": "This is a new credential", + "credential_username": "admin", + "credential_password": "newPassword" +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": "06644309e10e4068b3c7b32799668210" + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type |Whether the field must exist | Description | +|-----------|-------|---------------|---------| +| id | string |yes | Credential ID| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_cron_status.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_cron_status.md new file mode 100644 index 0000000000..9016a25958 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_cron_status.md @@ -0,0 +1,59 @@ +### Function Description + +Update Cron job status, such as started or paused + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|----------- |------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| id | long | yes |Cron job ID| +| status | int | yes |State, 1. Start, 2. Paused| + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 2, + "status": 1 +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": 2 +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type | Description | +|-----------|-----------|-----------| +| data | long | Cron Job ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_file_source.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_file_source.md new file mode 100644 index 0000000000..f82ff26c3c --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_file_source.md @@ -0,0 +1,79 @@ +### Function Description + +Update the file source. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| id | int | no | File source ID, at least one of which is required with code, and id preferred | +| code | string | no | At least one of the document source identification and id is required, and id preferred. It must start with English characters and consist of 1 32 English characters, underscores or numbers. It can not be changed after creation| +| alias | string | no | File source alias| +| type | string | no | File source type, currently only BlueKing Repository is supported, BLUEKING_ARTIFACTORY| +| access_params | object | no | File source access parameter. Different objects are passed in according to type. See subsequent description| +| credential_id | string | no | Credential Id used by the file source| +| file_prefix | string | no | The Job prefix is added to the file distributed from the file source. The default prefix is not added if it is not passed| + +### access_params +**When Type is BLUEKING_ARTIFACTORY** + +| Fields | Type | Required | Description | +|-----------------|------------|--------|------------| +| base_url | string | yes | The root url of the BlueKing Repository instance, for example: https://bkrepo.com | + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "code": "sopsArtifactory", + "alias": "SOPS_Artifactory", + "type": "BLUEKING_ARTIFACTORY", + "access_params": { + "base_url": "https://bkrepo.com" + }, + "credential_id": "06644309e10e4068b3c7b32799668210", + "file_prefix": "" +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": 1 + } +} +``` + +### Response Description + +#### response +| Fields | Type | Description | +|-----------|-----------|-----------| +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| +| code | int | Error code. 0 indicates success, >0 indicates failure| +| message | string |Error message| +| data | object |Data returned by request| +| permission | object |Permission information| +| request_id | string |Request chain id| + +#### data + +| Fields | Type |Whether the field must exist | Description | +|------------|--------|---------------|-----------| +| id | int | yes | File source ID| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_public_script_basic.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_public_script_basic.md new file mode 100644 index 0000000000..9be803c70e --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_public_script_basic.md @@ -0,0 +1,75 @@ +### Function Description + +Update basic information of public scripts + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------- | ------ | -------- | ------------------ | +| script_id | string | yes | Script id | +| name | string | yes | Script name | +| description | string | no | Script description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "description": "public script test" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "public_script": true, + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691740230000, + "description": "public script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ---------------- | ------ | ------------------------------------------------------------ | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | Public script or not | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| description | string | Description | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_public_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_public_script_version.md new file mode 100644 index 0000000000..7b0150e3dc --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_public_script_version.md @@ -0,0 +1,87 @@ +### Function Description + +Update public script version + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ----------------------------------------- | +| script_id | string | yes | Script id | +| script_version_id | long | yes | Script version id | +| content | string | yes | Script content, requiring Base64 encoding | +| version_desc | string | no | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000020, + "content": "IyEvYmluL2Jhc2gKbHM=", + "version_desc": "version 2" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000020, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "public_script": true, + "content": "IyEvYmluL2Jhc2gKbHM=", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691740290000, + "version": "1.0", + "version_desc": "version 2", + "status": 0, + "description": "public script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | Public script or not | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_script_basic .md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_script_basic .md new file mode 100644 index 0000000000..b741db195a --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_script_basic .md @@ -0,0 +1,82 @@ +### Function Description + +Update script basic information + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| name | string | yes | Script name | +| description | string | no | Script description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "public_script": false, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "creator": "admin", + "create_time": 1691743535000, + "last_modify_user": "admin", + "last_modify_time": 1691743715000, + "description": "script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ---------------- | ------ | ------------------------------------------------------------ | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | Public script or not | +| bk_scope_type | string | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| description | string | Description | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_script_version.md new file mode 100644 index 0000000000..5b82256e0c --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/en/update_script_version.md @@ -0,0 +1,95 @@ +### Function Description + +Update Script Version Information + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| script_version_id | long | yes | Script version id | +| content | string | yes | Script content, requiring Base64 encoding | +| version_desc | string | no | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019, + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version_desc": "version 1.0" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "public_script": false, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "creator": "admin", + "create_time": 1691741073000, + "last_modify_user": "admin", + "last_modify_time": 1691741313000, + "version": "1.0", + "version_desc": "version 1.0", + "status": 0, + "description": "script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | Public script or not | +| bk_scope_type | string | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/batch_get_job_instance_ip_log.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/batch_get_job_instance_ip_log.md new file mode 100644 index 0000000000..5c3be8e644 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/batch_get_job_instance_ip_log.md @@ -0,0 +1,166 @@ +### 功能描述 + +根据主机列表批量查询作业执行日志 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_instance_id | long | 是 | 作业实例ID | +| step_instance_id | long | 是 | 步骤实例ID | +| host_id_list | array | 否 | 主机ID列表 | +| ip_list | array | 否 | ***不推荐使用,建议使用host_id_list参数***;如果host_id_list与ip_list同时存在,将忽略ip_list参数。主机IP 列表,定义见ip | + + +##### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | int | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100, + "step_instance_id": 200, + "host_id_list": [ + 101,102 + ] +} +``` + +### 返回结果示例 + +#### 文件分发步骤 +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 2, + "task_instance_id": 100, + "step_instance_id": 200, + "file_task_logs": [ + { + "bk_host_id": 101, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "file_logs": [ + { + "mode": 1, + "src_ip": { + "bk_host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "dest_ip": { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + "dest_path": "/tmp/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success" + } + ] + }, + { + "ip": "10.0.0.2", + "bk_cloud_id": 0, + "file_logs": [ + { + "mode": 0, + "src_ip": { + "bk_host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /data/1.log FileSize: 9.0 Bytes State: source agent success upload file Speed: 1 KB/s Progress: 100% StatusDesc: source agent success upload file Detail: success upload" + } + ] + } + ] + } +} +``` + +**文件任务返回结果说明** + +- 如果需要返回文件源的上传日志,需要在ip_list添加源文件服务器IP + +### 返回结果说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| bk_host_id | long | 主机ID | +| bk_cloud_id | int | 目标服务器管控区域ID | +| ip | string | 目标服务器IP地址 | +| log_type | int | 日志类型。1-脚本执行任务日志;2-文件分发任务日志 | +| script_task_logs | array | 脚本执行任务日志。定义见script_task_log| +| file_task_logs | array | 文件分发任务日志。定义见file_task_log| + +#### script_task_log + +| 字段 | 类型 | 描述 | +|-----------|------------|--------| +| bk_host_id | long | 主机ID | +| bk_cloud_id | long | 管控区域ID | +| ip | string | 目标IP地址 | +| log_content | string | 脚本执行日志内容 | + +#### file_task_log + +| 字段 | 类型 | 描述 | +|-----------|------------|--------| +| bk_host_id | long | 主机ID | +| bk_cloud_id | long | 管控区域ID | +| ip | string | 源/目标IP地址 | +| file_logs | array | 文件分发日志内容。定义见file_log | + +#### file_log + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| mode | int | 分发模式。0:上传;1:下载| +| src_ip | object |文件源主机IP。定义见ip | +| src_path | string | 源文件路径 | +| dest_ip | object | 分发目标主机IP,mode=1时有值。定义见ip | +| dest_path | string | 目标路径,mode=1时有值 | +| status | int | 任务状态。1-等待开始;2-上传中;3-下载中;4-成功;5-失败 | +| log_content | string | 文件分发日志内容 | + +#### ip + +| 字段 | 类型 | 描述 | +|-----------|------------|--------| +| bk_host_id | long | 主机ID | +| bk_cloud_id | long | 管控区域ID | +| ip | string | IP地址 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/callback_protocol.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/callback_protocol.md new file mode 100644 index 0000000000..0d4949dbfc --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/callback_protocol.md @@ -0,0 +1,43 @@ +### 功能描述 + +此组件仅用于展示回调协议文档。 + +对作业执行类的请求传入的回调 callback_url 地址进行回调时所传递的报文结构描述。 + +### 请求参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|------------|--------|------------| +| job_instance_id | long | 是 | 作业实例ID | +| status | int | 是 | 作业状态码: 1.等待执行; 2.正在执行; 3.执行成功; 4.执行失败; 5.跳过; 6.忽略错误; 7.等待用户; 8.强制终止; 9.状态异常; 10.强制终止中; 11.强制终止成功,13.确认终止 | +| step_instance_list | array | 是 | 步骤块中包含的各个步骤执行状态 | + +#### step_instances + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|------------|--------|------------| +| step_instance_id | long | 是 | 作业步骤实例ID | +| status | int | 是 | 作业步骤状态码: 1.等待执行; 2.正在执行; 3.执行成功; 4.执行失败; 5.跳过; 6.忽略错误; 7.等待用户; 8.强制终止; 9.状态异常; 10.强制终止中; 11.强制终止成功,13.确认终止 | + +### 请求参数示例 + +```json +{ + "job_instance_id": 12345, + "status": 2, + "step_instance_list": [ + { + "step_instance_id": 16271, + "status": 3 + }, + { + "step_instance_id": 16272, + "status": 2 + } + ] +} +``` + +### 回调响应 + +回调成功以HTTP状态为准,如果成功,则状态码200,其他表示失败,Job会对失败的做一次重试,如还失败,则忽略失败,不再回调。 \ No newline at end of file diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/common.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/common.md new file mode 100644 index 0000000000..76f6c0b527 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/common.md @@ -0,0 +1,47 @@ +## 通用字段和约定 + +#### global_var + +| 字段 | 类型 | 必选 | 描述 | +|-------------|------------|--------|------------| +| id | long | 否 | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 否 | 全局变量名 | +| description | string | 否 | 全局变量描述 | +| type | int | 否 | 全局变量类型 | +| required | int | 否 | 变量是否必填 | +| value | string | 否 | 字符、密码、命名空间、数组类型的全局变量的值 | +| server | object | 否 | 主机类型全局变量的值 | + +#### server +| 字段 | 类型 | 必选 | 描述 | +|-----------------------|-------|--------|------------| +| host_id_list | array | 否 | 主机ID列表 | +| ip_list | array | 否 | ***不推荐使用,建议使用host_id_list参数***;如果host_id_list与ip_list同时存在,将忽略ip_list参数。主机IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +#### ip +| 字段 | 类型 | 必选 | 描述 | +|-------------|---------|--------|---------| +| bk_host_id | long | 是 | 主机ID | +| bk_cloud_id | int | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +#### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +#### topo_node + +| 字段 | 类型 | 必选 | 描述 | +|------------------|--------|--------|------------| +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| + +#### account +| 字段 | 类型 | 必选 | 描述 | +|-------|--------|--------|------------| +| id | long | 否 | 账号 ID | +| name | string | 否 | 账号名 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_credential.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_credential.md new file mode 100644 index 0000000000..61a2e8d86f --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_credential.md @@ -0,0 +1,70 @@ +### 功能描述 + +新建凭据。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| name | string | 是 | 凭据名称 | +| type | string | 是 | 凭据类型,取值可为ACCESS_KEY_SECRET_KEY,PASSWORD,USERNAME_PASSWORD,SECRET_KEY | +| description | string | 否 | 凭据描述 | +| credential_access_key | string | 否 | 凭据类型为ACCESS_KEY_SECRET_KEY时填写 | +| credential_secret_key | string | 否 | 凭据类型为ACCESS_KEY_SECRET_KEY/SECRET_KEY时填写 | +| credential_username | string | 否 | 凭据类型为USERNAME_PASSWORD时填写 | +| credential_password | string | 否 | 凭据类型为USERNAME_PASSWORD/PASSWORD时填写 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "testCredential", + "type": "USERNAME_PASSWORD", + "description": "This is a test credential", + "credential_username": "admin", + "credential_password": "password" +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": "06644309e10e4068b3c7b32799668210" + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 |字段是否一定存在 | 描述 | +|-----------|-------|---------------|---------| +| id | string |是 | 凭据ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_file_source.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_file_source.md new file mode 100644 index 0000000000..7e9da62c9f --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_file_source.md @@ -0,0 +1,87 @@ +### 功能描述 + +新建文件源,当前仅支持创建关联自动选择公共接入点的蓝鲸制品库文件源。 +创建的文件源具备以下默认特性: + +| 特性 | 取值 | +|-----------------|------------| +|存储类型|对象存储| +|文件源类型|蓝鲸制品库| +|是否为公共文件源|否| +|接入点选择范围|公共接入点| +|接入点选择模式|自动| + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| code | string | 是 | 文件源标识,英文字符开头,1-32位英文字符、下划线、数字组成,创建后不可更改 | +| alias | string | 是 | 文件源别名 | +| type | string | 是 | 文件源类型,当前仅支持蓝鲸制品库,BLUEKING_ARTIFACTORY | +| access_params | object | 是 | 文件源接入参数,根据type传入不同的对象,见后续说明 | +| credential_id | string | 否 | 文件源使用的凭据Id | +| file_prefix | string | 否 | Job对从该文件源分发的文件加上的前缀,不传默认不加前缀 | + +### access_params +**type为BLUEKING_ARTIFACTORY** + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|------------|--------|------------| +| base_url | string | 是 | 对接的制品库实例根地址,例如:https://bkrepo.com | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "code": "sopsArtifactory", + "alias": "标准运维制品库文件源", + "type": "BLUEKING_ARTIFACTORY", + "access_params": { + "base_url": "https://bkrepo.com" + }, + "credential_id": "06644309e10e4068b3c7b32799668210", + "file_prefix": "" +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": 1 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 |字段是否一定存在 | 描述 | +|-----------|-------|---------------|---------| +| id | int |是 | 文件源ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_public_script.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_public_script.md new file mode 100644 index 0000000000..d79dd57334 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_public_script.md @@ -0,0 +1,89 @@ +### 功能描述 + +新建公共脚本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------------- | ------ | ---- | ------------------------------------------------------------ | +| name | string | 是 | 公共脚本名称 | +| description | string | 否 | 公共脚本描述 | +| script_language | int | 是 | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | 是 | 脚本内容,需Base64编码 | +| version | string | 是 | 版本号 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "name": "public script test", + "description": "public script test", + "script_language": "1", + "content": "IyEvYmluL2Jhc2gKbHM=", + "version": "1.0" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000018, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "public_script": true, + "content": "IyEvYmluL2Jhc2gKbHM=", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691739630000, + "version": "1.0", + "status": 0, + "description": "public script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | 公共脚本版本ID | +| script_id | string | 公共脚本ID | +| name | string | 公共脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | 是否公共脚本 | +| content | string | 公共脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 公共脚本版本 | +| version_desc | string | 公共脚本版本描述 | +| status | int | 公共脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 公共脚本描述 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_public_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_public_script_version.md new file mode 100644 index 0000000000..5513ee391a --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_public_script_version.md @@ -0,0 +1,87 @@ +### 功能描述 + +新建公共脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ------------ | ------ | ---- | ---------------------- | +| script_id | string | 是 | 公共脚本ID | +| content | string | 是 | 脚本内容,需Base64编码 | +| version | string | 是 | 版本号 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "content": "IyEvYmluL2Jhc2gKbHM=", + "version": "2.0", + "version_desc": "version 2" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000020, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "public_script": true, + "content": "IyEvYmluL2Jhc2gKbHM=", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691739630000, + "version": "1.0", + "version_desc": "version 2", + "status": 0, + "description": "public script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | 公共脚本版本ID | +| script_id | string | 公共脚本ID | +| name | string | 公共脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | 是否公共脚本 | +| content | string | 公共脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 公共脚本版本 | +| version_desc | string | 公共脚本版本描述 | +| status | int | 公共脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 公共脚本描述 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_script.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_script.md new file mode 100644 index 0000000000..6020e643a3 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_script.md @@ -0,0 +1,98 @@ +### 功能描述 + +新建脚本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------------- | ------ | ---- | ------------------------------------------------------------ | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| name | string | 是 | 脚本名称 | +| description | string | 否 | 脚本描述 | +| script_language | int | 是 | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | 是 | 脚本内容,需Base64编码 | +| version | string | 是 | 版本号 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "name": "script test", + "description": "script test", + "script_language": "1", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version": "1.0" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "public_script": false, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "creator": "admin", + "create_time": 1691741073000, + "last_modify_user": "admin", + "last_modify_time": 1691741073000, + "version": "1.0", + "status": 0, + "description": "script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | 脚本版本ID | +| script_id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell | +| public_script | bool | 是否公共脚本 | +| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| content | string | 脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 脚本版本 | +| version_desc | string | 版本描述 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 脚本描述 | + diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_script_version.md new file mode 100644 index 0000000000..368e0bd8ab --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_script_version.md @@ -0,0 +1,95 @@ +### 功能描述 + +新建脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| content | string | 是 | 脚本内容,需Base64编码 | +| version | string | 是 | 版本号 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version": "2.0", + "version_desc": "version 2" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000021, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "public_script": false, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "creator": "admin", + "create_time": 1691743535000, + "last_modify_user": "admin", + "last_modify_time": 1691743535000, + "version": "2.0", + "version_desc": "version 2", + "status": 0, + "description": "script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | 脚本版本ID | +| script_id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | 是否公共脚本 | +| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| content | string | 脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 脚本版本 | +| version_desc | string | 版本描述 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 脚本描述 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_public_script.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_public_script.md new file mode 100644 index 0000000000..92528e1d25 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_public_script.md @@ -0,0 +1,50 @@ +### 功能描述 + +删除公共脚本,同时会删除该脚本下的所有的脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ------ | ---- | ---------- | +| script_id | string | 是 | 公共脚本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +无 diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_public_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_public_script_version.md new file mode 100644 index 0000000000..14eae102f1 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_public_script_version.md @@ -0,0 +1,52 @@ +### 功能描述 + +删除公共脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | -------------- | +| script_id | string | 是 | 公共脚本ID | +| script_version_id | long | 是 | 公共脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": "1000017" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +无 diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_script.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_script.md new file mode 100644 index 0000000000..baf0122066 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_script.md @@ -0,0 +1,54 @@ +### 功能描述 + +删除脚本,同时会删除该脚本下的所有的脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | long | 是 | 脚本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +无 diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_script_version.md new file mode 100644 index 0000000000..d2cfdc4960 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/delete_script_version.md @@ -0,0 +1,56 @@ +### 功能描述 + +删除脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| script_version_id | long | 是 | 脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +无 diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/disable_public_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/disable_public_script_version.md new file mode 100644 index 0000000000..8313d717d6 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/disable_public_script_version.md @@ -0,0 +1,61 @@ +### 功能描述 + +禁用公共脚本版本,一旦禁用成功,不可恢复!且线上引用该版本的作业步骤都会无法执行,请务必谨慎操作。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | -------------- | +| script_id | string | 是 | 公共脚本ID | +| script_version_id | long | 是 | 公共脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000018 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000018, + "id": "4537fb49ec0840a1b91cef4179c99f9c", + "status": 3 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | string | 脚本ID | +| script_version_id | long | 脚本版本ID | +| status | int | 脚本版本当前状态(0:未上线,1:已上线,2:已下线,3:已禁用) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/disable_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/disable_script_version.md new file mode 100644 index 0000000000..0f05ea4287 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/disable_script_version.md @@ -0,0 +1,65 @@ +### 功能描述 + +禁用脚本版本,一旦禁用成功,不可恢复!且线上引用该版本的作业步骤都会无法执行,请务必谨慎操作。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| script_version_id | long | 是 | 脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000019, + "id": "4a350b0e0707450e93326f6ace921072", + "status": 3 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | string | 脚本ID | +| script_version_id | long | 脚本版本ID | +| status | int | 脚本版本当前状态(0:未上线,1:已上线,2:已下线,3:已禁用) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/execute_job_plan.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/execute_job_plan.md new file mode 100644 index 0000000000..1b41069642 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/execute_job_plan.md @@ -0,0 +1,127 @@ +### 功能描述 + +启动作业执行方案 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 是 | 作业执行方案ID | +| global_var_list | array | 否 | 全局变量。对于作业执行方案中的全局变量值,如果请求参数中包含该变量,则使用传入的变量值;否则使用执行方案当前已配置的默认值。定义见global_var | +| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 | + +#### global_var + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| id | long | 否 | 全局变量id,唯一标识。如果id为空,那么使用name作为唯一标识 | +| name | string | 否 | 全局变量name | +| value | string | 否 | 字符、密码、数组、命名空间类型的全局变量的值 | +| server | object | 否 | 主机类型全局变量的值,见server定义 | + +#### server + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ----------------------------------- | +| host_id_list | array | 否 | 主机ID列表 | +| ip_list | array | 否 | ***不推荐使用,建议使用host_id_list参数***;如果host_id_list与ip_list同时存在,将忽略ip_list参数。主机IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +#### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | int | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +#### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +#### topo_node + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set" | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100, + "global_var_list": [ + { + "id": 436, + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "host_id_list": [ + 101, + 102 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } + }, + { + "name": "param_name", + "value": "param_value" + } + ] +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "Test", + "job_instance_id": 10000 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| job_instance_name | long | 作业实例名称 | + diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/fast_execute_script.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/fast_execute_script.md new file mode 100644 index 0000000000..415c4708c8 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/fast_execute_script.md @@ -0,0 +1,125 @@ +### 功能描述 + +快速执行脚本 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|---------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_version_id | long | 否 | 脚本版本ID。当script_version_id不为空的时候,使用script_version_id对应的脚本版本 | +| script_id | string | 否 | 脚本ID。当传入script_id,且script_version_id为空的时候,使用脚本的上线版本 | +| script_content | string | 否 | 脚本内容Base64。如果不存在script_version_id和script_id,那么使用script_content。优先级:script_version_id>script_id>script_content | +| task_name | string | 否 | 自定义作业名称 | +| script_param | string | 否 | 脚本参数Base64。注意:如果有多个参数,比如"param1 param2"这种,需要对"param1 param2"整体进行base64编码,而不是对每个参数进行base64编码再拼接起来 | +| timeout | long | 否 | 脚本执行超时时间,秒。默认7200,取值范围1-86400 | +| account_alias | string | 否 | 执行账号别名。与account_id必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | +| account_id | long | 否 | 执行账号ID。与account_alias必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | +| is_param_sensitive | int | 否 | 敏感参数将会在执行详情页面上隐藏, 0:不是(默认),1:是 | +| script_language | int | 否 | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell。当使用script_content传入自定义脚本的时候,需要指定script_language | +| target_server | object | 否 | 目标服务器,见server定义 | +| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 | + +#### server + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ------------------------------------------------------------ | +| host_id_list | array | 否 | 主机ID列表 | +| ip_list | array | 否 | ***不推荐使用,建议使用host_id_list参数***。主机IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +#### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | long | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +#### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +#### topo_node_list + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_version_id": 1, + "script_content": "ZWNobyAkMQ==", + "script_param": "aGVsbG8=", + "timeout": 1000, + "account_id": 1000, + "is_param_sensitive": 0, + "script_language": 1, + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "host_id_list": [ + 101, + 102 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API Quick execution script1521100521303", + "job_instance_id": 10000, + "step_instance_id": 10001 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| job_instance_name | long | 作业实例名称 | +| step_instance_id | long | 步骤实例ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/fast_execute_sql.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/fast_execute_sql.md new file mode 100644 index 0000000000..373cb79966 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/fast_execute_sql.md @@ -0,0 +1,115 @@ +### 功能描述 + +快速执行SQL脚本 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|---------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_version_id | long | 否 | SQL脚本版本ID | +| script_id | string | 否 | 脚本ID。当传入script_id,且script_version_id为空的时候,使用当前脚本的上线版本 | +| script_content | string | 否 | 脚本内容Base64。如果不存在script_version_id和script_id,那么使用script_content。优先级:script_version_id>script_id>script_content | +| timeout | int | 否 | 脚本超时时间,秒。默认7200,取值范围1-86400 | +| db_account_id | long | 是 | SQL执行的db账号ID,必填, 从账号管理-DB账号处获得。 | +| target_server | object | 否 | 目标服务器,见server定义 | +| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 | + +#### server + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ------------------------------------------------------------ | +| host_id_list | array | 否 | 主机ID列表 | +| ip_list | array | 否 | ***不推荐使用,建议使用host_id_list参数***。主机IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +#### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | long | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +#### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +#### topo_node_list + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set" | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_version_id": 1, + "timeout": 1000, + "db_account_id": 32, + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "host_id_list": [ + 101, + 102 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API Quick SQL Execution1524454292038", + "job_instance_id": 10000, + "step_instance_id": 10001 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| job_instance_name | long | 作业实例名称 | +| step_instance_id | long | 步骤实例ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/fast_transfer_file.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/fast_transfer_file.md new file mode 100644 index 0000000000..816bffce67 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/fast_transfer_file.md @@ -0,0 +1,172 @@ +### 功能描述 +快速分发文件 + +### 请求参数 +{{ common_args_desc }} + +#### 接口参数 +| 字段 | 类型 |
必选
| 描述 | +|------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| account_alias | string | 否 | 目标执行账号别名,可从账号页面获取,推荐使用。与account_id必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | +| account_id | long | 否 | 目标执行账号ID,可从get_account_list接口获取。与account_alias必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | +| file_target_path | string | 是 | 文件传输目标路径 | +| file_source_list | array | 是 | 源文件对象数组,见下面file_source定义 | +| timeout | int | 否 | 任务超时时间,秒,默认值为7200。取值范围1-86400。| +| download_speed_limit| int | 否 | 下载限速,单位MB。如果未传入该参数,表示不限速| +| upload_speed_limit| int | 否 | 上传限速,单位MB。如果未传入该参数,表示不限速| +| transfer_mode | int | 否 | 传输模式。1-严谨模式,2-强制模式。默认使用强制模式 | +| target_server | object | 否 | 目标服务器,见server定义 | +| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 | + +#### file_source +| 字段 | 类型 |
必选
| 描述 | +|---------------|------------|--------|------------| +| file_list | array | 是 | 支持多个文件,若文件源类型为服务器文件,填写源文件的绝对路径数组;若文件源类型为第三方文件源,COS文件源填写的路径为"bucket名称/文件路径",例如:testbucket/test.txt | +| account | object | 是 | 文件源账号,见account定义,文件源类型为服务器文件源时必填,文件源类型为第三方文件源时无需填写 | +| server | object | 否 | 源文件服务器,见server定义 | +| file_type | int | 否 | 文件源类型,1:服务器文件,3:第三方文件源文件,不传默认为1 | +| file_source_id | int | 否 | file_type为3时,file_source_id与file_source_code选择一个填写,若都填写,优先使用file_source_id,第三方文件源Id,可从get_job_detail接口返回结果中的步骤详情获取 | +| file_source_code| string | 否 | file_type为3时,file_source_id与file_source_code选择一个填写,若都填写,优先使用file_source_id,第三方文件源标识,可从作业平台的文件分发页面->选择文件源文件弹框中获取 | + +#### account + +| 字段 | 类型 | 必选 | 描述 | +| ----- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 否 | 源执行账号ID,可从get_account_list接口获取。与alias必须存在一个。当同时存在alias和id时,id优先。 | +| alias | string | 否 | 源执行账号别名,可从账号页面获取,推荐使用。与alias必须存在一个。当同时存在alias和id时,id优先。 | + +#### server + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ------------------------------------------------------------ | +| host_id_list | array | 否 | 主机ID列表 | +| ip_list | array | 否 | ***不推荐使用,建议使用host_id_list参数***。主机IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +#### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | long | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +#### topo_node_list + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| + +### 请求参数示例 +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "file_target_path": "/tmp/", + "transfer_mode": 1, + "file_source_list": [ + { + "file_list": [ + "/tmp/REGEX:[a-z]*.txt" + ], + "account": { + "id": 100 + }, + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "host_id_list": [ + 101, + 102 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + }, + "file_type": 1 + }, + { + "file_list": [ + "testbucket/test.txt" + ], + "file_type": 3, + "file_source_id": 1 + }, + { + "file_list": [ + "testbucket/test2.txt" + ], + "file_type": 3, + "file_source_code": "testInnerCOS" + } + ], + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "host_id_list": [ + 103, + 104 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + }, + "account_id": 101 +} +``` +### 返回结果示例 +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API Quick Distribution File1521101427176", + "job_instance_id": 10000, + "step_instance_id": 10001 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| job_instance_name | long | 作业实例名称 | +| step_instance_id | long | 步骤实例ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/generate_local_file_upload_url.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/generate_local_file_upload_url.md new file mode 100644 index 0000000000..84f49cacdd --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/generate_local_file_upload_url.md @@ -0,0 +1,72 @@ +### 功能描述 + +生成本地文件上传URL。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| file_name_list | string[] | 是 | 要上传的文件名列表 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "file_name_list": [ + "file1.txt", + "file2.txt" + ] +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "url_map": { + "file1.txt": { + "upload_url": "http://bkrepo.com/generic/temporary/upload/bkjob/localupload/1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file1.txt?token=30adf862fdce4b02b909e6a1a1c762c6", + "path": "1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file1.txt" + }, + "file2.txt": { + "upload_url": "http://bkrepo.com/generic/temporary/upload/bkjob/localupload/1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file2.txt?token=30adf862fdce4b02b909e6a1a1c762c6", + "path": "1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file2.txt" + } + } + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 |字段是否一定存在 | 描述 | +|-----------|----------|---------------|---------| +| url_map | map | 是 | key:传入的文件名,value:upload_url为带凭据的文件上传地址,path为分发该文件时要传给文件分发接口的路径 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_account_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_account_list.md new file mode 100644 index 0000000000..99909205a6 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_account_list.md @@ -0,0 +1,94 @@ +### 功能描述 + +查询业务下用户有权限的执行账号列表 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| category | int | 否 | 账号用途(1:系统账号,2:DB账号),不传则不区分 | +| start | int | 否 | 分页记录起始位置,不传默认为0 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "category": 1, + "start": 0, + "length": 1 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "message": null, + "result": true, + "data": { + "start": 0, + "total": 12, + "data": [ + { + "id": 70, + "account": "aaa", + "alias": "aaa", + "category": 1, + "type": 1, + "os": "Linux", + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "create_time": 1614659536108, + "last_modify_user": "admin", + "last_modify_time": 1614659536116 + } + ], + "length": 1 + }, + "request_id": "4e7acb216087eb96" +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data.data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 账号ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| account | string | 账号名称 | +| alias | string | 账号别名 | +| category | int | 账号用途(1:系统账号,2:DB账号) | +| type | int | 账号类型(1:Linux,2:Windows,9:MySQL,10:Oracle,11:DB2)| +| db_system_account_id | long | 账号用途为DB账号时该字段生效,表示DB账号对应的系统账号ID | +| os | string | 账号用途为系统账号时该字段生效,账号对应的OS | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_cron_detail.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_cron_detail.md new file mode 100644 index 0000000000..8f0ec145b8 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_cron_detail.md @@ -0,0 +1,148 @@ +### 功能描述 + +查询定时作业详情 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | long | 否 | 定时任务 ID | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 1 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100, + "id": 1, + "name": "test", + "status": 1, + "expression": "0/5 * * * ?", + "global_var_list": [ + { + "id": 436, + "name": "ip", + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": [ + { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } + }, + { + "id": 437, + "name": "text", + "value": "new String value" + } + ], + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1577807999999 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data +| 字段 | 类型 | 描述 | +|------------------|-----------|-----------| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 执行方案 ID | +| id | long | 定时作业 ID | +| name | string | 定时作业名称 | +| status | int | 定时作业状态:1.已启动、2.已暂停 | +| expression | string | 定时任务crontab的定时规则,新建时必填,修改时选填。各字段含义为:分 时 日 月 周,如: 0/5 * * * ? 表示每5分钟执行一次 | +| global_var_list | array | 全局变量信息 | +| creator | string | 作业创建人账号 | +| create_time | long | 创建时间,Unix 时间戳 | +| last_modify_user | string | 作业修改人账号 | +| last_modify_time | long | 最后修改时间,Unix 时间戳 | + +#### global_var + +| 字段 | 类型 | 描述 | +|-----------|-----------|------------| +| id | long | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 全局变量 name | +| value | string | 字符、密码、数组类型的全局变量的值 | +| server | object | 主机类型全局变量的值 | + +#### server +| 字段 | 类型 | 描述 | +|-----------------------|-------|------------| +| ip_list | array | 静态 IP 列表 | +| dynamic_group_list | array | 动态分组 列表 | +| topo_node_list | array | 动态 topo 节点列表 | + +#### ip + +| 字段 | 类型 | 描述 | +|-------------|---------|---------| +| bk_host_id | long | 主机ID | +| bk_cloud_id | int | 管控区域ID | +| ip | string | IP地址 | + +#### topo_node +| 字段 | 类型 | 描述 | +|------------------|--------|------------| +| id | long | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_cron_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_cron_list.md new file mode 100644 index 0000000000..e34d2a4797 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_cron_list.md @@ -0,0 +1,105 @@ +### 功能描述 + +查询业务下定时作业信息 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| name | string | 否 | 定时作业名称 | +| id | long | 否 | 定时任务 ID,如果存在则忽略其他筛选条件,只查询这个指定的作业信息 | +| status | int | 否 | 定时作业状态:1.已启动、2.已暂停 | +| creator | string | 否 | 定时作业创建人账号 | +| create_time_start | long | 否 | 创建起始时间,Unix 时间戳(s) | +| create_time_end | long | 否 | 创建结束时间,Unix 时间戳(s) | +| last_modify_user | string | 否 | 作业修改人账号 | +| last_modify_time_start | long | 否 | 最后修改起始时间,Unix 时间戳(s) | +| last_modify_time_end | long | 否 | 最后修改结束时间,Unix 时间戳(s) | +| start | int | 否 | 默认 0 表示从第 1 条记录开始返回 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "test", + "id": 1000031, + "status": 1, + "creator": "admin", + "create_time_start": 1601371525, + "create_time_end": 1617285956, + "last_modify_user": "admin", + "last_modify_time_start": 1601371525, + "last_modify_time_end": 1617286227, + "start": 0, + "length": 1 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "start": 0, + "total": 8, + "data": [ + { + "id": 1000031, + "name": "test", + "status": 1, + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 1000193, + "expression": "* * * * * *", + "create_time": 1617285956, + "last_modify_user": "admin", + "last_modify_time": 1617286227 + } + ], + "length": 1 + }, + "request_id": "9720d3549c49a48a" +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data +| 字段 | 类型 | 描述 | +|------------------|-----------|-----------| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 执行方案 ID | +| id | long | 定时作业 ID | +| name | string | 定时作业名称 | +| status | int | 定时作业状态:1.已启动、2.已暂停 | +| expression | string | 定时任务crontab的定时规则,新建时必填,修改时选填。各字段含义为:分 时 日 月 周,如: 0/5 * * * ? 表示每5分钟执行一次 | +| creator | string | 作业创建人账号 | +| create_time | long | 创建时间,Unix 时间戳(s) | +| last_modify_user | string | 作业修改人账号 | +| last_modify_time | long | 最后修改时间,Unix 时间戳(s) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_global_var_value.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_global_var_value.md new file mode 100644 index 0000000000..a44aa87b39 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_global_var_value.md @@ -0,0 +1,136 @@ +### 功能描述 + +获取作业实例全局变量的值 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_instance_id | long | 是 | 作业实例ID | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "job_instance_id": 100, + "step_instance_var_list": [ + { + "step_instance_id": 292778, + "global_var_list": [ + { + "name": "aa", + "value": "AA", + "type": 1 + }, + { + "name": "password", + "value": "mypassword", + "type": 4 + } + ] + }, + { + "step_instance_id": 292779, + "global_var_list": [ + { + "name": "aa", + "value": "AAAA", + "type": 1 + }, + { + "name": "password", + "value": "mypassword", + "type": 4 + } + ] + } + ] + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| step_instance_var_list | array | 作业步骤实例全局变量值。定义见step_instance_var | + +#### step_instance_var + +| 字段 | 类型 | 描述 | +| ---------------- | ----- | -------------------------------- | +| step_instance_id | long | 步骤实例ID | +| global_var_list | array | 全局变量值列表,定义见global_var | + +#### global_var + +| 字段 | 类型 | 必选 | 描述 | +| ------ | ------ | ---- | ---------------------------------------------------------- | +| id | long | 否 | 全局变量id,唯一标识。如果id为空,那么使用name作为唯一标识 | +| name | string | 否 | 全局变量name | +| value | string | 否 | 字符、密码、数组类型的全局变量的值 | +| server | object | 否 | 主机类型全局变量的值,见server定义 | + +#### server + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ----------------------------------- | +| ip_list | array | 否 | 静态 IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + +#### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_host_id | long | 主机ID | +| bk_cloud_id | int | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +#### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +#### topo_node + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set" | \ No newline at end of file diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_ip_log.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_ip_log.md new file mode 100644 index 0000000000..f24d3cb8e5 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_ip_log.md @@ -0,0 +1,145 @@ +### 功能描述 + +根据主机查询作业执行日志 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_instance_id | long | 是 | 作业实例ID | +| step_instance_id | long | 是 | 步骤实例ID | +| bk_host_id | long | 否 | 目标主机host_id | +| bk_cloud_id | int | 否 | ***不推荐使用,建议使用host_id参数,如果存在bk_host_id将忽略该参数***。目标服务器管控区域ID | +| ip | string | 否 | ***不推荐使用,建议使用host_id参数,如果存在bk_host_id将忽略该参数***。目标主机IP | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 50, + "step_instance_id": 100, + "bk_host_id": 101 +} +``` + +### 返回结果示例 + +#### 脚本执行步骤 +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 1, + "bk_host_id": 101, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "log_content": "[2018-03-15 14:39:30][PID:56875] job_start\n" + } +} +``` + +#### 文件分发步骤 + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 2, + "bk_host_id": 101, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "file_logs": [ + { + "mode": 1, + "src_ip": { + "host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "dest_ip": { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + "dest_path": "/tmp/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success" + }, + { + "mode": 0, + "src_ip": { + "bk_host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + }, + "src_path": "/data/1.log", + "status": 4, + "log_content": "[2021-06-28 11:32:16] FileName: /data/1.log FileSize: 9.0 Bytes State: source agent success upload file Speed: 1 KB/s Progress: 100% StatusDesc: source agent success upload file Detail: success upload" + } + ] + } +} +``` + +**返回结果说明** + +- 文件分发日志,除了目标服务器的文件下载任务日志,也会返回源服务器的文件上传任务日志(mode=0) +- dest_ip 与请求参数的bk_cloud_id/ip对应 + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| bk_host_id | long | 主机ID | +| bk_cloud_id | int | 目标服务器管控区域ID | +| ip | string | 目标服务器IP地址 | +| log_type | int | 日志类型。1-脚本执行任务日志;2-文件分发任务日志 | +| log_content | string | 作业脚本输出的日志内容 | +| file_logs | array | 文件分发任务日志。定义见file_log| + +#### file_log + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| mode | 分发模式 | 0:上传;1:下载| +| src_ip | object |文件源主机,定义见host | +| src_path | string | 源文件路径 | +| dest_ip | object | 分发目标主机,mode=1时有值。定义见host | +| dest_path | string | 目标路径,mode=1时有值 | +| status | int | 任务状态。1-等待开始;2-上传中;3-下载中;4-成功;5-失败 | +| log_content | string | 文件分发日志内容 | + +#### Host + +| 字段 | 类型 | 描述 | +|-----------|------------|--------| +| bk_host_id | long | 主机ID | +| bk_cloud_id | long | 管控区域ID | +| ip | string | IP地址 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_list.md new file mode 100644 index 0000000000..e1680166cf --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_list.md @@ -0,0 +1,111 @@ +### 功能描述 + +查询作业实例列表(执行历史) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ------------------------------------------------------------ | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| create_time_start | long | 是 | 创建起始时间,Unix 时间戳,单位毫秒 | +| create_time_end | long | 是 | 创建结束时间,Unix 时间戳,单位毫秒 | +| job_instance_id | long | 否 | 任务实例ID。 如果出入job_instance_id,将忽略其他查询条件 | +| job_cron_id | long | 否 | 定时任务ID | +| operator | string | 否 | 执行人,精准匹配 | +| name | string | 否 | 任务名称,模糊匹配 | +| launch_mode | int | 否 | 执行方式。1 - 页面执行,2 - API调用,3 - 定时执行 | +| type | int | 否 | 任务类型。0 - 作业执行,1 - 脚本执行,2 - 文件分发 | +| status | int | 否 | 任务状态。1 - 等待执行,2 - 正在执行,3 - 执行成功,4 - 执行失败,7 - 等待确认,10 - 强制终止中,11 - 强制终止成功,13 - 确认终止 | +| ip | string | 否 | 执行目标服务器IP, 精准匹配 | +| start | int | 否 | 默认0表示从第1条记录开始返回 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "type": 0, + "launch_mode": 1, + "status": 3, + "operator": "admin", + "name": "test", + "create_time_start": 1546272000000, + "create_time_end": 1577807999999, + "start": 0, + "length": 20 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 100, + "job_template_id": 1, + "job_plan_id": 1, + "name": "test", + "operator": "admin", + "create_time": 1546272000000, + "start_time": 1546272000000, + "end_time": 1546272001000, + "total_time": 1000, + "launch_mode": 1, + "task_status": 3, + "task_type": 0 + } + ], + "start": 0, + "length": 20, + "total": 1 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +| --------------- | ------ | ------------------------------------------------------------ | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | long | 执行方案 ID | +| job_template_id | long | 作业模版 ID,当任务为执行方案的时候有值 | +| job_plan_id | long | 作业执行方案 ID,当任务为执行方案的时候有值 | +| name | string | 任务名称 | +| operator | string | 操作者 | +| create_time | long | 创建时间,Unix 时间戳,单位毫秒 | +| status | int | 任务状态。1 - 等待执行,2 - 正在执行,3 - 执行成功,4 - 执行失败,7 - 等待确认,10 - 强制终止中,11 - 强制终止成功,13 - 确认终止 | +| type | int | 任务类型。0 - 作业执行,1 - 脚本执行,2 - 文件分发 | +| launch_mode | int | 执行方式。1 - 页面执行,2 - API调用,3 - 定时执行 | +| start_time | long | 任务启动时间,Unix 时间戳,单位毫秒 | +| end_time | long | 任务结束时间,Unix 时间戳,单位毫秒 | +| total_time | long | 任务执行时间,Unix 时间戳,单位毫秒 | \ No newline at end of file diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_status.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_status.md new file mode 100644 index 0000000000..2b80c25b7d --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_instance_status.md @@ -0,0 +1,143 @@ +### 功能描述 + +根据作业实例 ID 查询作业执行状态 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_instance_id | long | 是 | 作业实例ID | +| return_ip_result | boolean | 否 | 是否返回每个主机上的任务详情,对应返回结果中的step_ip_result_list。默认值为false。 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "finished": true, + "job_instance": { + "job_instance_id": 100, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "API Quick execution script1521089795887", + "create_time": 1605064271000, + "status": 4, + "start_time": 1605064271000, + "end_time": 1605064272000, + "total_time": 1000 + }, + "step_instance_list": [ + { + "status": 4, + "total_time": 1000, + "name": "API Quick execution scriptxxx", + "step_instance_id": 75, + "execute_count": 0, + "create_time": 1605064271000, + "end_time": 1605064272000, + "type": 1, + "start_time": 1605064271000, + "step_ip_result_list": [ + { + "bk_host_id": 101, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "status": 9, + "tag": "", + "exit_code": 0, + "error_code": 0, + "start_time": 1605064271000, + "end_time": 1605064272000, + "total_time": 1000 + } + ] + } + ] + } +} +``` +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| finished | bool | 作业是否结束 | +| job_instance | object | 作业实例基本信息。见job_instance定义 | +| step_instance_list | array | 作业步骤列表。见step_instance定义 | + +#### job_instance + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| name | string | 作业实例名称 | +| status | int | 作业状态码: 1.未执行; 2.正在执行; 3.执行成功; 4.执行失败; 5.跳过; 6.忽略错误; 7.等待用户; 8.手动结束; 9.状态异常; 10.步骤强制终止中; 11.步骤强制终止成功 | +| create_time | long | 作业创建时间,Unix时间戳,单位毫秒 | +| start_time | long | 开始执行时间,Unix时间戳,单位毫秒 | +| end_time | long | 执行结束时间,Unix时间戳,单位毫秒 | +| total_time | int | 总耗时,单位毫秒 | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_instance_id | long | 作业实例ID | + +#### step_instance + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| step_instance_id | long | 作业步骤实例ID | +| type | int | 步骤类型:1.脚本步骤; 2.文件步骤; 4.SQL步骤 | +| name | string | 步骤名称 | +| status | int | 作业步骤状态码: 1.未执行; 2.正在执行; 3.执行成功; 4.执行失败; 5.跳过; 6.忽略错误; 7.等待用户; 8.手动结束; 9.状态异常; 10.步骤强制终止中; 11.步骤强制终止成功; 12.步骤强制终止失败 | +| create_time | long | 作业步骤实例创建时间,Unix时间戳,单位毫秒 | +| start_time | long | 开始执行时间,Unix时间戳,单位毫秒 | +| end_time | long | 执行结束时间,Unix时间戳,单位毫秒 | +| total_time | int | 总耗时,单位毫秒 | +| execute_count | int | 步骤重试次数 | +| step_ip_result_list | array | 每个主机的任务执行结果,定义见step_ip_result | + + +#### step_ip_result + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| bk_host_id | long | 主机ID | +| ip | string | IP | +| bk_cloud_id | long | 管控区域ID | +| status | int | 作业执行状态:1.Agent异常; 5.等待执行; 7.正在执行; 9.执行成功; 11.执行失败; 12.任务下发失败; 403.任务强制终止成功; 404.任务强制终止失败 | +| tag | string | 用户通过job_success/job_fail函数模板自定义输出的结果。仅脚本任务存在该参数 | +| exit_code | int | 脚本任务exit code | +| error_code | int | 主机任务状态码,1.Agent异常; 3.上次已成功; 5.等待执行; 7.正在执行; 9.执行成功; 11.任务失败; 12.任务下发失败; 13.任务超时; 15.任务日志错误; 101.脚本执行失败; 102.脚本执行超时; 103.脚本执行被终止; 104.脚本返回码非零; 202.文件传输失败; 203.源文件不存在; 310.Agent异常; 311.用户名不存在; 320.文件获取失败; 321.文件超出限制; 329.文件传输错误; 399.任务执行出错 | +| start_time | long | 开始执行时间,Unix时间戳,单位毫秒 | +| end_time | long | 执行结束时间,Unix时间戳,单位毫秒 | +| total_time | int | 总耗时,单位毫秒 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_plan_detail.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_plan_detail.md new file mode 100644 index 0000000000..f7bbba5eb7 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_plan_detail.md @@ -0,0 +1,310 @@ +### 功能描述 + +根据作业执行方案 ID 查询作业执行方案详情 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-------------|-------------|--------|--------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 是 | 作业执行方案 ID | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100 +} +``` + +### 返回结果示例 +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 100, + "name": "test", + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1577807999999, + "global_var_list": [ + { + "id": 11, + "type": 1, + "name": "varName", + "value": "value is Me", + "description": "hello", + "required": 1 + }, + { + "id": 12, + "type": 3, + "name": "servers", + "description": "", + "required": 0, + "server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": [ + { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_host_id": 102, + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } + } + ], + "step_list": [ + { + "id": 1059, + "type": 1, + "name": "run local script", + "script_info": { + "script_type": 1, + "script_timeout": 1000, + "script_content": "ZWNobyAkMSAkMiAkMw==", + "script_param": "YTEgYTIgYTM=", + "is_param_sensitive": 0, + "account": "root" + } + }, + { + "id": 1060, + "type": 1, + "name": "run cite script", + "script_info": { + "script_type": 2, + "script_id": "aaaaa-bbb-ccc-ddddd", + "script_version_id": 1078, + "script_timeout": 1000, + "script_param": "YTEgYTIgYTM=", + "is_param_sensitive": 1, + "account": "root" + } + }, + { + "id": 1061, + "type": 2, + "name": "xxx", + "file_info": { + "file_source": [ + { + "file_list": [ + "/tmp/REGEX:[a-z]*.txt" + ], + "server": { + "variable": "servers" + }, + "account": { + "id": 1, + "name": "root" + }, + "file_type": 1 + }, + { + "file_list": [ + "testbucket/test.txt" + ], + "file_type": 3, + "file_source_id": 1 + } + ], + "file_destination": { + "path": "/tmp/", + "account": { + "id": 1, + "name": "root" + }, + "server": { + "variable": "", + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + }, + { + "id": "blo8gojho0sabc7priuy" + } + ], + "ip_list": [ + { + "bk_host_id": 103, + "bk_cloud_id": 0, + "ip": "10.0.0.3" + }, + { + "bk_host_id": 104, + "bk_cloud_id": 0, + "ip": "10.0.0.4" + } + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } + }, + "timeout": 60, + "transfer_mode": 1, + "upload_speed_limit": 1000, + "download_speed_limit": 1000 + } + } + ] + } +} +``` + + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|------------------|-----------|-----------| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 执行方案 ID | +| name | string | 作业名称 | +| creator | string | 作业创建人账号 | +| create_time | long | 创建时间,Unix 时间戳 | +| last_modify_user | string | 作业修改人账号 | +| last_modify_time | long | 最后修改时间,Unix 时间戳 | +| step_list | array | 步骤对象 | +| global_var_list | array | 全局变量信息 | + +#### step + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 作业步骤ID | +| name | string | 作业步骤名称 | +| type | int | 步骤类型:1.脚本步骤; 2.文件步骤; 3.人工确认步骤 | +| script_info | object | 脚本信息。当 type=1 时才有这个字段。 | +| file_info | object | 文件传输步骤信息。当 type=2 时才有这个字段 | + +#### script_info +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| script_type | int | 脚本类型:1 本地脚本 2 引用脚本 3 公共脚本 | +| script_id | string | 脚本 ID。当 script_type=2,3 时才有这个字段。 | +| script_version_id | long | 脚本版本 ID。当 script_type=2,3 时才有这个字段。 | +| script_content | string | 脚本内容。当 type=1 时才有这个字段。 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - SQL | +| script_param | string | 脚本参数 | +| script_timeout | int | 脚本超时时间,秒。默认3600,取值范围60-86400 | +| is_param_sensitive | int | 是否敏感参数, 0.不是(默认),1.是。| +| account | object | 执行账号名/别名 | + +#### file_info +| 字段 | 类型 | 描述 | +|----------------------|--------|-----------| +| file_source_list | array | 源文件信息 | +| file_destination | object | 目标信息 | +| timeout | int | 文件传输超时设置 | +| transfer_mode | int | 文件传输模式 | +| upload_speed_limit | int | 上传限速 | +| download_speed_limit | int | 下载限速 | + +#### global_var + +| 字段 | 类型 | 描述 | +|-------------|-----------|------------| +| id | long | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 全局变量名 | +| description | string | 全局变量描述 | +| type | int | 全局变量类型 | +| required | int | 模版/执行方案中该变量是否必填 | +| value | string | 字符、密码、数组类型的全局变量的值 | +| server | object | 主机类型全局变量的值 | + +#### server +| 字段 | 类型 | 描述 | +|-----------------------|-------|------------| +| variable | string | 引用的变量名 | +| ip_list | array | 静态 IP 列表 | +| dynamic_group_list | array | 动态分组 ID 列表 | +| topo_node_list | array | 动态 topo 节点列表 | + +#### ip +| 字段 | 类型 | 描述 | +|-------------|---------|---------| +| bk_host_id | long | 主机ID | +| bk_cloud_id | int | 管控区域ID | +| ip | string | IP地址 | + +#### dynamic_group +| 字段 | 类型 | 描述 | +|-----|---------|------------| +| id | string | 动态分组 ID | + +#### topo_node +| 字段 | 类型 | 描述 | +|------------------|--------|------------| +| id | long | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| + +#### account +| 字段 | 类型 | 必选 | 描述 | +|-------|--------|--------|------------| +| id | long | 否 | 账号 ID | +| name | string | 否 | 账号名 | + +#### file_source +| 字段 | 类型 | 描述 | +|-----------------|---------|-----------| +| file_list | array | 源文件的绝对路径数组,支持多个文件 | +| account | object | 执行账号名/别名 | +| server | object | 目标服务器 | +| file_type | int | 文件源类型,1:服务器文件,2:本地文件,3:第三方文件源文件 | +| file_source_id | int | 文件源类型为第三方文件源文件时的第三方文件源Id | + +#### file_destination +| 字段 | 类型 | 描述 | +|-----------------|---------|-----------| +| path | string | 目标文件存放的路径 | +| account | object | 执行账号名/别名| +| server | object | 目标服务器 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_plan_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_plan_list.md new file mode 100644 index 0000000000..b8f174c7a4 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_plan_list.md @@ -0,0 +1,99 @@ +### 功能描述 + +查询执行方案列表 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_template_id | long | 否 | 作业模版 ID | +| creator | string | 否 | 作业执行方案创建人账号 | +| name | string | 否 | 作业执行方案名称,模糊匹配 | +| create_time_start | long | 否 | 创建起始时间,Unix 时间戳 | +| create_time_end | long | 否 | 创建结束时间,Unix 时间戳 | +| last_modify_user | string | 否 | 作业执行方案修改人账号 | +| last_modify_time_start | long | 否 | 最后修改起始时间,Unix 时间戳 | +| last_modify_time_end | long | 否 | 最后修改结束时间,Unix 时间戳 | +| start | int | 否 | 默认0表示从第1条记录开始返回 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_template_id": 1, + "creator": "admin", + "name": "test", + "create_time_start": 1546272000000, + "create_time_end": 1577807999999, + "last_modify_user": "admin", + "last_modify_time_start": 1546272000000, + "last_modify_time_end": 1577807999999, + "start": 0, + "length": 20 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 100, + "job_template_id": 1, + "name": "test", + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1546272000000 + } + ], + "start": 0, + "length": 20, + "total": 1 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|------------------|-----------|-----------| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | long | 执行方案 ID | +| job_template_id | long | 作业模版 ID | +| name | string | 执行方案名称 | +| creator | string | 创建人账号 | +| create_time | long | 创建时间,Unix 时间戳 | +| last_modify_user | string | 修改人账号 | +| last_modify_time | long | 最后修改时间,Unix 时间戳 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_template_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_template_list.md new file mode 100644 index 0000000000..ca97a90963 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_job_template_list.md @@ -0,0 +1,95 @@ +### 功能描述 + +查询作业模版列表 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| creator | string | 否 | 作业执行方案创建人账号 | +| name | string | 否 | 作业执行方案名称,模糊匹配 | +| create_time_start | long | 否 | 创建起始时间,Unix 时间戳 | +| create_time_end | long | 否 | 创建结束时间,Unix 时间戳 | +| last_modify_user | string | 否 | 作业执行方案修改人账号 | +| last_modify_time_start | long | 否 | 最后修改起始时间,Unix 时间戳 | +| last_modify_time_end | long | 否 | 最后修改结束时间,Unix 时间戳 | +| start | int | 否 | 默认0表示从第1条记录开始返回 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "creator": "admin", + "name": "test", + "create_time_start": 1546272000000, + "create_time_end": 1577807999999, + "last_modify_user": "admin", + "last_modify_time_start": 1546272000000, + "last_modify_time_end": 1577807999999, + "start": 0, + "length": 20 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 100, + "name": "test", + "creator": "admin", + "create_time": 1546272000000, + "last_modify_user": "admin", + "last_modify_time": 1546272000000 + } + ], + "start": 0, + "length": 20, + "total": 1 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|------------------|-----------|-----------| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | long | 作业模版 ID | +| name | string | 作业模版名称 | +| creator | string | 创建人账号 | +| create_time | long | 创建时间,Unix 时间戳 | +| last_modify_user | string | 修改人账号 | +| last_modify_time | long | 最后修改时间,Unix 时间戳 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_public_script_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_public_script_list.md new file mode 100644 index 0000000000..07bc0781c8 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_public_script_list.md @@ -0,0 +1,82 @@ +### 功能描述 + +查询公共脚本列表 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| name | string | 否 | 脚本名称,支持模糊查询 | +| script_language | int | 否 | 脚本语言。1:shell,2:bat,3:perl,4:python,5:powershell,6:sql。如果不传,默认返回所有脚本语言 | +| start | int | 否 | 分页记录起始位置,不传默认为0 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "name": "a.sh", + "script_language": 1, + "start": 0, + "length": 10 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": "000dbdddc06c453baf1f2decddf00c69", + "name": "a.sh", + "script_language": 1, + "public": false, + "online_script_version_id": 100, + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言。1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - SQL | +| online_script_version_id | long | 已上线脚本版本ID;如果脚本没有已上线版本,该值为空 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user| string | 最近一次修改人 | +| last_modify_time| long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_public_script_version_detail.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_public_script_version_detail.md new file mode 100644 index 0000000000..3d7ff55431 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_public_script_version_detail.md @@ -0,0 +1,75 @@ +### 功能描述 + +查询公共脚本版本详情 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| id | long | 是 | 脚本版本ID,若传入则以此条件为准屏蔽其他条件 | +| script_id | string | 否 | 脚本ID(可与version一起传入定位某个脚本版本) | +| version | string | 否 | 脚本版本(可与script_id一起传入定位某个脚本版本) | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "id": 1 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": 1, + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "版本描述", + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 脚本版本ID | +| script_id | string | 脚本版本所属的脚本ID | +| version | string | 版本号 | +| content | string | 脚本版本内容 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| version_desc | string | 版本描述 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_public_script_version_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_public_script_version_list.md new file mode 100644 index 0000000000..d94e992c02 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_public_script_version_list.md @@ -0,0 +1,86 @@ +### 功能描述 + +查询公共脚本版本列表 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| script_id | string | 是 | 脚本ID | +| return_script_content | bool | 否 | 是否需要返回脚本内容。true:返回脚本内容;false:不返回脚本内容。默认为false。 | +| start | int | 否 | 分页记录起始位置,不传默认为0 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "return_script_content": true, + "start": 0, + "length": 10 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": 1, + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "版本描述", + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 脚本版本ID | +| script_id | string | 脚本版本所属的脚本ID | +| version | string | 版本号 | +| content | string | 脚本内容 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| version_desc | string | 版本描述 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_script_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_script_list.md new file mode 100644 index 0000000000..be669e0bbe --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_script_list.md @@ -0,0 +1,90 @@ +### 功能描述 + +查询业务脚本列表 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| name | string | 否 | 脚本名称,支持模糊查询 | +| script_language | int | 否 | 脚本语言。0:所有脚本类型,1:shell,2:bat,3:perl,4:python,5:powershell,6:sql。默认值为0 | +| start | int | 否 | 分页记录起始位置,不传默认为0 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "脚本1", + "script_language": 1, + "start": 0, + "length": 10 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": "000dbdddc06c453baf1f2decddf00c69", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "name": "a.sh", + "script_language": 1, + "online_script_version_id": 100, + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | string | 脚本ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言。1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - SQL | +| online_script_version_id | long | 已上线脚本版本ID;如果脚本没有已上线版本,该值为空 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user| string | 最近一次修改人 | +| last_modify_time| long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_script_version_detail.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_script_version_detail.md new file mode 100644 index 0000000000..ca831aba6d --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_script_version_detail.md @@ -0,0 +1,83 @@ +### 功能描述 + +查询业务脚本版本详情 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | long | 是 | 脚本版本ID,若传入则以此条件为准屏蔽其他条件 | +| script_id | string | 否 | 脚本ID(可与version一起传入定位某个脚本版本) | +| version | string | 否 | 脚本版本(可与script_id一起传入定位某个脚本版本) | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 1 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "版本描述", + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 脚本版本ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 脚本版本所属的脚本ID | +| version | string | 版本号 | +| content | string | 脚本版本内容 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| version_desc | string | 版本描述 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_script_version_list.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_script_version_list.md new file mode 100644 index 0000000000..01f07044ae --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_script_version_list.md @@ -0,0 +1,94 @@ +### 功能描述 + +查询业务脚本版本列表 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| return_script_content | bool | 否 | 是否需要返回脚本内容。true:返回脚本内容;false:不返回脚本内容。默认为false。 | +| start | int | 否 | 分页记录起始位置,不传默认为0 | +| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "return_script_content": true, + "start": 0, + "length": 10 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "data": [ + { + "id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "script_id": "000dbdddc06c453baf1f2decddf00c69", + "version": "V1.0", + "content": "#!/bin/bash***", + "status": 1, + "version_desc": "版本描述", + "creator": "admin", + "create_time": 1600746078520, + "last_modify_user": "admin", + "last_modify_time": 1600746078520 + } + ], + "start": 0, + "length": 10, + "total": 1 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| id | long | 脚本版本ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 脚本版本所属的脚本ID | +| version | string | 版本号 | +| content | string | 脚本内容 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| version_desc | string | 版本描述 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/operate_job_instance.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/operate_job_instance.md new file mode 100644 index 0000000000..271cff048f --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/operate_job_instance.md @@ -0,0 +1,61 @@ +### 功能描述 + +用于对执行的作业实例进行操作,例如终止作业。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_instance_id | long | 是 | 作业实例ID | +| operation_code | int | 是 | 操作类型:1、终止作业 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100, + "operation_code": 1 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_id": 100 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/operate_step_instance.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/operate_step_instance.md new file mode 100644 index 0000000000..c11cc809e8 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/operate_step_instance.md @@ -0,0 +1,78 @@ +### 功能描述 + +用于对执行的实例的步骤进行操作,例如重试,忽略错误等。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_instance_id | long | 是 | 作业实例ID | +| step_instance_id | long | 是 | 步骤实例ID | +| operation_code | int | 是 | 操作类型:2、失败IP重做,3、忽略错误 6、确认继续 8、全部重试,9、终止确认流程,10-重新发起确认,11、进入下一步,12、强制跳过 | + + +##### operation_code 详细说明 +| operation_code | 操作类型 | 适用步骤 | 描述 | +|-----------|------------|--------|------------| +| 2 | 失败IP重做 | 脚本执行,文件分发步骤 | 对失败的IP重新下发任务 | +| 3 | 忽略错误 | 脚本执行,文件分发步骤 | 忽略错误,继续执行 | +| 6 | 确认继续 | 人工确认步骤 | 确认继续执行 | +| 8 | 全部重试 | 脚本执行,文件分发步骤 | 对所有的IP重新下发任务 | +| 9 | 终止确认流程 | 人工确认步骤 | 确认终止执行 | +| 10 | 重新发起确认 | 人工确认步骤 | 重新发起确认 | +| 11 | 进入下一步 | 脚本执行,文件分发步骤 | 当步骤状态为终止成功,用于继续执行后续步骤 | +| 12 | 强制跳过 | 脚本执行,文件分发步骤 | 当步骤状态为终止中,用于强制跳过当前步骤,执行后续步骤| + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_instance_id": 100, + "step_instance_id": 200, + "operation_code": 2 +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "step_instance_id": 200, + "job_instance_id": 100 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| step_instance_id | long | 步骤实例ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/publish_public_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/publish_public_script_version.md new file mode 100644 index 0000000000..eaf5dc0d6d --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/publish_public_script_version.md @@ -0,0 +1,61 @@ +### 功能描述 + +上线公共脚本版本,上线后,之前的线上脚本将被置为已下线状态,但不影响作业使用。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | -------------- | +| script_id | string | 是 | 公共脚本ID | +| script_version_id | long | 是 | 公共脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000018 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000018, + "id": "4537fb49ec0840a1b91cef4179c99f9c", + "status": 2 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | string | 脚本ID | +| script_version_id | long | 脚本版本ID | +| status | int | 脚本版本当前状态(0:未上线,1:已上线,2:已下线,3:已禁用) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/publish_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/publish_script_version.md new file mode 100644 index 0000000000..968f13d05a --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/publish_script_version.md @@ -0,0 +1,65 @@ +### 功能描述 + +上线脚本版本,上线后,之前的线上脚本将被置为已下线状态,但不影响作业使用。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| script_version_id | long | 是 | 脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000019, + "id": "4a350b0e0707450e93326f6ace921072", + "status": 1 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | string | 脚本ID | +| script_version_id | long | 脚本版本ID | +| status | int | 脚本版本当前状态(0:未上线,1:已上线,2:已下线,3:已禁用) | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/push_config_file.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/push_config_file.md new file mode 100644 index 0000000000..0d6f0353ea --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/push_config_file.md @@ -0,0 +1,125 @@ +### 功能描述 + +分发配置文件,此接口用于分发配置文件等小的纯文本文件 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| task_name | string | 否 | 自定义作业名称 | +| account_alias | string | 是 | 执行账号别名 | +| file_target_path | string | 是 | 文件传输目标路径 | +| file_list | array | 是 | 源文件对象数组,见下面file定义 | +| target_server | object | 是 | 目标服务器,见server定义 | + +#### file + +| 字段 | 类型 | 必选 | 描述 | +|-----------|------------|--------|------------| +| file_name | string | 是 | 文件名称 | +| content | string | 是 | 文件内容Base64 | + +#### server + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ------------------------------------------------------------ | +| host_id_list | array | 否 | 主机ID列表 | +| ip_list | array | 否 | ***不推荐使用,建议使用host_id_list参数***;如果host_id_list与ip_list同时存在,将忽略ip_list参数。主机IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + + +#### ip + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | long | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +#### dynamic_group + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ------ | ---- | -------------- | +| id | string | 是 | CMDB动态分组ID | + +#### topo_node_list + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set" | + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "account_alias": "root", + "file_target_path": "/tmp/", + "file_list": [ + { + "file_name": "a.txt", + "content": "aGVsbG8gd29ybGQh" + } + ], + "target_server": { + "dynamic_group_list": [ + { + "id": "blo8gojho0skft7pr5q0" + } + ], + "host_id_list": [ + 101, + 102 + ], + "topo_node_list": [ + { + "id": 1000, + "node_type": "module" + } + ] + } +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "job_instance_name": "API GSE PUSH FILE1521107826893", + "job_instance_id": 10000 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| job_instance_id | long | 作业实例ID | +| job_instance_name | long | 作业实例名称 | +| step_instance_id | long | 步骤实例ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/save_cron.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/save_cron.md new file mode 100644 index 0000000000..7e573d8dde --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/save_cron.md @@ -0,0 +1,382 @@ +### 功能描述 + +新建或保存定时任务;新建定时任务,定时任务状态默认为暂停,如有需要可调用update_cron_status接口开启。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 是 | 要定时执行的作业的执行方案 ID | +| id | long | 否 | 定时任务 ID,更新定时任务时,必须传这个值 | +| name | string | 否 | 定时作业名称,新建时必填,修改时选填 | +| expression | string | 否 | 定时任务 crontab 的定时规则,新建时必填,修改时选填,各字段含义为:分 时 日 月 周,如: 0/5 * * * * 表示每5分钟执行一次,注意:不支持? ,新建时与execute_time互斥,二者只可传入一个| +| execute_time | long | 否 | 定时任务单次执行的执行时间,Unix时间戳,新建定时任务时不可与expression同时为空,且二者只可传入一个 | +| global_var_list | array | 否 | 全局变量信息,可使用 查询执行方案详情 接口查询方案可设置的变量信息 | + +#### global_var + +| 字段 | 类型 | 必选 | 描述 | +|-----------|-----------|--------|------------| +| id | long | 否 | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 否 | 全局变量 name | +| value | string | 否 | 字符、密码、数组类型的全局变量的值 | +| server | object | 否 | 主机类型全局变量的值 | + +#### server +| 字段 | 类型 | 必选 | 描述 | +|-----------------------|-------|--------|------------| +| host_id_list | array | 否 | 主机ID列表 | +| ip_list | array | 否 | ***不推荐使用,建议使用host_id_list参数***;如果host_id_list与ip_list同时存在,将忽略ip_list参数。主机IP 列表,定义见ip | +| host_id_list | array | 否 | 静态 主机ID 列表,元素为Long类型,指定的主机将与ip_list指定的主机取并集 | +| dynamic_group_list | array | 否 | 动态分组列表 | +| topo_node_list | array | 否 | 动态 topo 节点列表 | + +#### ip + +| 字段 | 类型 | 必选 | 描述 | +|-------------|---------|--------|---------| +| bk_cloud_id | int | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | + +#### topo_node +| 字段 | 类型 | 必选 | 描述 | +|------------------|--------|--------|------------| +| id | long | 是 | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 是 | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| + + +### 请求参数示例 +- POST +#### 1.创建定时任务 +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxx", + "access_token": "xxx", + "bk_username": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "expression": "0 0/5 * * *", + "job_plan_id": 1023060, + "name": "test API", + "global_var_list": [ + { + "name": "stringVar", + "value": "value11112" + }, + { + "name": "nsVar", + "value": "nsvalue11112" + }, + { + "name": "secretVar", + "value": "secretvalue11112" + }, + { + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)" + }, + { + "name": "indexArrVar", + "value": "(2 3 4)" + }, + { + "name": "hostVar", + "server": { + "host_id_list": [1,2,3] + } + } + ] +} +``` +#### 2.更新定时任务 +```json +{ + "id": 1000064, + "bk_app_code": "xxx", + "bk_app_secret": "xxx", + "access_token": "xxx", + "bk_username": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "expression": "0 0/5 * * *", + "job_plan_id": 1023060, + "name": "test API", + "global_var_list": [ + { + "name": "stringVar", + "value": "value111333312" + }, + { + "name": "nsVar", + "value": "nsvalue111333312" + }, + { + "name": "secretVar", + "value": "secretvalue111333312" + }, + { + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)" + }, + { + "name": "indexArrVar", + "value": "(22 3 4)" + }, + { + "name": "hostVar", + "server": { + "host_id_list": [2,3,4] + } + } + ] +} +``` + +### 返回结果示例 +#### 1.创建定时任务 +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000067, + "name": "test API", + "status": 2, + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 1023060, + "expression": "0 0/5 * * *", + "global_var_list": [ + { + "id": 1001101, + "name": "stringVar", + "value": "value11112", + "description": null, + "type": 1, + "required": null, + "server": null + }, + { + "id": 1001102, + "name": "nsVar", + "value": "nsvalue11112", + "description": null, + "type": 2, + "required": null, + "server": null + }, + { + "id": 1001104, + "name": "secretVar", + "value": "secretvalue11112", + "description": null, + "type": 4, + "required": null, + "server": null + }, + { + "id": 1001105, + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)", + "description": null, + "type": 5, + "required": null, + "server": null + }, + { + "id": 1001106, + "name": "indexArrVar", + "value": "(2 3 4)", + "description": null, + "type": 6, + "required": null, + "server": null + }, + { + "id": 1001103, + "name": "hostVar", + "value": null, + "description": null, + "type": 3, + "required": null, + "server": { + "ip_list": [ + { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ], + "dynamic_group_list": null, + "topo_node_list": null + } + } + ], + "create_time": 1642045370, + "last_modify_user": "admin", + "last_modify_time": 1642045370 + } +} +``` +#### 2.更新定时任务 +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000064, + "name": "test API", + "status": 2, + "creator": "admin", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "job_plan_id": 1023060, + "expression": "0 0/5 * * *", + "global_var_list": [ + { + "id": 1001101, + "name": "stringVar", + "value": "value111333312", + "description": null, + "type": 1, + "required": null, + "server": null + }, + { + "id": 1001102, + "name": "nsVar", + "value": "nsvalue111333312", + "description": null, + "type": 2, + "required": null, + "server": null + }, + { + "id": 1001104, + "name": "secretVar", + "value": "secretvalue111333312", + "description": null, + "type": 4, + "required": null, + "server": null + }, + { + "id": 1001105, + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)", + "description": null, + "type": 5, + "required": null, + "server": null + }, + { + "id": 1001106, + "name": "indexArrVar", + "value": "(22 3 4)", + "description": null, + "type": 6, + "required": null, + "server": null + }, + { + "id": 1001103, + "name": "hostVar", + "value": null, + "description": null, + "type": 3, + "required": null, + "server": { + "ip_list": [ + { + "bk_host_id": 101, + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ], + "dynamic_group_list": null, + "topo_node_list": null + } + } + ], + "create_time": 1641990674, + "last_modify_user": "admin", + "last_modify_time": 1641995052 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| message | string | 请求失败返回的错误信息(成功时无此字段)| +| data | object | 请求返回的数据| +| permission | object | 权限信息(无权限情况下才返回)| + +#### data + +| 字段 | 类型 | 描述 | +|-----------------|------------|-------------| +| id | long | 定时任务 ID| +| name | string | 定时作业名称| +| status | int | 定时任务状态| +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| job_plan_id | long | 要定时执行的作业的执行方案 ID | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(s) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(s) | +| expression | string | 定时任务 crontab 的定时规则| +| execute_time | long | 定时任务单次执行的执行时间,Unix时间戳| +| global_var_list | array | 全局变量信息,定义见global_var | + +#### global_var + +| 字段 | 类型 | 描述 | +|-------------|-----------|------------| +| id | long | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 全局变量名 | +| description | string | 全局变量描述 | +| type | int | 全局变量类型 | +| required | int | 模版/执行方案中该变量是否必填 | +| value | string | 字符、密码、数组类型的全局变量的值 | +| server | object | 主机类型全局变量的值 | + +#### server +| 字段 | 类型 | 描述 | +|-----------------------|-------|------------| +| variable | string | 引用的变量名 | +| ip_list | array | 静态 IP 列表 | +| host_id_list | array | 静态 主机ID 列表,元素为Long类型 | +| dynamic_group_list | array | 动态分组 ID 列表 | +| topo_node_list | array | 动态 topo 节点列表 | + +#### ip +| 字段 | 类型 | 描述 | +|-----------|------------|--------| +| bk_host_id | long | 主机ID | +| bk_cloud_id | long | 管控区域ID | +| ip | string | IP地址 | + +#### dynamic_group +| 字段 | 类型 | 描述 | +|-----|---------|------------| +| id | string | 动态分组 ID | + +#### topo_node +| 字段 | 类型 | 描述 | +|------------------|--------|------------| +| id | long | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_credential.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_credential.md new file mode 100644 index 0000000000..2753b91447 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_credential.md @@ -0,0 +1,72 @@ +### 功能描述 + +更新凭据。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | string | 是 | 凭据 ID | +| name | string | 否 | 凭据名称 | +| type | string | 否 | 凭据类型,取值可为ACCESS_KEY_SECRET_KEY,PASSWORD,USERNAME_PASSWORD,SECRET_KEY | +| description | string | 否 | 凭据描述 | +| credential_access_key | string | 否 | 凭据类型为ACCESS_KEY_SECRET_KEY时填写 | +| credential_secret_key | string | 否 | 凭据类型为ACCESS_KEY_SECRET_KEY/SECRET_KEY时填写 | +| credential_username | string | 否 | 凭据类型为USERNAME_PASSWORD时填写 | +| credential_password | string | 否 | 凭据类型为USERNAME_PASSWORD/PASSWORD时填写 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": "06644309e10e4068b3c7b32799668210", + "name": "testCredential", + "type": "USERNAME_PASSWORD", + "description": "This is a new credential", + "credential_username": "admin", + "credential_password": "newPassword" +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": "06644309e10e4068b3c7b32799668210" + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 |字段是否一定存在 | 描述 | +|-----------|-------|---------------|---------| +| id | string |是 | 凭据ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_cron_status.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_cron_status.md new file mode 100644 index 0000000000..ea124290d2 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_cron_status.md @@ -0,0 +1,181 @@ +### 功能描述 + +更新定时作业状态,如启动或暂停 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------- |------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | long | 是 | 定时作业 ID | +| status | int | 是 | 定时状态,1.启动、2.暂停 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 2, + "status": 1 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 2, + "name": "test API", + "status": 1, + "creator": "admin", + "bk_biz_id": 1, + "job_plan_id": 1023060, + "expression": "0 0/5 * * *", + "global_var_list": [ + { + "id": 1001101, + "name": "stringVar", + "value": "value111333312", + "description": null, + "type": 1, + "required": null, + "server": null + }, + { + "id": 1001102, + "name": "nsVar", + "value": "nsvalue111333312", + "description": null, + "type": 2, + "required": null, + "server": null + }, + { + "id": 1001104, + "name": "secretVar", + "value": "secretvalue111333312", + "description": null, + "type": 4, + "required": null, + "server": null + }, + { + "id": 1001105, + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)", + "description": null, + "type": 5, + "required": null, + "server": null + }, + { + "id": 1001106, + "name": "indexArrVar", + "value": "(22 3 4)", + "description": null, + "type": 6, + "required": null, + "server": null + }, + { + "id": 1001103, + "name": "hostVar", + "value": null, + "description": null, + "type": 3, + "required": null, + "server": { + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ], + "dynamic_group_list": null, + "topo_node_list": null + } + } + ], + "create_time": 1641990674, + "last_modify_user": "admin", + "last_modify_time": 1641995052 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| message | string | 请求失败返回的错误信息(成功时无此字段)| +| data | object | 请求返回的数据| +| permission | object | 权限信息(无权限情况下才返回)| + +#### data + +| 字段 | 类型 | 描述 | +|-----------------|------------|-------------| +| id | long | 定时任务 ID| +| name | string | 定时作业名称| +| status | int | 定时任务状态| +| bk_biz_id | long | 业务 ID | +| job_plan_id | long | 要定时执行的作业的执行方案 ID | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(s) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(s) | +| expression | string | 定时任务 crontab 的定时规则,| +| execute_time | long | 定时任务单次执行的执行时间,Unix时间戳| +| global_var_list | array | 全局变量信息,定义见global_var | + +#### global_var + +| 字段 | 类型 | 描述 | +|-------------|-----------|------------| +| id | long | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 全局变量名 | +| description | string | 全局变量描述 | +| type | int | 全局变量类型 | +| required | int | 模版/执行方案中该变量是否必填 | +| value | string | 字符、密码、数组类型的全局变量的值 | +| server | object | 主机类型全局变量的值 | + +#### server +| 字段 | 类型 | 描述 | +|-----------------------|-------|------------| +| variable | string | 引用的变量名 | +| ip_list | array | 静态 IP 列表 | +| dynamic_group_list | array | 动态分组 ID 列表 | +| topo_node_list | array | 动态 topo 节点列表 | + +#### ip +| 字段 | 类型 | 描述 | +|-------------|---------|---------| +| bk_cloud_id | int | 云区域ID | +| ip | string | IP地址 | + +#### dynamic_group +| 字段 | 类型 | 描述 | +|-----|---------|------------| +| id | string | 动态分组 ID | + +#### topo_node +| 字段 | 类型 | 描述 | +|------------------|--------|------------| +| id | long | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_file_source.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_file_source.md new file mode 100644 index 0000000000..e65e5ee99d --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_file_source.md @@ -0,0 +1,78 @@ +### 功能描述 + +更新文件源。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| code | string | 是 | 文件源标识,英文字符开头,1-32位英文字符、下划线、数字组成 | +| alias | string | 否 | 文件源别名 | +| type | string | 否 | 文件源类型,当前仅支持蓝鲸制品库,BLUEKING_ARTIFACTORY | +| access_params | object | 否 | 文件源接入参数,根据type传入不同的对象,见后续说明 | +| credential_id | string | 否 | 文件源使用的凭据Id | +| file_prefix | string | 否 | Job对从该文件源分发的文件加上的前缀,不传默认不加前缀 | + +### access_params +**type为BLUEKING_ARTIFACTORY** + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|------------|--------|------------| +| base_url | string | 是 | 对接的制品库实例根地址,例如:https://bkrepo.com | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "code": "sopsArtifactory", + "alias": "标准运维制品库文件源", + "type": "BLUEKING_ARTIFACTORY", + "access_params": { + "base_url": "https://bkrepo.com" + }, + "credential_id": "06644309e10e4068b3c7b32799668210", + "file_prefix": "" +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "data": { + "id": 1 + } +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|-----------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 |字段是否一定存在 | 描述 | +|------------|--------|---------------|-----------| +| id | int |是 | 文件源ID | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_public_script_basic.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_public_script_basic.md new file mode 100644 index 0000000000..59668af9c7 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_public_script_basic.md @@ -0,0 +1,75 @@ +### 功能描述 + +更新公共脚本基础信息。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | ------------ | +| script_id | string | 是 | 公共脚本ID | +| name | string | 是 | 公共脚本名称 | +| description | string | 否 | 公共脚本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "description": "public script test" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "public_script": true, + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691740230000, + "description": "public script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ---------------- | ------ | ------------------------------------------------------------ | +| script_id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | 是否公共脚本 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| description | string | 脚本描述 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_public_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_public_script_version.md new file mode 100644 index 0000000000..65d108adc3 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_public_script_version.md @@ -0,0 +1,87 @@ +### 功能描述 + +修改公共脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ---------------------- | +| script_id | string | 是 | 公共脚本ID | +| script_version_id | long | 是 | 公共脚本版本ID | +| content | string | 是 | 脚本内容,需Base64编码 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000020, + "content": "IyEvYmluL2Jhc2gKbHM=", + "version_desc": "version 2" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000020, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "public_script": true, + "content": "IyEvYmluL2Jhc2gKbHM=", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691740290000, + "version": "1.0", + "version_desc": "version 2", + "status": 0, + "description": "public script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | 公共脚本版本ID | +| script_id | string | 公共脚本ID | +| name | string | 公共脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | 是否公共脚本 | +| content | string | 公共脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 公共脚本版本 | +| version_desc | string | 公共脚本版本描述 | +| status | int | 公共脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 公共脚本描述 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_script_basic .md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_script_basic .md new file mode 100644 index 0000000000..7ab78d9d03 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_script_basic .md @@ -0,0 +1,82 @@ +### 功能描述 + +更新脚本基础信息。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| name | string | 是 | 脚本名称 | +| description | string | 否 | 脚本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "public_script": false, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "creator": "admin", + "create_time": 1691743535000, + "last_modify_user": "admin", + "last_modify_time": 1691743715000, + "description": "script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ---------------- | ------ | ------------------------------------------------------------ | +| script_id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | 是否公共脚本 | +| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| description | string | 脚本描述 | diff --git a/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_script_version.md b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_script_version.md new file mode 100644 index 0000000000..400e469970 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/update_script_version.md @@ -0,0 +1,95 @@ +### 功能描述 + +修改脚本版本信息。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| script_version_id | long | 是 | 脚本版本ID | +| content | string | 是 | 脚本内容,需Base64编码 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019, + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version_desc": "version 1.0" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "script_version_id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "public_script": false, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "creator": "admin", + "create_time": 1691741073000, + "last_modify_user": "admin", + "last_modify_time": 1691741313000, + "version": "1.0", + "version_desc": "version 1.0", + "status": 0, + "description": "script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_version_id | long | 脚本版本ID | +| script_id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| public_script | bool | 是否公共脚本 | +| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| content | string | 脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 脚本版本 | +| version_desc | string | 版本描述 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 脚本描述 | diff --git a/docs/apidoc/esb/jobv3-confapis/job.yaml b/docs/apidoc/esb/jobv3-confapis/job.yaml new file mode 100644 index 0000000000..2a67768868 --- /dev/null +++ b/docs/apidoc/esb/jobv3-confapis/job.yaml @@ -0,0 +1,498 @@ +--- +# Job Execute API +- path: /v2/jobv3/execute_job_plan/ + name: execute_job_plan + label: 执行作业执行方案 + label_en: Execute job plan + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/execute_job_plan/ + dest_http_method: POST + +- path: /v2/jobv3/fast_execute_script/ + name: fast_execute_script + label: 快速执行脚本 + label_en: Fast execute script + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/fast_execute_script/ + dest_http_method: POST + +- path: /v2/jobv3/fast_execute_sql/ + name: fast_execute_sql + label: 快速执行SQL + label_en: Fast execute SQL + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/fast_execute_sql/ + dest_http_method: POST + +- path: /v2/jobv3/fast_transfer_file/ + name: fast_transfer_file + label: 快速分发文件 + label_en: Fast transfer file + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/fast_transfer_file/ + dest_http_method: POST + +- path: /v2/jobv3/push_config_file/ + name: push_config_file + label: 分发配置文件 + label_en: Distribute config file + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/push_config_file/ + dest_http_method: POST + is_hidden: True + +- path: /v2/jobv3/operate_step_instance/ + name: operate_step_instance + label: 步骤实例操作 + label_en: Operate step instance + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/operate_step_instance/ + dest_http_method: POST + +- path: /v2/jobv3/operate_job_instance/ + name: operate_job_instance + label: 作业实例操作 + label_en: Operate job instance + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/operate_job_instance/ + dest_http_method: POST + +- path: /v2/jobv3/get_job_instance_status/ + name: get_job_instance_status + label: 根据作业实例 ID 查询作业执行状态 + label_en: Get the job execution status based on the job instance ID + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/get_job_instance_status/ + dest_http_method: POST + +- path: /v2/jobv3/get_job_instance_ip_log/ + name: get_job_instance_ip_log + label: 根据作业实例ID查询作业执行日志 + label_en: Get job instance ip log + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/get_job_instance_ip_log/ + dest_http_method: POST + +- path: /v2/jobv3/batch_get_job_instance_ip_log/ + name: batch_get_job_instance_ip_log + label: 根据ip列表批量查询作业执行日志 + label_en: Batch get job instance ip log + suggest_method: POST + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/batch_get_job_instance_ip_log/ + dest_http_method: POST + +- path: /v2/jobv3/get_job_instance_list/ + name: get_job_instance_list + label: 查询作业实例列表(执行历史) + label_en: Get job instance list + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/get_job_instance_list/ + dest_http_method: POST + +- path: /v2/jobv3/get_job_instance_global_var_value/ + name: get_job_instance_global_var_value + label: 获取作业实例全局变量值 + label_en: Get job instance global variable value + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-execute/get_job_instance_global_var_value/ + dest_http_method: POST + +# Job management API +- path: /v2/jobv3/get_job_template_list/ + name: get_job_template_list + label: 查询作业模版列表 + label_en: Get job template list + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_job_template_list/ + dest_http_method: POST + +- path: /v2/jobv3/get_job_plan_list/ + name: get_job_plan_list + label: 查询执行方案列表 + label_en: Get job execution plan list + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_job_plan_list/ + dest_http_method: POST + +- path: /v2/jobv3/get_job_plan_detail/ + name: get_job_plan_detail + label: 查询执行方案详情 + label_en: Get job execution plan detail + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_job_plan_detail/ + dest_http_method: POST + +- path: /v2/jobv3/get_account_list/ + name: get_account_list + label: 查询业务下的执行账号 + label_en: Get accounts + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_account_list/ + dest_http_method: POST + +- path: /v2/jobv3/get_public_script_list/ + name: get_public_script_list + label: 查询公共脚本列表 + label_en: Get public script list + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_public_script_list/ + dest_http_method: POST + +- path: /v2/jobv3/get_public_script_version_list/ + name: get_public_script_version_list + label: 查询公共脚本版本列表 + label_en: Get public script version list + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_public_script_version_list/ + dest_http_method: POST + +- path: /v2/jobv3/get_public_script_version_detail/ + name: get_public_script_version_detail + label: 查询公共脚本详情 + label_en: Get public script detail + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_public_script_version_detail/ + dest_http_method: POST + +- path: /v2/jobv3/get_script_list/ + name: get_script_list + label: 查询脚本列表 + label_en: Get script list + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_script_list/ + dest_http_method: POST + +- path: /v2/jobv3/get_script_version_list/ + name: get_script_version_list + label: 查询脚本版本列表 + label_en: Get script version list + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_script_version_list/ + dest_http_method: POST + +- path: /v2/jobv3/get_script_version_detail/ + name: get_script_version_detail + label: 查询脚本详情 + label_en: Get script version detail + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_script_version_detail/ + dest_http_method: POST + +# Job Crontab API +- path: /v2/jobv3/get_cron_list/ + name: get_cron_list + label: 查询业务下定时作业信息 + label_en: Get crontab job list + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-crontab/get_cron_list/ + dest_http_method: POST + +- path: /v2/jobv3/get_cron_detail/ + name: get_cron_detail + label: 查询定时作业详情 + label_en: Get crontab job detail + suggest_method: GET + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-crontab/get_cron_detail/ + dest_http_method: POST + +- path: /v2/jobv3/save_cron/ + name: save_cron + label: 新建或保存定时作业 + label_en: Create or update crontab job + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-crontab/save_cron/ + dest_http_method: POST + +- path: /v2/jobv3/update_cron_status/ + name: update_cron_status + label: 更新定时作业状态,如启动或暂停 + label_en: Update crontab job status, such as startup or stop + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-crontab/update_cron_status/ + dest_http_method: POST + + +- path: /v2/jobv3/create_credential/ + name: create_credential + label: 新建凭据 + label_en: Create credential + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_credential/ + dest_http_method: POST + is_hidden: True + +- path: /v2/jobv3/update_credential/ + name: update_credential + label: 更新凭据 + label_en: Update credential + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/update_credential/ + dest_http_method: POST + is_hidden: True + +- path: /v2/jobv3/create_file_source/ + name: create_file_source + label: 新建文件源 + label_en: Create file source + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-file-gateway/create_file_source/ + dest_http_method: POST + is_hidden: True + +- path: /v2/jobv3/update_file_source/ + name: update_file_source + label: 更新文件源 + label_en: Update file source + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-file-gateway/update_file_source/ + dest_http_method: POST + is_hidden: True + +- path: /v2/jobv3/generate_local_file_upload_url/ + name: generate_local_file_upload_url + label: 生成本地文件上传URL + label_en: Generate local file upload url + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/generate_local_file_upload_url/ + dest_http_method: POST + is_hidden: True + +--- +# Job management API +- path: /v2/jobv3/create_public_script/ + name: create_public_script + label: 创建公共脚本 + label_en: Save public script + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_public_script/ + dest_http_method: POST + + +- path: /v2/jobv3/update_public_script_basic/ + name: update_public_script_basic + label: 更新公共脚本基础信息 + label_en: Update public script + suggest_method: PUT + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/update_public_script_basic/ + dest_http_method: PUT + + +- path: /v2/jobv3/delete_public_script_version/ + name: delete_public_script_version + label: 删除公共脚本版本 + label_en: Delete public script version + suggest_method: DELETE + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/delete_public_script_version/ + dest_http_method: DELETE + + +- path: /v2/jobv3/create_public_script_version/ + name: create_public_script_version + label: 新建公共脚本版本 + label_en: Save public script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_public_script_version/ + dest_http_method: POST + + +- path: /v2/jobv3/update_public_script_version/ + name: update_public_script_version + label: 修改公共脚本版本 + label_en: Update public script version + suggest_method: PUT + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/update_public_script_version/ + dest_http_method: PUT + + +- path: /v2/jobv3/publish_public_script_version/ + name: publish_public_script_version + label: 发布公共脚本版本 + label_en: Publish public script version + suggest_method: PUT + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/publish_public_script_version/ + dest_http_method: PUT + + +- path: /v2/jobv3/disable_public_script_version/ + name: disable_public_script_version + label: 禁用公共脚本版本 + label_en: Disable public script version + suggest_method: PUT + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/disable_public_script_version/ + dest_http_method: PUT + + +- path: /v2/jobv3/delete_public_script/ + name: delete_public_script + label: 删除公共脚本 + label_en: Delete public script + suggest_method: DELETE + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/delete_public_script/ + dest_http_method: DELETE + + +- path: /v2/jobv3/create_script/ + name: create_script + label: 创建脚本 + label_en: Save script + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_script/ + dest_http_method: POST + + +- path: /v2/jobv3/update_script_basic/ + name: update_script_basic + label: 更新脚本基础信息 + label_en: Update script basic + suggest_method: PUT + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/update_script_basic/ + dest_http_method: PUT + + +- path: /v2/jobv3/delete_script_version/ + name: delete_script_version + label: 删除脚本版本 + label_en: Delete script version + suggest_method: DELETE + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/delete_script_version/ + dest_http_method: DELETE + + +- path: /v2/jobv3/create_script_version/ + name: create_script_version + label: 新建脚本版本 + label_en: Save script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_script_version/ + dest_http_method: POST + + +- path: /v2/jobv3/update_script_version/ + name: update_script_version + label: 修改脚本版本信息 + label_en: Update script version + suggest_method: PUT + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/update_script_version/ + dest_http_method: PUT + + +- path: /v2/jobv3/publish_script_version/ + name: publish_script_version + label: 发布脚本版本 + label_en: Publish script version + suggest_method: PUT + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/publish_script_version/ + dest_http_method: PUT + + +- path: /v2/jobv3/disable_script_version/ + name: disable_script_version + label: 禁用脚本版本 + label_en: Disable script version + suggest_method: PUT + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/disable_script_version/ + dest_http_method: PUT + + +- path: /v2/jobv3/delete_script/ + name: delete_script + label: 删除脚本 + label_en: Delete script + suggest_method: DELETE + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/delete_script/ + dest_http_method: DELETE +