From c8d25bacc93c34377f9de7211426513f1df2341c Mon Sep 17 00:00:00 2001 From: alex-smile <443677891@qq.com> Date: Tue, 18 Jul 2023 20:13:45 +0800 Subject: [PATCH] update jobv3 confapis (#1097) * update jobv3 confapis * update release version --- paas2/VERSION | 2 +- .../en/batch_get_job_instance_ip_log.md | 164 ++++++++ .../jobv3/apidocs/en/callback_protocol.md | 42 ++ .../confapis/jobv3/apidocs/en/common.md | 45 ++ .../jobv3/apidocs/en/create_credential.md | 70 ++++ .../jobv3/apidocs/en/create_file_source.md | 87 ++++ .../jobv3/apidocs/en/execute_job_plan.md | 133 ++++++ .../jobv3/apidocs/en/fast_execute_script.md | 130 ++++++ .../jobv3/apidocs/en/fast_execute_sql.md | 122 ++++++ .../jobv3/apidocs/en/fast_transfer_file.md | 184 +++++++++ .../en/generate_local_file_upload_url.md | 72 ++++ .../jobv3/apidocs/en/get_account_list.md | 94 +++++ .../jobv3/apidocs/en/get_cron_detail.md | 145 +++++++ .../jobv3/apidocs/en/get_cron_list.md | 105 +++++ .../en/get_job_instance_global_var_value.md | 136 ++++++ .../apidocs/en/get_job_instance_ip_log.md | 139 +++++++ .../jobv3/apidocs/en/get_job_instance_list.md | 111 +++++ .../apidocs/en/get_job_instance_status.md | 142 +++++++ .../jobv3/apidocs/en/get_job_plan_detail.md | 306 ++++++++++++++ .../jobv3/apidocs/en/get_job_plan_list.md | 100 +++++ .../jobv3/apidocs/en/get_job_template_list.md | 96 +++++ .../{zh_hans => en}/get_proc_result.md | 44 +- .../apidocs/en/get_public_script_list.md | 83 ++++ .../en/get_public_script_version_detail.md | 75 ++++ .../en/get_public_script_version_list.md | 86 ++++ .../jobv3/apidocs/en/get_script_list.md | 90 ++++ .../apidocs/en/get_script_version_detail.md | 83 ++++ .../apidocs/en/get_script_version_list.md | 94 +++++ .../confapis/jobv3/apidocs/en/manage_proc.md | 128 ++++++ .../jobv3/apidocs/en/operate_job_instance.md | 61 +++ .../confapis/jobv3/apidocs/en/operate_proc.md | 97 +++++ .../jobv3/apidocs/en/operate_process.md | 113 +++++ .../jobv3/apidocs/en/operate_step_instance.md | 78 ++++ .../jobv3/apidocs/en/push_config_file.md | 129 ++++++ .../confapis/jobv3/apidocs/en/save_cron.md | 390 ++++++++++++++++++ .../jobv3/apidocs/en/set_base_report.md | 87 ++++ .../jobv3/apidocs/en/update_credential.md | 72 ++++ .../jobv3/apidocs/en/update_cron_status.md | 59 +++ .../jobv3/apidocs/en/update_file_source.md | 79 ++++ .../zh_hans/batch_get_job_instance_ip_log.md | 44 +- .../confapis/jobv3/apidocs/zh_hans/common.md | 10 +- .../apidocs/zh_hans/create_credential.md | 8 +- .../apidocs/zh_hans/create_file_source.md | 8 +- .../jobv3/apidocs/zh_hans/execute_job_plan.md | 24 +- .../apidocs/zh_hans/fast_execute_script.md | 41 +- .../jobv3/apidocs/zh_hans/fast_execute_sql.md | 35 +- .../apidocs/zh_hans/fast_transfer_file.md | 60 ++- .../zh_hans/generate_local_file_upload_url.md | 8 +- .../jobv3/apidocs/zh_hans/get_account_list.md | 16 +- .../jobv3/apidocs/zh_hans/get_cron_detail.md | 23 +- .../jobv3/apidocs/zh_hans/get_cron_list.md | 24 +- .../get_job_instance_global_var_value.md | 14 +- .../zh_hans/get_job_instance_ip_log.md | 34 +- .../apidocs/zh_hans/get_job_instance_list.md | 14 +- .../zh_hans/get_job_instance_status.md | 19 +- .../apidocs/zh_hans/get_job_plan_detail.md | 30 +- .../apidocs/zh_hans/get_job_plan_list.md | 21 +- .../apidocs/zh_hans/get_job_template_list.md | 21 +- .../apidocs/zh_hans/get_public_script_list.md | 3 +- .../get_public_script_version_detail.md | 2 +- .../zh_hans/get_public_script_version_list.md | 2 +- .../jobv3/apidocs/zh_hans/get_script_list.md | 14 +- .../zh_hans/get_script_version_detail.md | 14 +- .../zh_hans/get_script_version_list.md | 14 +- .../jobv3/apidocs/zh_hans/manage_proc.md | 126 ------ .../apidocs/zh_hans/operate_job_instance.md | 8 +- .../jobv3/apidocs/zh_hans/operate_proc.md | 95 ----- .../jobv3/apidocs/zh_hans/operate_process.md | 111 ----- .../apidocs/zh_hans/operate_step_instance.md | 8 +- .../jobv3/apidocs/zh_hans/push_config_file.md | 38 +- .../jobv3/apidocs/zh_hans/save_cron.md | 72 ++-- .../jobv3/apidocs/zh_hans/set_base_report.md | 85 ---- .../apidocs/zh_hans/update_credential.md | 8 +- .../apidocs/zh_hans/update_cron_status.md | 148 ++++++- .../apidocs/zh_hans/update_file_source.md | 8 +- paas2/esb/components/confapis/jobv3/job.yaml | 55 --- paas2/release.md | 3 + 77 files changed, 4739 insertions(+), 802 deletions(-) create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/batch_get_job_instance_ip_log.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/callback_protocol.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/common.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/create_credential.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/create_file_source.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/execute_job_plan.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_sql.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/fast_transfer_file.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/generate_local_file_upload_url.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_account_list.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_detail.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_list.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_global_var_value.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_ip_log.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_list.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_status.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_detail.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_list.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_job_template_list.md rename paas2/esb/components/confapis/jobv3/apidocs/{zh_hans => en}/get_proc_result.md (63%) create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_list.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_detail.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_list.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_script_list.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_detail.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_list.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/manage_proc.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/operate_job_instance.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/operate_proc.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/operate_process.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/operate_step_instance.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/push_config_file.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/save_cron.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/set_base_report.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/update_credential.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/update_cron_status.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/update_file_source.md delete mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/manage_proc.md delete mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_proc.md delete mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_process.md delete mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/set_base_report.md diff --git a/paas2/VERSION b/paas2/VERSION index ee92d69d5..6898c56f5 100644 --- a/paas2/VERSION +++ b/paas2/VERSION @@ -1 +1 @@ -2.14.54 +2.14.55 diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/batch_get_job_instance_ip_log.md b/paas2/esb/components/confapis/jobv3/apidocs/en/batch_get_job_instance_ip_log.md new file mode 100644 index 000000000..9fc1de821 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/batch_get_job_instance_ip_log.md @@ -0,0 +1,164 @@ +### Function Description + +Bulk query of job execution logs by ip list + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business, biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 | +| ip_list | array | yes | Source/target host IP list, see ip for definition | + +##### 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, + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + }, + { + "bk_cloud_id": 0, + "ip": "10.0.0.2" + } + ] +} +``` + +### 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": [ + { + "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" + } + ] + } + ] + } +} +``` + +**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_cloud_id | int | Target server cloud area 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_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_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_cloud_id | long | BK-Net ID | +| ip | string | IP Address | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/callback_protocol.md b/paas2/esb/components/confapis/jobv3/apidocs/en/callback_protocol.md new file mode 100644 index 000000000..8dad1af2d --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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/paas2/esb/components/confapis/jobv3/apidocs/en/common.md b/paas2/esb/components/confapis/jobv3/apidocs/en/common.md new file mode 100644 index 000000000..c106d5149 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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/paas2/esb/components/confapis/jobv3/apidocs/en/create_credential.md b/paas2/esb/components/confapis/jobv3/apidocs/en/create_credential.md new file mode 100644 index 000000000..d31150fa6 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/create_file_source.md b/paas2/esb/components/confapis/jobv3/apidocs/en/create_file_source.md new file mode 100644 index 000000000..c587a707b --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/execute_job_plan.md b/paas2/esb/components/confapis/jobv3/apidocs/en/execute_job_plan.md new file mode 100644 index 000000000..2681d20fd --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/execute_job_plan.md @@ -0,0 +1,133 @@ +### Function Description + +Start Job Plan + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| 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" | + +### 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" + } + ], + "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" + } + ] +} +``` + +### 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/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_script.md b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_script.md new file mode 100644 index 000000000..da3e6f4b1 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_script.md @@ -0,0 +1,130 @@ +### Function Description + +Start Job Plan + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|---------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 | +| ------------------ | ----- | -------- | ----------------------------------- | +| ip_list | array | no | Static IP list, as defined in ip | +| dynamic_group_list | array | no | Dynamic grouping list, for definition, see dynamic_group | +| 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" + } + ], + "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" + } + ] + } +} +``` + +### 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/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_sql.md b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_sql.md new file mode 100644 index 000000000..51967470d --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_sql.md @@ -0,0 +1,122 @@ +### Function Description + +Quick execution of SQL scripts + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|---------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 | +| ------------------ | ----- | -------- | ----------------------------------- | +| 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 | 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" + } + ], + "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" + } + ] + } +} +``` + +### 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/paas2/esb/components/confapis/jobv3/apidocs/en/fast_transfer_file.md b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_transfer_file.md new file mode 100644 index 000000000..1e708eaa2 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_transfer_file.md @@ -0,0 +1,184 @@ +### Function Description +Quick File transfer + +### Request Parameters +{{ common_args_desc }} + +#### Interface parameters +| Fields | Type | Required | Description | +|------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 | +|-----------|------------|--------|------------| +| ip_list | array | no | Static IP list| +| dynamic_group_list | array | no | Dynamic group ID list| +| topo_node_list | array | no | Dynamic topo node list| + +#### 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" + } + ], + "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 +} +``` +### 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/paas2/esb/components/confapis/jobv3/apidocs/en/generate_local_file_upload_url.md b/paas2/esb/components/confapis/jobv3/apidocs/en/generate_local_file_upload_url.md new file mode 100644 index 000000000..65934361b --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/get_account_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_account_list.md new file mode 100644 index 000000000..5a008414f --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_detail.md new file mode 100644 index 000000000..a007a32a0 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_detail.md @@ -0,0 +1,145 @@ +### Function Description + +Query Cron job details + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|------------------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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_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 + } +} +``` + +### 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_list.md new file mode 100644 index 000000000..b867e0ced --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_global_var_value.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_global_var_value.md new file mode 100644 index 000000000..3664afcef --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_ip_log.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_ip_log.md new file mode 100644 index 000000000..7783c6749 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_ip_log.md @@ -0,0 +1,139 @@ +### Function Description + +Query job execution log by ip + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-----------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 | yes |Target server cloud area ID| +| ip | string | yes |Destination server IP| + +### 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_cloud_id": 0, + "ip": "10.0.0.1" +} +``` + +### Example of responses + +#### Script execution steps +```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" + } +} +``` + +#### File distribution steps + +```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" + } + ] + } +} +``` + +**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/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_list.md new file mode 100644 index 000000000..d9d771fbb --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_status.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_status.md new file mode 100644 index 000000000..fbe43c183 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_status.md @@ -0,0 +1,142 @@ +### 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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": [ + { + "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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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 | +|-----------|-----------|-----------| +| 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/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_detail.md new file mode 100644 index 000000000..2dc0d8c47 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_detail.md @@ -0,0 +1,306 @@ +### 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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_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": "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_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 + } + } + ] + } +} +``` + + +### 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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_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/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_list.md new file mode 100644 index 000000000..0b6b8231f --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_template_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_template_list.md new file mode 100644 index 000000000..b2a02ddd2 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_proc_result.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_proc_result.md similarity index 63% rename from paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_proc_result.md rename to paas2/esb/components/confapis/jobv3/apidocs/en/get_proc_result.md index 5f52e8b9e..996e5e410 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_proc_result.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_proc_result.md @@ -1,31 +1,33 @@ -### 功能描述 +### Function Description -操作服务器上的进程结果查询 +Process results query on action server -### 请求参数 +### Request Parameters {{ common_args_desc }} -#### 接口参数 +#### Interface parameters -| 字段 | 类型 | 必选 | 描述 | +| Fields | Type | Required | Description | |-------------|------------|--------|------------| -| bk_biz_id | int | 是 | 业务ID | -| bk_gse_taskid | string | 是 | GSE任务ID | +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_gse_taskid | string | yes |GSE task ID| -### 请求参数示例 +### Example of request ```json { "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "bk_gse_taskid": "GSETASK:20180315180551:1000" } ``` -### 返回结果示例 +### Example of responses ```json { @@ -75,21 +77,21 @@ } ``` -### 返回结果参数说明 +### Response Description #### response -| 字段 | 类型 | 描述 | +| Fields | Type | Description | |-----------|-----------|-----------| -| result | bool | 请求成功与否。true:请求成功;false请求失败 | -| code | int | 错误编码。 0表示success,>0表示失败错误 | -| message | string | 请求失败返回的错误信息| -| data | object | 请求返回的数据| -| permission | object | 权限信息| -| request_id | string | 请求链id| +| 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 | |-----------|-----------|-----------| -| status | int | 预留字段。GSE任务状态码 | -| result | object | 真正的数据,依赖于GSE数据结构 | +| status | int | Reserved field. GSE task status code| +| result | object | Real data, depending on the GSE data structure| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_list.md new file mode 100644 index 000000000..2b9d70403 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_detail.md new file mode 100644 index 000000000..20d14aa7c --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_list.md new file mode 100644 index 000000000..26b5691bc --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_list.md new file mode 100644 index 000000000..f2fe10b16 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_detail.md new file mode 100644 index 000000000..4efcfde9d --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_list.md new file mode 100644 index 000000000..be9d9d098 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/manage_proc.md b/paas2/esb/components/confapis/jobv3/apidocs/en/manage_proc.md new file mode 100644 index 000000000..bc46f30d4 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/manage_proc.md @@ -0,0 +1,128 @@ +### Function Description + +Register hosting/unhosting processes on the server + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| op_type | int | yes |Operation type, optional value: 1: Register managed processes; 2: unmanage processes| +| process_infos | array | yes |For the process operation parameter array, see the following process_infos structure definition| + +#### process_infos + +| Fields | Type | Required | Description | +|-------------|------------|--------|------------| +| proc_name | string | yes |Process name, for example bk_gse| +| proc_owner | string | yes |Process owner (contact)| +| setup_path | string | no |Process path, for example,/usr/local/gse/sbin| +| pid_path | string | no |Path to pid file for process| +| cfg_path | string | no |Process profile path| +| log_path | string | no |Process log file path| +| start_cmd | string | no |Process start command| +| stop_cmd | string | no |Process stop command| +| restart_cmd | string | no |Process restart command| +| reload_cmd | string | no |Process reload command| +| kill_cmd | string | no |Process kill command| +| func_id | string | no |Process function ID defined by CC| +| instance_id | string | no |CC defined process instance ID| +| value_key | string | no |Agent management process index key. When the index key is empty. The index key takes setup_path+Proc_name. Note: If there are two managed processes with the same setup_path+Proc_name, specify value_key| +| type | int | no |Process managed type, 0: cycle execution process, 1: Resident process, 2: single execution process. Default 0| +| cpu_lmt | int | no |The process uses the cpu limit. The value [range of 0,100, and 10] means 10%. If the limit is exceeded, the agent will stop the process according to the configured stop_cmd. | +| mem_lmt | int | no |The process uses mem limit, the value range 0,100,10 means 10[%, exceeding] the limit agent will stop the process according to the configured stop_cmd. | +| cycle_time | int | no |Process loop execution cycle, cycle_time needs to be specified when type is 0. | +| instance_num | int | no |Number of process instances. | +| op_timeout | int | no |Process operation timeout. | +| start_check_begin_time | int | no |_("Start check time after process starts. ") }} | +| start_check_end_time | int | no |_("End check time after process starts. ") }} | +| ip_list | array | yes |IP object array, see ip_list structure definition below| + + +#### ip_list + +| 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", + "op_type": 1, + "process_infos": [ + { + "proc_name": "nginx", + "proc_owner": "root", + "setup_path": "/data/home/nginx/bin/", + "cfg_path": "/data/etc/nginx.conf", + "log_path": "/data/logs/nginx/", + "pid_path": "/data/var/run/nginx/", + "start_cmd": "echo start", + "stop_cmd": "echo stop", + "restart_cmd": "echo restart", + "reload_cmd": "echo reload", + "kill_cmd": "echo kill", + "func_id": "", + "instance_id": "", + "value_key": "key_test", + "type": 2, + "cpu_lmt": 20, + "mem_lmt": 30, + "cycle_time": 10, + "instance_num": 2, + "start_check_begin_time": 5, + "start_check_end_time": 5, + "op_timeout": 5, + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ] + } + ] +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "bk_gse_taskid": "GSETASK:20180315180551: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_gse_taskid | string | GSE task ID| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_job_instance.md b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_job_instance.md new file mode 100644 index 000000000..6cab9b1c0 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/operate_proc.md b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_proc.md new file mode 100644 index 000000000..a425d1175 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_proc.md @@ -0,0 +1,97 @@ +### Function Description + +Processes on the operation server + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| op_type | int | yes |Operation type, optional value: 0: Start process; 1: stop process (stop); 2: process status query; 3: Register managed process; 4: cancel managed process; 7: restart the process (restart); 8: reload; 9: kill process (kill)| +| process_infos | array | yes |For the process operation parameter array, see the following process_infos structure definition| + +#### process_infos + +| Fields | Type | Required | Description | +|-------------|------------|--------|------------| +| setup_path | string | yes |Process path, for example,/usr/local/gse/gseagent/plugins/unifyTlogc/sbin| +| proc_name | string | yes |Process name, for example bk_gse_unifyTlogc| +| pid_path | string | yes |Path to the pid file of the process, for example,/usr/local/gse/gseagent/plugins/unifyTlogc/log/bk_gse_unifyTlogc.pid| +| account | string | no | System account, not transferred to root by default| +| cmd_shell_ext | string | no | Extension of process action control script: sh: default shell for Linux or Cygwin,bat: dos scripts for Windows,ps1: Powershell script for Windows; Note: This is a unified configuration for all IPS under the ip_list parameter, so ensure that all IPS under the ip_list parameter passed by the interface can support the specified script. | +| cpu_lmt | int | no | The process uses the cpu limit, beyond which the agent calls the appropriate type of stopCmd to stop the process according to the configured cmd_Shel_ext. | +| mem_lmt | int | no | The process uses mem limits, beyond which the agent will call the appropriate type of stopCmd to stop the process according to the configured cmd_shelll_ext. | +| ip_list | array | yes |IP object array, see ip_list structure definition below| + +#### ip_list + +| 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", + "op_type": 1, + "process_infos": [ + { + "setup_path": "/usr/local/xxx", + "proc_name": "gseagent", + "pid_path": "/usr/local/xxx", + "account": "root", + "cmd_shell_ext": "bat", + "cpu_lmt": 50, + "mem_lmt": 30, + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ] + } + ] +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "bk_gse_taskid": "GSETASK:20180315180551: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 | +|-----------|-----------|-----------| +| bk_gse_taskid | string | GSE task ID| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_process.md b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_process.md new file mode 100644 index 000000000..f61d1f083 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_process.md @@ -0,0 +1,113 @@ +### Function Description + +Processes on the operation server are versioned v2 + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| op_type | int | yes |Operation type, optional value: 0: Start process; 1: stop the process (stop); 2: process status query; 3: Register managed process; 4: cancel managed process; 7: restart the process (restart); 8: reload; 9: kill process (kill)| +| process_infos | array | yes |For the process operation parameter array, see the following process_infos structure definition| + +#### process_infos + +| Fields | Type | Required | Description | +|-------------|------------|--------|------------| +| setup_path | string | yes |Process path, for example,/usr/local/gse/gseagent/plugins/unifyTlogc/sbin| +| proc_name | string | yes |Process name, for example bk_gse_unifyTlogc| +| pid_path | string | yes |Path to the pid file of the process, for example,/usr/local/gse/gseagent/plugins/unifyTlogc/log/bk_gse_unifyTlogc.pid| +| cfg_path | String | no | Configuration directory| +| log_path | String | no | Log directory| +| contact | String | no | Process owner (contact)| +| start_cmd | string | no | Process start command| +| stop_cmd | string | no | Process stop command| +| restart_cmd | string | no | Process restart command| +| reload_cmd | string | no | Process reload command| +| kill_cmd | string | no | Process kill command| +| func_id | string | no | Internal use field, which can be blank. CC defined process function id. | +| instance_id | string | no | Internal use field, which can be blank. CC defined process instance ID. | +| value_key | string | no | Agent management process index key, which can be null. When the index key is empty, the index key adopts setupPath+proceName. If there are two managed processes with the same setupPath+proceName, specify value_key to differentiate. | +| type | int | no | Process managed type. 0 is a periodic execution process, 1 is a resident process, and 2 is a single execution process| +| cycle_time | int | no | Process loop execution cycle| +| instance_num | int | no | Number of process instances| +| start_check_begin_time |int| no | Start check time aft process start| +| start_check_end_time | int| no | End check time after process starts| +| op_timeout | int | no | Process operation timeout| +| account | string | no | System account, not transferred to root by default| +| cpu_lmt | int | no | The process uses the cpu limit, beyond which the agent calls the appropriate type of stopCmd to stop the process according to the configured cmd_Shel_ext. | +| mem_lmt | int | no | The process uses the mem limit, beyond which the agent will call the appropriate type of stopCmd to stop the process according to the configured cmd_Shel_ext. | +| ip_list | array | yes |IP object array, see ip_list structure definition below| + +#### ip_list + +| 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", + "op_type": 1, + "process_infos": [ + { + "setup_path": "/usr/local/xxx", + "proc_name": "gseagent", + "pid_path": "/usr/local/xxx", + "account": "root", + "contact": "root", + "cpu_lmt": 50, + "mem_lmt": 30, + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ] + } + ] +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "bk_gse_taskid": "GSETASK:20180315180551: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 | +|-----------|-----------|-----------| +| bk_gse_taskid | string | GSE task ID| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_step_instance.md b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_step_instance.md new file mode 100644 index 000000000..7af9b8cb4 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/push_config_file.md b/paas2/esb/components/confapis/jobv3/apidocs/en/push_config_file.md new file mode 100644 index 000000000..f3d1973fc --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/push_config_file.md @@ -0,0 +1,129 @@ +### 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 | +| ------------------ | ----- | -------- | ----------------------------------- | +| ip_list | array | no | Static IP list, as defined in ip | +| dynamic_group_list | array | no | Dynamic grouping list, for definition, see dynamic_group | +| topo_node_list | array | no | For 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": "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" + } + ] + } +} +``` + +### 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/paas2/esb/components/confapis/jobv3/apidocs/en/save_cron.md b/paas2/esb/components/confapis/jobv3/apidocs/en/save_cron.md new file mode 100644 index 000000000..b8367f561 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/save_cron.md @@ -0,0 +1,390 @@ +### 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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 | +|-----------------------|-------|--------|------------| +| ip_list | array | no | Static IP list| +| dynamic_group_list | array | no | Dynamic grouping list| +| topo_node_list | array | no | Dynamic topo node list| + +#### 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", + "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. 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", + "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" + } + ] + } + } + ] +} +``` + +### 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_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 + }, + "job_request_id": "19b76b84e481846e" +} +``` +#### 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_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 + }, + "job_request_id": "69f5b499072003aa" +} +``` + +### 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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource range 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| +| 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_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/paas2/esb/components/confapis/jobv3/apidocs/en/set_base_report.md b/paas2/esb/components/confapis/jobv3/apidocs/en/set_base_report.md new file mode 100644 index 000000000..c65f841ee --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/set_base_report.md @@ -0,0 +1,87 @@ +### Function Description + +Turn on/off Agent basic data collection and reporting function + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +|-------------|------------|--------|------------| +| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| sys_id | int | yes |Report system information to dataId, if it is " 1," then close reporting| +| cpu_id | int | yes |cpu information is reported to dataId. If it is " 1," the report is closed.| +| mem_id | int | yes |mem information is reported to dataId. If it is "submit 1," the report will be closed.| +| net_id | int | yes |Report the network card information to dataId, and if it is " 1," close the report.| +| disk_id | int | yes |Report disk IO information to dataId, if it is " 1," then close reporting| +| proc_id | int | yes |Report the process information to dataId, and if it is "progress 1," close the report.| +| crontab_id | int | yes |Crontab reports dataId, and if it is "submit 1," the report will be closed| +| iptables_id | int | yes |Iptables information is reported to dataId, and if it is reported to be 1, reporting is closed.| +| ip_list | array | yes | IP object array, see ip_list structure definition below| + +#### ip_list + +| 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", + "sys_id": -1, + "cpu_id": -1, + "mem_id": -1, + "net_id": -1, + "disk_id": -1, + "proc_id": -1, + "crontab_id": -1, + "iptables_id": -1, + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ] +} +``` + +### Example of responses + +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "bk_gse_taskid": "GSETASK:20170621165117:10000" + } +} +``` + +### 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_gse_taskid | string | GSE task ID| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/update_credential.md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_credential.md new file mode 100644 index 000000000..49787fbe4 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/update_cron_status.md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_cron_status.md new file mode 100644 index 000000000..b33b42763 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/en/update_file_source.md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_file_source.md new file mode 100644 index 000000000..1c5bb14ef --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/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 range type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource range 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/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/batch_get_job_instance_ip_log.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/batch_get_job_instance_ip_log.md index 7d18e15e3..79e8e1fea 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/batch_get_job_instance_ip_log.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/batch_get_job_instance_ip_log.md @@ -10,16 +10,19 @@ | 字段 | 类型 | 必选 | 描述 | |-----------|------------|--------|------------| -| bk_biz_id | long | 是 | 业务ID | +| 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 | -| ip_list | array | 是 | 源/目标主机IP列表,定义见ip | +| 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 | +| bk_cloud_id | int | 是 | 管控区域ID | | ip | string | 是 | IP地址 | ### 请求参数示例 @@ -29,25 +32,19 @@ "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "bk_biz_id": 1, + "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" - } + "host_id_list": [ + 101,102 ] } ``` ### 返回结果示例 -#### 脚本执行步骤 +#### 文件分发步骤 ```json { "result": true, @@ -59,17 +56,20 @@ "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" }, @@ -86,6 +86,7 @@ { "mode": 0, "src_ip": { + "bk_host_id": 102, "bk_cloud_id": 0, "ip": "10.0.0.2" }, @@ -114,13 +115,13 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| #### data | 字段 | 类型 | 描述 | |-----------|-----------|-----------| -| bk_cloud_id | int | 目标服务器云区域ID | +| 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| @@ -130,7 +131,8 @@ | 字段 | 类型 | 描述 | |-----------|------------|--------| -| bk_cloud_id | long | 云区域ID | +| bk_host_id | long | 主机ID | +| bk_cloud_id | long | 管控区域ID | | ip | string | 目标IP地址 | | log_content | string | 脚本执行日志内容 | @@ -138,7 +140,8 @@ | 字段 | 类型 | 描述 | |-----------|------------|--------| -| bk_cloud_id | long | 云区域ID | +| bk_host_id | long | 主机ID | +| bk_cloud_id | long | 管控区域ID | | ip | string | 源/目标IP地址 | | file_logs | array | 文件分发日志内容。定义见file_log | @@ -146,7 +149,7 @@ | 字段 | 类型 | 描述 | |-----------|-----------|-----------| -| mode | 分发模式 | 0:上传;1:下载| +| mode | int | 分发模式。0:上传;1:下载| | src_ip | object |文件源主机IP。定义见ip | | src_path | string | 源文件路径 | | dest_ip | object | 分发目标主机IP,mode=1时有值。定义见ip | @@ -158,5 +161,6 @@ | 字段 | 类型 | 描述 | |-----------|------------|--------| -| bk_cloud_id | long | 云区域ID | +| bk_host_id | long | 主机ID | +| bk_cloud_id | long | 管控区域ID | | ip | string | IP地址 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/common.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/common.md index 09f8c704d..76f6c0b52 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/common.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/common.md @@ -8,21 +8,23 @@ | name | string | 否 | 全局变量名 | | description | string | 否 | 全局变量描述 | | type | int | 否 | 全局变量类型 | -| required | int | 否 | 模版/执行方案中该变量是否必填 | -| value | string | 否 | 字符、密码、数组类型的全局变量的值 | +| required | int | 否 | 变量是否必填 | +| value | string | 否 | 字符、密码、命名空间、数组类型的全局变量的值 | | server | object | 否 | 主机类型全局变量的值 | #### server | 字段 | 类型 | 必选 | 描述 | |-----------------------|-------|--------|------------| -| ip_list | array | 否 | 静态 IP 列表,定义见ip | +| 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 | +| bk_host_id | long | 是 | 主机ID | +| bk_cloud_id | int | 是 | 管控区域ID | | ip | string | 是 | IP地址 | #### dynamic_group diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_credential.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_credential.md index 8a162edd9..61a2e8d86 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_credential.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_credential.md @@ -10,7 +10,8 @@ | 字段 | 类型 | 必选 | 描述 | |----------------------------|------------|--------|------------| -| bk_biz_id | long | 是 | 业务 ID | +| 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 | 否 | 凭据描述 | @@ -27,7 +28,8 @@ "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "name": "testCredential", "type": "USERNAME_PASSWORD", "description": "This is a test credential", @@ -59,7 +61,7 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_file_source.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_file_source.md index 4c9394af6..7e9da62c9 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_file_source.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_file_source.md @@ -19,7 +19,8 @@ | 字段 | 类型 | 必选 | 描述 | |-----------------|------------|--------|------------| -| bk_biz_id | long | 是 | 业务 ID | +| 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 | @@ -41,7 +42,8 @@ "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "code": "sopsArtifactory", "alias": "标准运维制品库文件源", "type": "BLUEKING_ARTIFACTORY", @@ -76,7 +78,7 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/execute_job_plan.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/execute_job_plan.md index 5ecabe2f2..1b4106964 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/execute_job_plan.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/execute_job_plan.md @@ -10,7 +10,8 @@ | 字段 | 类型 | 必选 | 描述 | |-----------|------------|--------|------------| -| bk_biz_id | long | 是 | 业务ID | +| 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组件文档 | @@ -28,7 +29,8 @@ | 字段 | 类型 | 必选 | 描述 | | ------------------ | ----- | ---- | ----------------------------------- | -| ip_list | array | 否 | 静态 IP 列表,定义见ip | +| 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 | @@ -36,7 +38,7 @@ | 字段 | 类型 | 必选 | 描述 | | ----------- | ------ | ---- | -------- | -| bk_cloud_id | int | 是 | 云区域ID | +| bk_cloud_id | int | 是 | 管控区域ID | | ip | string | 是 | IP地址 | #### dynamic_group @@ -59,7 +61,8 @@ "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "job_plan_id": 100, "global_var_list": [ { @@ -70,15 +73,9 @@ "id": "blo8gojho0skft7pr5q0" } ], - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 101, + 102 ], "topo_node_list": [ { @@ -120,7 +117,6 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_execute_script.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_execute_script.md index 9589b2ef7..415c4708c 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_execute_script.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_execute_script.md @@ -10,14 +10,15 @@ | 字段 | 类型 | 必选 | 描述 | |---------------|------------|--------|------------| -| bk_biz_id | long | 是 | 业务ID | +| 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_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 | @@ -25,18 +26,20 @@ | 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 | + +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ------------------------------------------------------------ | +| 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地址 | +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | long | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | #### dynamic_group @@ -58,7 +61,8 @@ "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "script_version_id": 1, "script_content": "ZWNobyAkMQ==", "script_param": "aGVsbG8=", @@ -72,15 +76,9 @@ "id": "blo8gojho0skft7pr5q0" } ], - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 101, + 102 ], "topo_node_list": [ { @@ -117,7 +115,6 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_execute_sql.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_execute_sql.md index 7362d9fc5..373cb7996 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_execute_sql.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_execute_sql.md @@ -10,28 +10,30 @@ | 字段 | 类型 | 必选 | 描述 | |---------------|------------|--------|------------| -| bk_biz_id | long | 是 | 业务ID | +| 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帐号处获得。 | +| 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 | +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ------------------------------------------------------------ | +| 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 | +| bk_cloud_id | long | 是 | 管控区域ID | | ip | string | 是 | IP地址 | #### dynamic_group @@ -54,7 +56,8 @@ "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "script_version_id": 1, "timeout": 1000, "db_account_id": 32, @@ -64,15 +67,9 @@ "id": "blo8gojho0skft7pr5q0" } ], - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 101, + 102 ], "topo_node_list": [ { @@ -109,8 +106,6 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| - #### data | 字段 | 类型 | 描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_transfer_file.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_transfer_file.md index 613234436..816bffce6 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_transfer_file.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/fast_transfer_file.md @@ -7,9 +7,10 @@ #### 接口参数 | 字段 | 类型 |