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 @@ #### 接口参数 | 字段 | 类型 |
必选
| 描述 | |------------------|------------|--------|------------| -| bk_biz_id | long | 是 | 业务ID | -| account_alias | string | 否 | 目标执行帐号别名,可从账号页面获取,推荐使用。与account_id必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | -| account_id | long | 否 | 目标执行帐号ID,可从get_account_list接口获取。与account_alias必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| account_alias | string | 否 | 目标执行账号别名,可从账号页面获取,推荐使用。与account_id必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | +| account_id | long | 否 | 目标执行账号ID,可从get_account_list接口获取。与account_alias必须存在一个。当同时存在account_alias和account_id时,account_id优先。 | | file_target_path | string | 是 | 文件传输目标路径 | | file_source_list | array | 是 | 源文件对象数组,见下面file_source定义 | | timeout | int | 否 | 任务超时时间,秒,默认值为7200。取值范围1-86400。| @@ -33,23 +34,24 @@ | 字段 | 类型 | 必选 | 描述 | | ----- | ------ | ---- | ------------------------------------------------------------ | -| id | long | 否 | 源执行帐号ID,可从get_account_list接口获取。与alias必须存在一个。当同时存在alias和id时,id优先。 | -| alias | string | 否 | 源执行帐号别名,可从账号页面获取,推荐使用。与alias必须存在一个。当同时存在alias和id时,id优先。 | +| id | long | 否 | 源执行账号ID,可从get_account_list接口获取。与alias必须存在一个。当同时存在alias和id时,id优先。 | +| alias | string | 否 | 源执行账号别名,可从账号页面获取,推荐使用。与alias必须存在一个。当同时存在alias和id时,id优先。 | #### server -| 字段 | 类型 | 必选 | 描述 | -|-----------|------------|--------|------------| -| ip_list | array | 否 | 静态IP列表 | -| dynamic_group_list | array | 否 | 动态分组ID列表 | -| topo_node_list | array | 否 | 动态topo节点列表 | +| 字段 | 类型 | 必选 | 描述 | +| ------------------ | ----- | ---- | ------------------------------------------------------------ | +| 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_list +#### ip -| 字段 | 类型 | 必选 | 描述 | -|-----------|------------|--------|------------| -| bk_cloud_id | long | 是 | 云区域ID | -| ip | string | 是 | IP地址 | +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | -------- | +| bk_cloud_id | long | 是 | 管控区域ID | +| ip | string | 是 | IP地址 | #### topo_node_list @@ -64,7 +66,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", "file_target_path": "/tmp/", "transfer_mode": 1, "file_source_list": [ @@ -84,15 +87,9 @@ "id": "blo8gojho0sabc7priuy" } ], - "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": [ { @@ -127,15 +124,9 @@ "id": "blo8gojho0sabc7priuy" } ], - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 103, + 104 ], "topo_node_list": [ { @@ -171,7 +162,6 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/generate_local_file_upload_url.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/generate_local_file_upload_url.md index d2d809399..84f49cacd 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/generate_local_file_upload_url.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/generate_local_file_upload_url.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 | | file_name_list | string[] | 是 | 要上传的文件名列表 | @@ -21,7 +22,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", "file_name_list": [ "file1.txt", "file2.txt" @@ -61,7 +63,7 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_account_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_account_list.md index ddeca6f54..99909205a 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_account_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_account_list.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 | | category | int | 否 | 账号用途(1:系统账号,2:DB账号),不传则不区分 | | start | int | 否 | 分页记录起始位置,不传默认为0 | | length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | @@ -22,7 +23,8 @@ "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "bk_biz_id": 2, + "bk_scope_type": "biz", + "bk_scope_id": "1", "category": 1, "start": 0, "length": 1 @@ -48,7 +50,8 @@ "type": 1, "os": "Linux", "creator": "admin", - "bk_biz_id": 2, + "bk_scope_type": "biz", + "bk_scope_id": "1", "create_time": 1614659536108, "last_modify_user": "admin", "last_modify_time": 1614659536116 @@ -70,19 +73,20 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data.data | 字段 | 类型 | 描述 | |-----------|-----------|-----------| | id | long | 账号ID | -| bk_biz_id | long | 业务ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | account | string | 账号名称 | | alias | string | 账号别名 | | category | int | 账号用途(1:系统账号,2:DB账号) | | type | int | 账号类型(1:Linux,2:Windows,9:MySQL,10:Oracle,11:DB2)| -| db_system_account_id | long | 账号用途为DB账号时该字段生效,表示DB帐号对应的系统账号ID | +| db_system_account_id | long | 账号用途为DB账号时该字段生效,表示DB账号对应的系统账号ID | | os | string | 账号用途为系统账号时该字段生效,账号对应的OS | | creator | string | 创建人 | | create_time | long | 创建时间Unix时间戳(ms) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_cron_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_cron_detail.md index 896f1dc65..8f0ec145b 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_cron_detail.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_cron_detail.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 | | id | long | 否 | 定时任务 ID | ### 请求参数示例 @@ -20,7 +21,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", "id": 1 } ``` @@ -33,7 +35,8 @@ "code": 0, "message": "", "data": { - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "job_plan_id": 100, "id": 1, "name": "test", @@ -54,10 +57,12 @@ ], "ip_list": [ { + "bk_host_id": 101, "bk_cloud_id": 0, "ip": "10.0.0.1" }, { + "bk_host_id": 102, "bk_cloud_id": 0, "ip": "10.0.0.2" } @@ -94,21 +99,22 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data | 字段 | 类型 | 描述 | |------------------|-----------|-----------| -| 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 | | id | long | 定时作业 ID | | name | string | 定时作业名称 | | status | int | 定时作业状态:1.已启动、2.已暂停 | | expression | string | 定时任务crontab的定时规则,新建时必填,修改时选填。各字段含义为:分 时 日 月 周,如: 0/5 * * * ? 表示每5分钟执行一次 | | global_var_list | array | 全局变量信息 | -| creator | string | 作业创建人帐号 | +| creator | string | 作业创建人账号 | | create_time | long | 创建时间,Unix 时间戳 | -| last_modify_user | string | 作业修改人帐号 | +| last_modify_user | string | 作业修改人账号 | | last_modify_time | long | 最后修改时间,Unix 时间戳 | #### global_var @@ -131,7 +137,8 @@ | 字段 | 类型 | 描述 | |-------------|---------|---------| -| bk_cloud_id | int | 云区域ID | +| bk_host_id | long | 主机ID | +| bk_cloud_id | int | 管控区域ID | | ip | string | IP地址 | #### topo_node diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_cron_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_cron_list.md index aa506b60a..e34d2a479 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_cron_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_cron_list.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 | | name | string | 否 | 定时作业名称 | | id | long | 否 | 定时任务 ID,如果存在则忽略其他筛选条件,只查询这个指定的作业信息 | | status | int | 否 | 定时作业状态:1.已启动、2.已暂停 | -| creator | string | 否 | 定时作业创建人帐号 | +| creator | string | 否 | 定时作业创建人账号 | | create_time_start | long | 否 | 创建起始时间,Unix 时间戳(s) | | create_time_end | long | 否 | 创建结束时间,Unix 时间戳(s) | -| last_modify_user | string | 否 | 作业修改人帐号 | +| last_modify_user | string | 否 | 作业修改人账号 | | last_modify_time_start | long | 否 | 最后修改起始时间,Unix 时间戳(s) | | last_modify_time_end | long | 否 | 最后修改结束时间,Unix 时间戳(s) | | start | int | 否 | 默认 0 表示从第 1 条记录开始返回 | @@ -30,7 +31,8 @@ "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "bk_biz_id": 2, + "bk_scope_type": "biz", + "bk_scope_id": "1", "name": "test", "id": 1000031, "status": 1, @@ -57,10 +59,11 @@ "data": [ { "id": 1000031, - "name": "tylertest动态分组ID变更", + "name": "test", "status": 1, "creator": "admin", - "bk_biz_id": 2, + "bk_scope_type": "biz", + "bk_scope_id": "1", "job_plan_id": 1000193, "expression": "* * * * * *", "create_time": 1617285956, @@ -84,18 +87,19 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data | 字段 | 类型 | 描述 | |------------------|-----------|-----------| -| 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 | | id | long | 定时作业 ID | | name | string | 定时作业名称 | | status | int | 定时作业状态:1.已启动、2.已暂停 | | expression | string | 定时任务crontab的定时规则,新建时必填,修改时选填。各字段含义为:分 时 日 月 周,如: 0/5 * * * ? 表示每5分钟执行一次 | -| creator | string | 作业创建人帐号 | +| creator | string | 作业创建人账号 | | create_time | long | 创建时间,Unix 时间戳(s) | -| last_modify_user | string | 作业修改人帐号 | +| last_modify_user | string | 作业修改人账号 | | last_modify_time | long | 最后修改时间,Unix 时间戳(s) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_global_var_value.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_global_var_value.md index 58a6f1bb1..a44aa87b3 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_global_var_value.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_global_var_value.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_instance_id | long | 是 | 作业实例ID | ### 请求参数示例 @@ -20,7 +21,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_instance_id": 100 } ``` @@ -80,16 +82,15 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| #### data | 字段 | 类型 | 描述 | |-----------|-----------|-----------| | job_instance_id | long | 作业实例ID | -| job_instance_var_list | array | 作业实例全局变量值。定义见step_instance_var | +| step_instance_var_list | array | 作业步骤实例全局变量值。定义见step_instance_var | -**step_instance_var** +#### step_instance_var | 字段 | 类型 | 描述 | | ---------------- | ----- | -------------------------------- | @@ -117,7 +118,8 @@ | 字段 | 类型 | 必选 | 描述 | | ----------- | ------ | ---- | -------- | -| 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/get_job_instance_ip_log.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_ip_log.md index 54c61efcf..ac4a91027 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_ip_log.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_ip_log.md @@ -10,11 +10,13 @@ | 字段 | 类型 | 必选 | 描述 | |-----------|------------|--------|------------| -| 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 | -| bk_cloud_id | int | 是 | 目标服务器云区域ID | -| ip | string | 是 | 目标服务器IP | +| bk_host_id | long | 否 | 目标主机host_id | +| bk_cloud_id | int | 否 | ***不推荐使用,建议使用host_id参数,如果存在bk_host_id将忽略该参数***。目标服务器管控区域ID | +| ip | string | 否 | ***不推荐使用,建议使用host_id参数,如果存在bk_host_id将忽略该参数***。目标主机IP | ### 请求参数示例 @@ -23,11 +25,11 @@ "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": 50, "step_instance_id": 100, - "bk_cloud_id": 0, - "ip": "10.0.0.1" + "bk_host_id": 101 } ``` @@ -41,6 +43,7 @@ "message": "", "data": { "log_type": 1, + "bk_host_id": 101, "ip": "10.0.0.1", "bk_cloud_id": 0, "log_content": "[2018-03-15 14:39:30][PID:56875] job_start\n" @@ -57,17 +60,20 @@ "message": "", "data": { "log_type": 2, + "bk_host_id": 101, "ip": "10.0.0.1", "bk_cloud_id": 0, "file_logs": [ { "mode": 1, "src_ip": { + "host_id": 102, "bk_cloud_id": 0, "ip": "10.0.0.2" }, "src_path": "/data/1.log", "dest_ip": { + "bk_host_id": 101, "bk_cloud_id": 0, "ip": "10.0.0.1" }, @@ -78,6 +84,7 @@ { "mode": 0, "src_ip": { + "bk_host_id": 102, "bk_cloud_id": 0, "ip": "10.0.0.2" }, @@ -105,13 +112,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-文件分发任务日志 | | log_content | string | 作业脚本输出的日志内容 | @@ -122,16 +129,17 @@ | 字段 | 类型 | 描述 | |-----------|-----------|-----------| | mode | 分发模式 | 0:上传;1:下载| -| src_ip | object |文件源主机IP。定义见ip | +| src_ip | object |文件源主机,定义见host | | src_path | string | 源文件路径 | -| dest_ip | object | 分发目标主机IP,mode=1时有值。定义见ip | +| dest_ip | object | 分发目标主机,mode=1时有值。定义见host | | dest_path | string | 目标路径,mode=1时有值 | | status | int | 任务状态。1-等待开始;2-上传中;3-下载中;4-成功;5-失败 | | log_content | string | 文件分发日志内容 | -#### ip +#### Host | 字段 | 类型 | 描述 | |-----------|------------|--------| -| bk_cloud_id | long | 云区域ID | -| ip | string | IP地址 | +| bk_host_id | long | 主机ID | +| bk_cloud_id | long | 管控区域ID | +| ip | string | IP地址 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_list.md index 3c18906f5..e1680166c 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_list.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 | | create_time_start | long | 是 | 创建起始时间,Unix 时间戳,单位毫秒 | | create_time_end | long | 是 | 创建结束时间,Unix 时间戳,单位毫秒 | | job_instance_id | long | 否 | 任务实例ID。 如果出入job_instance_id,将忽略其他查询条件 | @@ -31,7 +32,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", "type": 0, "launch_mode": 1, "status": 3, @@ -54,7 +56,8 @@ "data": { "data": [ { - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "id": 100, "job_template_id": 1, "job_plan_id": 1, @@ -86,13 +89,14 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data | 字段 | 类型 | 描述 | | --------------- | ------ | ------------------------------------------------------------ | -| bk_biz_id | long | 业务 ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | id | long | 执行方案 ID | | job_template_id | long | 作业模版 ID,当任务为执行方案的时候有值 | | job_plan_id | long | 作业执行方案 ID,当任务为执行方案的时候有值 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_status.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_status.md index 321a078bc..2b80c25b7 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_status.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_status.md @@ -10,9 +10,10 @@ | 字段 | 类型 | 必选 | 描述 | |------------------|------------|--------|------------| -| 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 | -| return_ip_result | boolean | 否 | 是否返回每个ip上的任务详情,对应返回结果中的step_ip_result_list。默认值为false。 | +| return_ip_result | boolean | 否 | 是否返回每个主机上的任务详情,对应返回结果中的step_ip_result_list。默认值为false。 | ### 请求参数示例 @@ -21,7 +22,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_instance_id": 100 } ``` @@ -37,7 +39,8 @@ "finished": true, "job_instance": { "job_instance_id": 100, - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "name": "API Quick execution script1521089795887", "create_time": 1605064271000, "status": 4, @@ -58,6 +61,7 @@ "start_time": 1605064271000, "step_ip_result_list": [ { + "bk_host_id": 101, "ip": "10.0.0.1", "bk_cloud_id": 0, "status": 9, @@ -84,7 +88,6 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| #### data @@ -104,7 +107,8 @@ | start_time | long | 开始执行时间,Unix时间戳,单位毫秒 | | end_time | long | 执行结束时间,Unix时间戳,单位毫秒 | | total_time | int | 总耗时,单位毫秒 | -| 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 @@ -127,8 +131,9 @@ | 字段 | 类型 | 描述 | |-----------|-----------|-----------| +| bk_host_id | long | 主机ID | | ip | string | IP | -| bk_cloud_id | long | 云区域ID | +| bk_cloud_id | long | 管控区域ID | | status | int | 作业执行状态:1.Agent异常; 5.等待执行; 7.正在执行; 9.执行成功; 11.执行失败; 12.任务下发失败; 403.任务强制终止成功; 404.任务强制终止失败 | | tag | string | 用户通过job_success/job_fail函数模板自定义输出的结果。仅脚本任务存在该参数 | | exit_code | int | 脚本任务exit code | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_plan_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_plan_detail.md index 2e01d73b3..f7bbba5eb 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_plan_detail.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_plan_detail.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 | ### 请求参数示例 @@ -20,7 +21,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 } ``` @@ -32,7 +34,8 @@ "code": 0, "message": "", "data": { - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "job_plan_id": 100, "name": "test", "creator": "admin", @@ -65,10 +68,12 @@ ], "ip_list": [ { + "bk_host_id": 101, "bk_cloud_id": 0, "ip": "10.0.0.1" }, { + "bk_host_id": 102, "bk_cloud_id": 0, "ip": "10.0.0.2" } @@ -155,10 +160,12 @@ ], "ip_list": [ { + "bk_host_id": 103, "bk_cloud_id": 0, "ip": "10.0.0.3" }, { + "bk_host_id": 104, "bk_cloud_id": 0, "ip": "10.0.0.4" } @@ -193,18 +200,18 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| #### data | 字段 | 类型 | 描述 | |------------------|-----------|-----------| -| 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 | | name | string | 作业名称 | -| creator | string | 作业创建人帐号 | +| creator | string | 作业创建人账号 | | create_time | long | 创建时间,Unix 时间戳 | -| last_modify_user | string | 作业修改人帐号 | +| last_modify_user | string | 作业修改人账号 | | last_modify_time | long | 最后修改时间,Unix 时间戳 | | step_list | array | 步骤对象 | | global_var_list | array | 全局变量信息 | @@ -230,7 +237,7 @@ | script_param | string | 脚本参数 | | script_timeout | int | 脚本超时时间,秒。默认3600,取值范围60-86400 | | is_param_sensitive | int | 是否敏感参数, 0.不是(默认),1.是。| -| account | object | 执行帐号名/别名 | +| account | object | 执行账号名/别名 | #### file_info | 字段 | 类型 | 描述 | @@ -265,7 +272,8 @@ #### ip | 字段 | 类型 | 描述 | |-------------|---------|---------| -| bk_cloud_id | int | 云区域ID | +| bk_host_id | long | 主机ID | +| bk_cloud_id | int | 管控区域ID | | ip | string | IP地址 | #### dynamic_group @@ -289,7 +297,7 @@ | 字段 | 类型 | 描述 | |-----------------|---------|-----------| | file_list | array | 源文件的绝对路径数组,支持多个文件 | -| account | object | 执行帐号名/别名 | +| account | object | 执行账号名/别名 | | server | object | 目标服务器 | | file_type | int | 文件源类型,1:服务器文件,2:本地文件,3:第三方文件源文件 | | file_source_id | int | 文件源类型为第三方文件源文件时的第三方文件源Id | @@ -298,5 +306,5 @@ | 字段 | 类型 | 描述 | |-----------------|---------|-----------| | path | string | 目标文件存放的路径 | -| account | object | 执行帐号名/别名| +| account | object | 执行账号名/别名| | server | object | 目标服务器 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_plan_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_plan_list.md index 7c98d4a3d..b8f174c7a 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_plan_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_plan_list.md @@ -10,13 +10,14 @@ | 字段 | 类型 | 必选 | 描述 | |------------------------|------------|--------|------------| -| bk_biz_id | long | 是 | 业务 ID | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | job_template_id | long | 否 | 作业模版 ID | -| creator | string | 否 | 作业执行方案创建人帐号 | +| creator | string | 否 | 作业执行方案创建人账号 | | name | string | 否 | 作业执行方案名称,模糊匹配 | | create_time_start | long | 否 | 创建起始时间,Unix 时间戳 | | create_time_end | long | 否 | 创建结束时间,Unix 时间戳 | -| last_modify_user | string | 否 | 作业执行方案修改人帐号 | +| last_modify_user | string | 否 | 作业执行方案修改人账号 | | last_modify_time_start | long | 否 | 最后修改起始时间,Unix 时间戳 | | last_modify_time_end | long | 否 | 最后修改结束时间,Unix 时间戳 | | start | int | 否 | 默认0表示从第1条记录开始返回 | @@ -29,7 +30,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_template_id": 1, "creator": "admin", "name": "test", @@ -53,7 +55,8 @@ "data": { "data": [ { - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "id": 100, "job_template_id": 1, "name": "test", @@ -80,17 +83,17 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| #### data | 字段 | 类型 | 描述 | |------------------|-----------|-----------| -| bk_biz_id | long | 业务 ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | id | long | 执行方案 ID | | job_template_id | long | 作业模版 ID | | name | string | 执行方案名称 | -| creator | string | 创建人帐号 | +| creator | string | 创建人账号 | | create_time | long | 创建时间,Unix 时间戳 | -| last_modify_user | string | 修改人帐号 | +| last_modify_user | string | 修改人账号 | | last_modify_time | long | 最后修改时间,Unix 时间戳 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_template_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_template_list.md index e9cb11fe6..ca97a9096 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_template_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_template_list.md @@ -10,12 +10,13 @@ | 字段 | 类型 | 必选 | 描述 | |------------------------|------------|--------|------------| -| bk_biz_id | long | 是 | 业务 ID | -| creator | string | 否 | 作业执行方案创建人帐号 | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| creator | string | 否 | 作业执行方案创建人账号 | | name | string | 否 | 作业执行方案名称,模糊匹配 | | create_time_start | long | 否 | 创建起始时间,Unix 时间戳 | | create_time_end | long | 否 | 创建结束时间,Unix 时间戳 | -| last_modify_user | string | 否 | 作业执行方案修改人帐号 | +| last_modify_user | string | 否 | 作业执行方案修改人账号 | | last_modify_time_start | long | 否 | 最后修改起始时间,Unix 时间戳 | | last_modify_time_end | long | 否 | 最后修改结束时间,Unix 时间戳 | | start | int | 否 | 默认0表示从第1条记录开始返回 | @@ -28,7 +29,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", "creator": "admin", "name": "test", "create_time_start": 1546272000000, @@ -51,7 +53,8 @@ "data": { "data": [ { - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "id": 100, "name": "test", "creator": "admin", @@ -77,16 +80,16 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| #### data | 字段 | 类型 | 描述 | |------------------|-----------|-----------| -| bk_biz_id | long | 业务 ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | id | long | 作业模版 ID | | name | string | 作业模版名称 | -| creator | string | 创建人帐号 | +| creator | string | 创建人账号 | | create_time | long | 创建时间,Unix 时间戳 | -| last_modify_user | string | 修改人帐号 | +| last_modify_user | string | 修改人账号 | | last_modify_time | long | 最后修改时间,Unix 时间戳 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_list.md index 8b016fc05..07bc0781c 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_list.md @@ -22,7 +22,7 @@ "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "name": "脚本1", + "name": "a.sh", "script_language": 1, "start": 0, "length": 10 @@ -67,7 +67,6 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_detail.md index 4eb6605d3..3d7ff5543 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_detail.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_detail.md @@ -57,7 +57,7 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_list.md index b4460daf2..d94e992c0 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_list.md @@ -68,7 +68,7 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_list.md index 502a9c862..be669e0bb 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_list.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 | 否 | 脚本名称,支持模糊查询 | | script_language | int | 否 | 脚本语言。0:所有脚本类型,1:shell,2:bat,3:perl,4:python,5:powershell,6:sql。默认值为0 | | start | int | 否 | 分页记录起始位置,不传默认为0 | @@ -23,7 +24,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": "脚本1", "script_language": 1, "start": 0, @@ -42,7 +44,8 @@ "data": [ { "id": "000dbdddc06c453baf1f2decddf00c69", - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "name": "a.sh", "script_language": 1, "online_script_version_id": 100, @@ -69,14 +72,15 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data | 字段 | 类型 | 描述 | |-----------|-----------|-----------| | id | string | 脚本ID | -| bk_biz_id | long | 业务ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | name | string | 脚本名称 | | script_language | int | 脚本语言。1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - SQL | | online_script_version_id | long | 已上线脚本版本ID;如果脚本没有已上线版本,该值为空 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_detail.md index 890b37e1b..ca831aba6 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_detail.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_detail.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 | | id | long | 是 | 脚本版本ID,若传入则以此条件为准屏蔽其他条件 | | script_id | string | 否 | 脚本ID(可与version一起传入定位某个脚本版本) | | version | string | 否 | 脚本版本(可与script_id一起传入定位某个脚本版本) | @@ -22,7 +23,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", "id": 1 } ``` @@ -36,7 +38,8 @@ "message": "success", "data": { "id": 1, - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "script_id": "000dbdddc06c453baf1f2decddf00c69", "version": "V1.0", "content": "#!/bin/bash***", @@ -60,14 +63,15 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data | 字段 | 类型 | 描述 | |-----------|-----------|-----------| | id | long | 脚本版本ID | -| bk_biz_id | long | 业务ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | script_id | string | 脚本版本所属的脚本ID | | version | string | 版本号 | | content | string | 脚本版本内容 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_list.md index ed059a253..01f07044a 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_list.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 | | script_id | string | 是 | 脚本ID | | return_script_content | bool | 否 | 是否需要返回脚本内容。true:返回脚本内容;false:不返回脚本内容。默认为false。 | | start | int | 否 | 分页记录起始位置,不传默认为0 | @@ -23,7 +24,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_id": "000dbdddc06c453baf1f2decddf00c69", "return_script_content": true, "start": 0, @@ -42,7 +44,8 @@ "data": [ { "id": 1, - "bk_biz_id": 1, + "bk_scope_type": "biz", + "bk_scope_id": "1", "script_id": "000dbdddc06c453baf1f2decddf00c69", "version": "V1.0", "content": "#!/bin/bash***", @@ -71,14 +74,15 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data | 字段 | 类型 | 描述 | |-----------|-----------|-----------| | id | long | 脚本版本ID | -| bk_biz_id | long | 业务ID | +| bk_scope_type | string |资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | script_id | string | 脚本版本所属的脚本ID | | version | string | 版本号 | | content | string | 脚本内容 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/manage_proc.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/manage_proc.md deleted file mode 100644 index 677e99b35..000000000 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/manage_proc.md +++ /dev/null @@ -1,126 +0,0 @@ -### 功能描述 - -对服务器上的进程进行注册托管/取消托管 - -### 请求参数 - -{{ common_args_desc }} - -#### 接口参数 - -| 字段 | 类型 | 必选 | 描述 | -|-------------|------------|--------|------------| -| bk_biz_id | int | 是 | 业务ID | -| op_type | int | 是 | 操作类型,可选值:1:注册托管进程; 2:取消托管进程 | -| process_infos | array | 是 | 进程操作参数数组,见下面process_infos结构定义 | - -#### process_infos - -| 字段 | 类型 | 必选 | 描述 | -|-------------|------------|--------|------------| -| proc_name | string | 是 | 进程名称, 例如bk_gse | -| proc_owner | string | 是 | 进程属主(联系人) | -| setup_path | string | 否 | 进程路径, 例如/usr/local/gse/sbin | -| pid_path | string | 否 | 进程的pid文件所在路径 | -| cfg_path | string | 否 | 进程配置文件路径 | -| log_path | string | 否 | 进程日志文件路径 | -| start_cmd | string | 否 | 进程启动命令 | -| stop_cmd | string | 否 | 进程停止命令 | -| restart_cmd | string | 否 | 进程重启命令 | -| reload_cmd | string | 否 | 进程reload命令 | -| kill_cmd | string | 否 | 进程kill命令 | -| func_id | string | 否 | CC定义的进程功能ID | -| instance_id | string | 否 | CC定义的进程实例ID | -| value_key | string | 否 | Agent管理进程索引key。当索引key为空的话。索引key采用setup_path+proc_name。注:如果有两个托管进程setup_path+proc_name相同,请指定value_key | -| type | int | 否 | 进程托管类型,0:周期执行进程,1:常驻进程,2:单次执行进程。默认0 | -| cpu_lmt | int | 否 | 进程使用cpu限制,取值范围[0, 100],10表示10%,超过限制agent会根据配置的stop_cmd停止进程。 | -| mem_lmt | int | 否 | 进程使用mem限制,取值范围[0, 100],10表示10%,超过限制agent会根据配置的stop_cmd停止进程。 | -| cycle_time | int | 否 | 进程循环执行周期,type为0时cycle_time需要指定。 | -| instance_num | int | 否 | 进程实例个数。 | -| op_timeout | int | 否 | 进程操作超时时间。 | -| start_check_begin_time | int | 否 | _("进程启动后开始检查时间。") }} | -| start_check_end_time | int | 否 | _("进程启动后结束检查时间。") }} | -| ip_list | array | 是 | IP对象数组,见下面ip_list结构定义 | - - -#### ip_list - -| 字段 | 类型 | 必选 | 描述 | -|-------------|------------|--------|------------| -| bk_cloud_id | int | 是 | 云区域ID | -| ip | string | 是 | IP地址 | - -### 请求参数示例 - -```json -{ - "bk_app_code": "esb_test", - "bk_app_secret": "xxx", - "bk_token": "xxx", - "bk_biz_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" - } - ] - } - ] -} -``` - -### 返回结果示例 - -```json -{ - "result": true, - "code": 0, - "message": "", - "data": { - "bk_gse_taskid": "GSETASK:20180315180551:1000" - } -} -``` - -### 返回结果参数说明 - -#### response -| 字段 | 类型 | 描述 | -|-----------|-----------|-----------| -| result | bool | 请求成功与否。true:请求成功;false请求失败 | -| code | int | 错误编码。 0表示success,>0表示失败错误 | -| message | string | 请求失败返回的错误信息| -| data | object | 请求返回的数据| -| permission | object | 权限信息| -| request_id | string | 请求链id| - -#### data - -| 字段 | 类型 | 描述 | -|-----------|-----------|-----------| -| bk_gse_taskid | string | GSE任务ID | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_job_instance.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_job_instance.md index 4e77a4e39..271cff048 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_job_instance.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_job_instance.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_instance_id | long | 是 | 作业实例ID | | operation_code | int | 是 | 操作类型:1、终止作业 | @@ -21,7 +22,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_instance_id": 100, "operation_code": 1 } @@ -50,7 +52,7 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_proc.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_proc.md deleted file mode 100644 index 8a5398ffb..000000000 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_proc.md +++ /dev/null @@ -1,95 +0,0 @@ -### 功能描述 - -操作服务器上的进程 - -### 请求参数 - -{{ common_args_desc }} - -#### 接口参数 - -| 字段 | 类型 | 必选 | 描述 | -|-------------|------------|--------|------------| -| bk_biz_id | int | 是 | 业务ID | -| op_type | int | 是 | 操作类型,可选值:0:启动进程(start); 1:停止进程(stop); 2:进程状态查询; 3:注册托管进程; 4:取消托管进程; 7:重启进程(restart); 8:重新加载进(reload); 9:杀死进程(kill) | -| process_infos | array | 是 | 进程操作参数数组,见下面process_infos结构定义 | - -#### process_infos - -| 字段 | 类型 | 必选 | 描述 | -|-------------|------------|--------|------------| -| setup_path | string | 是 | 进程路径,例如/usr/local/gse/gseagent/plugins/unifyTlogc/sbin | -| proc_name | string | 是 | 进程名称,例如bk_gse_unifyTlogc | -| pid_path | string | 是 | 进程的pid文件所在路径, 例如/usr/local/gse/gseagent/plugins/unifyTlogc/log/bk_gse_unifyTlogc.pid | -| account | string | 否 | 系统帐号,默认不传为root | -| cmd_shell_ext | string | 否 | 进程操作控制脚本的扩展名: sh:默认值shell适于Linux或cygwin,bat:windows的dos脚本,ps1:windows的Powershell脚本;注意:这个是针对ip_list参数下所有IP统一配置,所以确保接口传递的ip_list参数下所有IP都能支持指定的脚本。 | -| cpu_lmt | int | 否 | 进程使用cpu限制,超过限制agent会根据配置的cmd_shell_ext调用相应类型的stopCmd停止进程。 | -| mem_lmt | int | 否 | 进程使用mem限制,超过限制agent会根据配置的cmd_shell_ext调用相应类型的stopCmd停止进程。 | -| ip_list | array | 是 | IP对象数组,见下面ip_list结构定义 | - -#### ip_list - -| 字段 | 类型 | 必选 | 描述 | -|-------------|------------|--------|------------| -| bk_cloud_id | int | 是 | 云区域ID | -| ip | string | 是 | IP地址 | - -### 请求参数示例 - -```json -{ - "bk_app_code": "esb_test", - "bk_app_secret": "xxx", - "bk_token": "xxx", - "bk_biz_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" - } - ] - } - ] -} -``` - -### 返回结果示例 - -```json -{ - "result": true, - "code": 0, - "message": "", - "data": { - "bk_gse_taskid": "GSETASK:20180315180551:1000" - } -} -``` - -### 返回结果参数说明 - -#### response -| 字段 | 类型 | 描述 | -|-----------|-----------|-----------| -| result | bool | 请求成功与否。true:请求成功;false请求失败 | -| code | int | 错误编码。 0表示success,>0表示失败错误 | -| message | string | 请求失败返回的错误信息| -| data | object | 请求返回的数据| -| permission | object | 权限信息| -| request_id | string | 请求链id| - -#### data - -| 字段 | 类型 | 描述 | -|-----------|-----------|-----------| -| bk_gse_taskid | string | GSE任务ID | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_process.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_process.md deleted file mode 100644 index d38a22885..000000000 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_process.md +++ /dev/null @@ -1,111 +0,0 @@ -### 功能描述 - -操作服务器上的进程-v2版本 - -### 请求参数 - -{{ common_args_desc }} - -#### 接口参数 - -| 字段 | 类型 | 必选 | 描述 | -|-------------|------------|--------|------------| -| bk_biz_id | int | 是 | 业务ID | -| op_type | int | 是 | 操作类型,可选值:0:启动进程(start); 1:停止进程(stop); 2:进程状态查询; 3:注册托管进程; 4:取消托管进程; 7:重启进程(restart); 8:重新加载进(reload); 9:杀死进程(kill) | -| process_infos | array | 是 | 进程操作参数数组,见下面process_infos结构定义 | - -#### process_infos - -| 字段 | 类型 | 必选 | 描述 | -|-------------|------------|--------|------------| -| setup_path | string | 是 | 进程路径,例如/usr/local/gse/gseagent/plugins/unifyTlogc/sbin | -| proc_name | string | 是 | 进程名称,例如bk_gse_unifyTlogc | -| pid_path | string | 是 | 进程的pid文件所在路径, 例如/usr/local/gse/gseagent/plugins/unifyTlogc/log/bk_gse_unifyTlogc.pid | -| cfg_path | String | 否 | 配置目录 | -| log_path | String | 否 | 日志目录 | -| contact | String | 否 | 进程属主(联系人) | -| start_cmd | string | 否 | 进程启动命令 | -| stop_cmd | string | 否 | 进程停止命令 | -| restart_cmd | string | 否 | 进程重启命令 | -| reload_cmd | string | 否 | 进程重新加载命令 | -| kill_cmd | string | 否 | 进程强杀命令 | -| func_id | string | 否 | 内部使用字段,可为空。CC定义的进程功能ID。 | -| instance_id | string | 否 | 内部使用字段,可为空。CC定义的进程实例ID。 | -| value_key | string | 否 | Agent管理进程索引key,可为空。当索引key为空时,索引key采用setupPath+proceName。如果有两个托管进程 setupPath+proceName相同,则需指定value_key,以作区分。 | -| type | int | 否 | 进程托管类型。0为周期执行进程,1为常驻进程,2为单次执行进程 | -| cycle_time | int | 否 | 进程循环执行周期 | -| instance_num | int | 否 | 进程实例数 | -| start_check_begin_time |int| 否 | 进程启动后开始检查时间 | -| start_check_end_time |int| 否 | 进程启动后结束检查时间 | -| op_timeout |int | 否 | 进程操作超时时间 | -| account | string | 否 | 系统帐号,默认不传为root | -| cpu_lmt | int | 否 | 进程使用cpu限制,超过限制agent会根据配置的cmd_shell_ext调用相应类型的stopCmd停止进程。 | -| mem_lmt | int | 否 | 进程使用mem限制,超过限制agent会根据配置的cmd_shell_ext调用相应类型的stopCmd停止进程。 | -| ip_list | array | 是 | IP对象数组,见下面ip_list结构定义 | - -#### ip_list - -| 字段 | 类型 | 必选 | 描述 | -|-------------|------------|--------|------------| -| bk_cloud_id | int | 是 | 云区域ID | -| ip | string | 是 | IP地址 | - -### 请求参数示例 - -```json -{ - "bk_app_code": "esb_test", - "bk_app_secret": "xxx", - "bk_token": "xxx", - "bk_biz_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" - } - ] - } - ] -} -``` - -### 返回结果示例 - -```json -{ - "result": true, - "code": 0, - "message": "", - "data": { - "bk_gse_taskid": "GSETASK:20180315180551:1000" - } -} -``` - -### 返回结果参数说明 - -#### response -| 字段 | 类型 | 描述 | -|-----------|-----------|-----------| -| result | bool | 请求成功与否。true:请求成功;false请求失败 | -| code | int | 错误编码。 0表示success,>0表示失败错误 | -| message | string | 请求失败返回的错误信息| -| data | object | 请求返回的数据| -| permission | object | 权限信息| -| request_id | string | 请求链id| - -#### data - -| 字段 | 类型 | 描述 | -|-----------|-----------|-----------| -| bk_gse_taskid | string | GSE任务ID | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_step_instance.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_step_instance.md index 77d7ba0a2..c11cc809e 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_step_instance.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/operate_step_instance.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_instance_id | long | 是 | 作业实例ID | | step_instance_id | long | 是 | 步骤实例ID | | operation_code | int | 是 | 操作类型:2、失败IP重做,3、忽略错误 6、确认继续 8、全部重试,9、终止确认流程,10-重新发起确认,11、进入下一步,12、强制跳过 | @@ -35,7 +36,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_instance_id": 100, "step_instance_id": 200, "operation_code": 2 @@ -66,7 +68,7 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/push_config_file.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/push_config_file.md index 1f1f7105b..0d6f0353e 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/push_config_file.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/push_config_file.md @@ -10,9 +10,10 @@ | 字段 | 类型 | 必选 | 描述 | |-------------|------------|--------|------------| -| bk_biz_id | long | 是 | 业务ID | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | task_name | string | 否 | 自定义作业名称 | -| account_alias | string | 是 | 执行帐号别名 | +| account_alias | string | 是 | 执行账号别名 | | file_target_path | string | 是 | 文件传输目标路径 | | file_list | array | 是 | 源文件对象数组,见下面file定义 | | target_server | object | 是 | 目标服务器,见server定义 | @@ -26,17 +27,19 @@ #### 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参数***;如果host_id_list与ip_list同时存在,将忽略ip_list参数。主机IP 列表,定义见ip | +| dynamic_group_list | array | 否 | 动态分组列表,定义见dynamic_group | +| topo_node_list | array | 否 | 动态 topo 节点列表,定义见topo_node | + #### ip | 字段 | 类型 | 必选 | 描述 | | ----------- | ------ | ---- | -------- | -| bk_cloud_id | long | 是 | 云区域ID | +| bk_cloud_id | long | 是 | 管控区域ID | | ip | string | 是 | IP地址 | #### dynamic_group @@ -57,8 +60,9 @@ "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", - "bk_biz_id": 1, - "account": "root", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "account_alias": "root", "file_target_path": "/tmp/", "file_list": [ { @@ -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": [ { @@ -116,7 +114,7 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/save_cron.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/save_cron.md index c9059256d..7e573d8dd 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/save_cron.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/save_cron.md @@ -10,12 +10,13 @@ | 字段 | 类型 | 必选 | 描述 | |-----------------|------------|--------|------------| -| 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 | | id | long | 否 | 定时任务 ID,更新定时任务时,必须传这个值 | | name | string | 否 | 定时作业名称,新建时必填,修改时选填 | -| expression | string | 否 | 定时任务 crontab 的定时规则,新建时必填,修改时选填,各字段含义为:分 时 日 月 周,如: 0/5 * * * * 表示每5分钟执行一次,注意:不支持? | -| execute_time | long | 否 | 定时任务单次执行的执行时间,Unix时间戳,新建定时任务时不可与expression同时为空 | +| expression | string | 否 | 定时任务 crontab 的定时规则,新建时必填,修改时选填,各字段含义为:分 时 日 月 周,如: 0/5 * * * * 表示每5分钟执行一次,注意:不支持? ,新建时与execute_time互斥,二者只可传入一个| +| execute_time | long | 否 | 定时任务单次执行的执行时间,Unix时间戳,新建定时任务时不可与expression同时为空,且二者只可传入一个 | | global_var_list | array | 否 | 全局变量信息,可使用 查询执行方案详情 接口查询方案可设置的变量信息 | #### global_var @@ -30,7 +31,9 @@ #### server | 字段 | 类型 | 必选 | 描述 | |-----------------------|-------|--------|------------| -| ip_list | array | 否 | 静态 IP 列表 | +| host_id_list | array | 否 | 主机ID列表 | +| ip_list | array | 否 | ***不推荐使用,建议使用host_id_list参数***;如果host_id_list与ip_list同时存在,将忽略ip_list参数。主机IP 列表,定义见ip | +| host_id_list | array | 否 | 静态 主机ID 列表,元素为Long类型,指定的主机将与ip_list指定的主机取并集 | | dynamic_group_list | array | 否 | 动态分组列表 | | topo_node_list | array | 否 | 动态 topo 节点列表 | @@ -38,7 +41,7 @@ | 字段 | 类型 | 必选 | 描述 | |-------------|---------|--------|---------| -| bk_cloud_id | int | 是 | 云区域ID | +| bk_cloud_id | int | 是 | 管控区域ID | | ip | string | 是 | IP地址 | #### topo_node @@ -49,6 +52,7 @@ ### 请求参数示例 +- POST #### 1.创建定时任务 ```json { @@ -56,8 +60,8 @@ "bk_app_secret": "xxx", "access_token": "xxx", "bk_username": "admin", - "bk_biz_id": 2, - "execute_time": 0, + "bk_scope_type": "biz", + "bk_scope_id": "1", "expression": "0 0/5 * * *", "job_plan_id": 1023060, "name": "test API", @@ -85,12 +89,7 @@ { "name": "hostVar", "server": { - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - } - ] + "host_id_list": [1,2,3] } } ] @@ -104,8 +103,8 @@ "bk_app_secret": "xxx", "access_token": "xxx", "bk_username": "admin", - "bk_biz_id": 2, - "execute_time": 0, + "bk_scope_type": "biz", + "bk_scope_id": "1", "expression": "0 0/5 * * *", "job_plan_id": 1023060, "name": "test API", @@ -133,12 +132,7 @@ { "name": "hostVar", "server": { - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - } - ] + "host_id_list": [2,3,4] } } ] @@ -156,7 +150,8 @@ "name": "test API", "status": 2, "creator": "admin", - "bk_biz_id": 2, + "bk_scope_type": "biz", + "bk_scope_id": "1", "job_plan_id": 1023060, "expression": "0 0/5 * * *", "global_var_list": [ @@ -215,6 +210,7 @@ "server": { "ip_list": [ { + "bk_host_id": 101, "bk_cloud_id": 0, "ip": "10.0.0.1" } @@ -227,8 +223,7 @@ "create_time": 1642045370, "last_modify_user": "admin", "last_modify_time": 1642045370 - }, - "job_request_id": "19b76b84e481846e" + } } ``` #### 2.更新定时任务 @@ -241,7 +236,8 @@ "name": "test API", "status": 2, "creator": "admin", - "bk_biz_id": 2, + "bk_scope_type": "biz", + "bk_scope_id": "1", "job_plan_id": 1023060, "expression": "0 0/5 * * *", "global_var_list": [ @@ -300,6 +296,7 @@ "server": { "ip_list": [ { + "bk_host_id": 101, "bk_cloud_id": 0, "ip": "10.0.0.1" } @@ -312,8 +309,7 @@ "create_time": 1641990674, "last_modify_user": "admin", "last_modify_time": 1641995052 - }, - "job_request_id": "69f5b499072003aa" + } } ``` @@ -322,12 +318,11 @@ #### response | 字段 | 类型 | 描述 | |-----------|-----------|-----------| -| result | bool | 请求成功与否。true:请求成功;false请求失败 | | code | int | 错误编码。 0表示success,>0表示失败错误 | -| message | string | 请求失败返回的错误信息| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| message | string | 请求失败返回的错误信息(成功时无此字段)| | data | object | 请求返回的数据| -| permission | object | 权限信息| -| request_id | string | 请求链id| +| permission | object | 权限信息(无权限情况下才返回)| #### data @@ -336,13 +331,14 @@ | id | long | 定时任务 ID| | name | string | 定时作业名称| | status | int | 定时任务状态| -| 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 | | creator | string | 创建人 | | create_time | long | 创建时间Unix时间戳(s) | | last_modify_user | string | 最近一次修改人 | | last_modify_time | long | 最近一次修改时间Unix时间戳(s) | -| expression | string | 定时任务 crontab 的定时规则,| +| expression | string | 定时任务 crontab 的定时规则| | execute_time | long | 定时任务单次执行的执行时间,Unix时间戳| | global_var_list | array | 全局变量信息,定义见global_var | @@ -363,14 +359,16 @@ |-----------------------|-------|------------| | variable | string | 引用的变量名 | | ip_list | array | 静态 IP 列表 | +| host_id_list | array | 静态 主机ID 列表,元素为Long类型 | | dynamic_group_list | array | 动态分组 ID 列表 | | topo_node_list | array | 动态 topo 节点列表 | #### ip -| 字段 | 类型 | 描述 | -|-------------|---------|---------| -| bk_cloud_id | int | 云区域ID | -| ip | string | IP地址 | +| 字段 | 类型 | 描述 | +|-----------|------------|--------| +| bk_host_id | long | 主机ID | +| bk_cloud_id | long | 管控区域ID | +| ip | string | IP地址 | #### dynamic_group | 字段 | 类型 | 描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/set_base_report.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/set_base_report.md deleted file mode 100644 index c8e175724..000000000 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/set_base_report.md +++ /dev/null @@ -1,85 +0,0 @@ -### 功能描述 - -开启/关闭Agent基础数据采集上报功能 - -### 请求参数 - -{{ common_args_desc }} - -#### 接口参数 - -| 字段 | 类型 | 必选 | 描述 | -|-------------|------------|--------|------------| -| bk_biz_id | int | 是 | 业务ID | -| sys_id | int | 是 | 系统信息上报dataid,为-1则关闭上报 | -| cpu_id | int | 是 | cpu信息上报dataid,为-1则关闭上报 | -| mem_id | int | 是 | mem信息上报dataid,为-1则关闭上报 | -| net_id | int | 是 | 网卡信息上报dataid,为-1则关闭上报 | -| disk_id | int | 是 | 磁盘IO信息上报dataid,为-1则关闭上报 | -| proc_id | int | 是 | 进程信息上报dataid,为-1则关闭上报 | -| crontab_id | int | 是 | crontab上报dataid,为-1则关闭上报 | -| iptables_id | int | 是 | iptables信息上报dataid,为-1则关闭上报 | -| ip_list | array | 是 | IP对象数组,见下面ip_list结构定义 | - -#### ip_list - -| 字段 | 类型 | 必选 | 描述 | -|-----------|------------|--------|------------| -| bk_cloud_id | int | 是 | 云区域ID | -| ip | string | 是 | IP地址 | - -### 请求参数示例 - -```json -{ - "bk_app_code": "esb_test", - "bk_app_secret": "xxx", - "bk_token": "xxx", - "bk_biz_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" - } - ] -} -``` - -### 返回结果示例 - -```json -{ - "result": true, - "code": 0, - "message": "", - "data": { - "bk_gse_taskid": "GSETASK:20170621165117:10000" - } -} -``` - -### 返回结果参数说明 - -#### response -| 字段 | 类型 | 描述 | -|-----------|-----------|-----------| -| result | bool | 请求成功与否。true:请求成功;false请求失败 | -| code | int | 错误编码。 0表示success,>0表示失败错误 | -| message | string | 请求失败返回的错误信息| -| data | object | 请求返回的数据| -| permission | object | 权限信息| -| request_id | string | 请求链id| - -#### data - -| 字段 | 类型 | 描述 | -|-----------|-----------|-----------| -| bk_gse_taskid | string | GSE任务ID | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_credential.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_credential.md index caa0f0814..2753b9144 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_credential.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_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 | | id | string | 是 | 凭据 ID | | name | string | 否 | 凭据名称 | | type | string | 否 | 凭据类型,取值可为ACCESS_KEY_SECRET_KEY,PASSWORD,USERNAME_PASSWORD,SECRET_KEY | @@ -28,7 +29,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", "id": "06644309e10e4068b3c7b32799668210", "name": "testCredential", "type": "USERNAME_PASSWORD", @@ -61,7 +63,7 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_cron_status.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_cron_status.md index 7daa223d2..ea124290d 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_cron_status.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_cron_status.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 | | id | long | 是 | 定时作业 ID | | status | int | 是 | 定时状态,1.启动、2.暂停 | @@ -21,7 +22,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", "id": 2, "status": 1 } @@ -31,10 +33,85 @@ ```json { - "result": true, "code": 0, - "message": "success", - "data": 2 + "result": true, + "data": { + "id": 2, + "name": "test API", + "status": 1, + "creator": "admin", + "bk_biz_id": 1, + "job_plan_id": 1023060, + "expression": "0 0/5 * * *", + "global_var_list": [ + { + "id": 1001101, + "name": "stringVar", + "value": "value111333312", + "description": null, + "type": 1, + "required": null, + "server": null + }, + { + "id": 1001102, + "name": "nsVar", + "value": "nsvalue111333312", + "description": null, + "type": 2, + "required": null, + "server": null + }, + { + "id": 1001104, + "name": "secretVar", + "value": "secretvalue111333312", + "description": null, + "type": 4, + "required": null, + "server": null + }, + { + "id": 1001105, + "name": "dictVar", + "value": "([\"var1\"]=1, [\"var2\"]=2)", + "description": null, + "type": 5, + "required": null, + "server": null + }, + { + "id": 1001106, + "name": "indexArrVar", + "value": "(22 3 4)", + "description": null, + "type": 6, + "required": null, + "server": null + }, + { + "id": 1001103, + "name": "hostVar", + "value": null, + "description": null, + "type": 3, + "required": null, + "server": { + "ip_list": [ + { + "bk_cloud_id": 0, + "ip": "10.0.0.1" + } + ], + "dynamic_group_list": null, + "topo_node_list": null + } + } + ], + "create_time": 1641990674, + "last_modify_user": "admin", + "last_modify_time": 1641995052 + } } ``` @@ -43,15 +120,62 @@ #### response | 字段 | 类型 | 描述 | |-----------|-----------|-----------| -| result | bool | 请求成功与否。true:请求成功;false请求失败 | | code | int | 错误编码。 0表示success,>0表示失败错误 | -| message | string | 请求失败返回的错误信息| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| message | string | 请求失败返回的错误信息(成功时无此字段)| | data | object | 请求返回的数据| -| permission | object | 权限信息| -| request_id | string | 请求链id| +| permission | object | 权限信息(无权限情况下才返回)| #### data -| 字段 | 类型 | 描述 | -|-----------|-----------|-----------| -| data | long | 定时任务ID | +| 字段 | 类型 | 描述 | +|-----------------|------------|-------------| +| id | long | 定时任务 ID| +| name | string | 定时作业名称| +| status | int | 定时任务状态| +| bk_biz_id | long | 业务 ID | +| job_plan_id | long | 要定时执行的作业的执行方案 ID | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(s) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(s) | +| expression | string | 定时任务 crontab 的定时规则,| +| execute_time | long | 定时任务单次执行的执行时间,Unix时间戳| +| global_var_list | array | 全局变量信息,定义见global_var | + +#### global_var + +| 字段 | 类型 | 描述 | +|-------------|-----------|------------| +| id | long | 全局变量 id,唯一标识。如果 id 为空,那么使用 name 作为唯一标识 | +| name | string | 全局变量名 | +| description | string | 全局变量描述 | +| type | int | 全局变量类型 | +| required | int | 模版/执行方案中该变量是否必填 | +| value | string | 字符、密码、数组类型的全局变量的值 | +| server | object | 主机类型全局变量的值 | + +#### server +| 字段 | 类型 | 描述 | +|-----------------------|-------|------------| +| variable | string | 引用的变量名 | +| ip_list | array | 静态 IP 列表 | +| dynamic_group_list | array | 动态分组 ID 列表 | +| topo_node_list | array | 动态 topo 节点列表 | + +#### ip +| 字段 | 类型 | 描述 | +|-------------|---------|---------| +| bk_cloud_id | int | 云区域ID | +| ip | string | IP地址 | + +#### dynamic_group +| 字段 | 类型 | 描述 | +|-----|---------|------------| +| id | string | 动态分组 ID | + +#### topo_node +| 字段 | 类型 | 描述 | +|------------------|--------|------------| +| id | long | 动态topo节点ID,对应CMDB API 中的 bk_inst_id | +| node_type | string | 动态topo节点类型,对应CMDB API 中的 bk_obj_id,比如"module","set"| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_file_source.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_file_source.md index 606027aae..68bd21945 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_file_source.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_file_source.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 | | id | int | 否 | 文件源ID,与code二者至少填一个,同时填写以id为准 | | code | string | 否 | 文件源标识,与id二者至少填一个,同时填写以id为准,英文字符开头,1-32位英文字符、下划线、数字组成,创建后不可更改 | | alias | string | 否 | 文件源别名 | @@ -33,7 +34,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", @@ -68,7 +70,7 @@ | message | string | 请求失败返回的错误信息| | data | object | 请求返回的数据| | permission | object | 权限信息| -| request_id | string | 请求链id| + #### data diff --git a/paas2/esb/components/confapis/jobv3/job.yaml b/paas2/esb/components/confapis/jobv3/job.yaml index d8d7d2c42..23426de70 100644 --- a/paas2/esb/components/confapis/jobv3/job.yaml +++ b/paas2/esb/components/confapis/jobv3/job.yaml @@ -263,61 +263,6 @@ dest_path: /api/job/v3/job-crontab/update_cron_status/ dest_http_method: POST -# GSE API -- path: /v2/jobv3/get_proc_result/ - name: get_proc_result - label: 操作服务器上的进程结果查询 - label_en: Query the result of the process on the server - suggest_method: GET - api_type: query - comp_codename: generic.v2.jobv3.job_component - dest_path: /api/job/v3/job-execute/get_proc_result/ - dest_http_method: POST - is_hidden: True - -- path: /v2/jobv3/manage_proc/ - name: manage_proc - label: 对服务器上的进程进行注册托管/取消托管 - label_en: Manage the process on the server - suggest_method: POST - api_type: operate - comp_codename: generic.v2.jobv3.job_component - dest_path: /api/job/v3/job-execute/manage_proc/ - dest_http_method: POST - is_hidden: True - -- path: /v2/jobv3/operate_proc/ - name: operate_proc - label: 操作服务器上的进程 - label_en: Operate the process on the server - suggest_method: POST - api_type: operate - comp_codename: generic.v2.jobv3.job_component - dest_path: /api/job/v3/job-execute/operate_proc/ - dest_http_method: POST - is_hidden: True - -- path: /v2/jobv3/operate_process/ - name: operate_process - label: 操作服务器上的进程-v2版本 - label_en: Operate the process on the server-v2 - suggest_method: POST - api_type: operate - comp_codename: generic.v2.jobv3.job_component - dest_path: /api/job/v3/job-execute/operate_process/ - dest_http_method: POST - is_hidden: True - -- path: /v2/jobv3/set_base_report/ - name: set_base_report - label: 开启/关闭Agent基础数据采集上报功能 - label_en: Enable / disable agent basic data collection and reporting function - suggest_method: POST - api_type: operate - comp_codename: generic.v2.jobv3.job_component - dest_path: /api/job/v3/job-execute/set_base_report/ - dest_http_method: POST - is_hidden: True - path: /v2/jobv3/create_credential/ name: create_credential diff --git a/paas2/release.md b/paas2/release.md index 41484fd7e..ca2c0c476 100644 --- a/paas2/release.md +++ b/paas2/release.md @@ -1,5 +1,8 @@ Release Log =============================== +# 2.14.55 + - esb: update jobv3 confapis + # 2.14.54 - login: translate `登录` to `Sign in`