Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: API 校验优化 #2769 #3110

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
| 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。脚本参数长度不得超过 5000 个字符。注意:如果有多个参数,比如"param1 param2"这种,需要对"param1 param2"整体进行base64编码,而不是对每个参数进行base64编码再拼接起来 |
| timeout | long | 否 | 脚本执行超时时间,秒。默认7200,取值范围1-86400 |
| timeout | long | 否 | 脚本执行超时时间,秒。默认7200,取值范围1-259200 |
| 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 | boolean | 否 | 敏感参数将会在执行详情页面上隐藏。默认为 false|
Expand Down
38 changes: 19 additions & 19 deletions docs/apidoc/bk-api-gateway/v3/zh/fast_execute_script.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@

#### Body参数

| 字段 | 类型 | 必选 | 描述 |
|---------------|------------|--------|------------|
| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 |
| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID |
| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 |
| script_version_id | long | 否 | 脚本版本ID。当script_version_id不为空的时候,使用script_version_id对应的脚本版本 |
| script_id | string | 否 | 脚本ID。当传入script_id,且script_version_id为空的时候,使用脚本的上线版本 |
| script_content | string | 否 | 脚本内容Base64。如果不存在script_version_id和script_id,那么使用script_content。优先级:script_version_id>script_id>script_content |
| task_name | string | 否 | 自定义作业名称 |
| script_param | string | 否 | 脚本参数Base64。注意:如果有多个参数,比如"param1 param2"这种,需要对"param1 param2"整体进行base64编码,而不是对每个参数进行base64编码再拼接起来 |
| timeout | long | 否 | 脚本执行超时时间,秒。默认7200,取值范围1-86400 |
| account_alias | string | 否 | 执行账号别名。与account_id必须存在一个。当同时存在account_alias和account_id时,account_id优先。 |
| account_id | long | 否 | 执行账号ID。与account_alias必须存在一个。当同时存在account_alias和account_id时,account_id优先。 |
| is_param_sensitive | int | 否 | 敏感参数将会在执行详情页面上隐藏, 0:不是(默认),1:是 |
| script_language | int | 否 | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell。当使用script_content传入自定义脚本的时候,需要指定script_language |
| target_server | object | | 目标服务器,见server定义 |
| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 |
| rolling_config | object | 否 | 滚动配置,见rolling_config定义 |
| 字段 | 类型 | 必选 | 描述 |
|---------------|------------|----|------------|
| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 |
| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID |
| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 |
| script_version_id | long | 否 | 脚本版本ID。当script_version_id不为空的时候,使用script_version_id对应的脚本版本 |
| script_id | string | 否 | 脚本ID。当传入script_id,且script_version_id为空的时候,使用脚本的上线版本 |
| script_content | string | 否 | 脚本内容Base64。如果不存在script_version_id和script_id,那么使用script_content。优先级:script_version_id>script_id>script_content |
| task_name | string | 否 | 自定义作业名称 |
| script_param | string | 否 | 脚本参数Base64。注意:参数总长度不能超过5000个字符; 如果有多个参数,比如"param1 param2"这种,需要对"param1 param2"整体进行base64编码,而不是对每个参数进行base64编码再拼接起来 |
| timeout | long | 否 | 脚本执行超时时间,秒。默认7200,取值范围1-259200 |
| account_alias | string | 否 | 执行账号别名。与account_id必须存在一个。当同时存在account_alias和account_id时,account_id优先。 |
| account_id | long | 否 | 执行账号ID。与account_alias必须存在一个。当同时存在account_alias和account_id时,account_id优先。 |
| is_param_sensitive | int | 否 | 敏感参数将会在执行详情页面上隐藏, 0:不是(默认),1:是 |
| script_language | int | 否 | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell。当使用script_content传入自定义脚本的时候,需要指定script_language |
| target_server | object | | 目标服务器,见server定义 |
| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 |
| rolling_config | object | 否 | 滚动配置,见rolling_config定义 |

##### server
| 字段 | 类型 | 必选 | 描述 |
Expand Down Expand Up @@ -135,4 +135,4 @@
|-----------|-----------|-----------|
| job_instance_id | long | 作业实例ID |
| job_instance_name | long | 作业实例名称 |
| step_instance_id | long | 步骤实例ID |
| step_instance_id | long | 步骤实例ID |
2 changes: 1 addition & 1 deletion docs/apidoc/bk-api-gateway/v3/zh/fast_execute_sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
| 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 |
| timeout | int | 否 | 脚本超时时间,秒。默认7200,取值范围1-259200 |
| db_account_id | long | 是 | SQL执行的db账号ID,必填, 从账号管理-DB账号处获得。 |
| target_server | object | 否 | 目标服务器,见server定义 |
| callback_url | string | 否 | 回调URL,当任务执行完成后,JOB会调用该URL告知任务执行结果。回调协议参考callback_protocol组件文档 |
Expand Down
2 changes: 1 addition & 1 deletion docs/apidoc/bk-api-gateway/v3/zh/fast_transfer_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
| 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。|
| timeout | int | 否 | 任务超时时间,秒,默认值为7200。取值范围1-259200。|
| download_speed_limit| int | 否 | 下载限速,单位MB。如果未传入该参数,表示不限速|
| upload_speed_limit| int | 否 | 上传限速,单位MB。如果未传入该参数,表示不限速|
| transfer_mode | int | 否 | 传输模式。1-严谨模式,2-强制模式。默认使用强制模式 |
Expand Down
15 changes: 8 additions & 7 deletions docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_ip_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@

#### Query参数

| 字段 | 类型 | 必选 | 描述 |
|-----------|------------|--------|------------|
| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 |
| 字段 | 类型 | 必选 | 描述 |
|-----------|------------|------|----------|
| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 |
| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID |
| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 |
| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 |
| job_instance_id | long | 是 | 作业实例ID |
| step_instance_id | long | 是 | 步骤实例ID |
| bk_cloud_id | int | 是 | 目标服务器管控区域ID |
| ip | string | 是 | 目标服务器IP |
| step_instance_id | long | 是 | 步骤实例ID |
| bk_cloud_id | int | 否 | 目标服务器管控区域ID |
| ip | string | 否 | 目标服务器IP |
| bk_host_id| long | 否 | 主机ID|

### 请求参数示例
- GET
Expand Down
4 changes: 2 additions & 2 deletions docs/apidoc/bk-api-gateway/v3/zh/get_job_plan_detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"data": {
"bk_scope_type": "biz",
"bk_scope_id": "1",
"job_plan_id": 100,
"id": 100,
"name": "test",
"creator": "admin",
"create_time": 1546272000000,
Expand Down Expand Up @@ -208,7 +208,7 @@
|------------------|-----------|-----------|
| 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 | 作业名称 |
| creator | string | 作业创建人账号 |
| create_time | long | 创建时间,Unix 时间戳 |
Expand Down
2 changes: 1 addition & 1 deletion docs/apidoc/bk-api-gateway/v3/zh/operate_job_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"bk_scope_type": "biz",
"bk_scope_id": "1",
"job_instance_id": 100,
"operation_code": 1
"operation_code": 1
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/apidoc/bk-api-gateway/v3/zh/operate_step_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
{
"result": true,
"code": 0,
"message": "success",s
"message": "success",
"data": {
"step_instance_id": 200,
"job_instance_id": 100
Expand Down
18 changes: 9 additions & 9 deletions docs/apidoc/esb/jobv3-confapis/apidocs/en/create_file_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ The created file source has the following default features:
#### Interface parameters

| **Fields** | **Type** | **Required** | **Description** |
|-----------------|------------|--------|------------|
| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set |
| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID |
| code | string | yes | File source identification, beginning with English characters, 1-32 English characters, underscores, numbers, cannot be changed after creation |
| alias | string | yes | File source alias |
| type | string | yes | File Source Type, Currently only the BlueKing Repository is supported,BLUEKING_ARTIFACTORY |
| access_params | object | yes | File source access parameters, pass in different objects according to type, see subsequent instructions |
| credential_id | string | no | Credential Id used by the file source |
| file_prefix | string | no | JOB prefix for files distributed from this source, no prefix by default |
|-----------------|------------|--------------|------------|
| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set |
| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID |
| code | string | yes | File source identification, beginning with English characters, 1-32 English characters, underscores, numbers, cannot be changed after creation |
| alias | string | yes | File source alias |
| type | string | yes | File Source Type, Currently only the BlueKing Repository is supported,BLUEKING_ARTIFACTORY |
| access_params | object | yes | File source access parameters, pass in different objects according to type, see subsequent instructions |
| credential_id | string | yes | 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
Expand Down
30 changes: 15 additions & 15 deletions docs/apidoc/esb/jobv3-confapis/apidocs/en/fast_execute_script.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ Start Job Plan
#### Interface parameters

| Fields | Type | Required | Description |
|---------------|------------|--------|------------|
| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set |
| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID |
| script_version_id | long | no | Script version ID. When script_version_id is not empty, the script version corresponding to script_version_id is used|
| script_id | string | no |Script id. When script_id is passed in and script_version_id is empty, the online version of the script is used|
| script_content | string | no |Script content Base64. If script_version_id and script_id do not exist, script_content is used. Priority: script_version_id>script_id>script_content|
| task_name | string | no | Custom job name|
| script_param | string | no | Script parameter Base64 encoding.|
| timeout | long | no | Script execution timeout in seconds. The default value is 7200, and the value range is [1,86400]|
| account_alias | string | no | Execution account alias. The account_id takes precedence when both account_alias and account_id exist. |
| account_id | long | no |Execution account ID. The account_id takes precedence when both account_alias and account_id exist. |
| is_param_sensitive | int | no | Sensitive parameters will be hidden on the execution details page, 0: No (default), 1: Yes|
| script_language | int | no |Scripting languages: 1 - shell, 2 - bat, 3 - Perl, 4 - Python, 5 - PowerShell. Script_language needs to be specified when you pass in a custom script using script_content|
| target_server | object | no | Target server, see server definition|
| callback_url | string | no | Callback URL, when the task execution is completed, the JOB will call this URL to inform the task execution result. Callback protocol refer to the callback_protocol component documentation|
|---------------|------------|----------|------------|
| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set |
| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID |
| script_version_id | long | no | Script version ID. When script_version_id is not empty, the script version corresponding to script_version_id is used|
| script_id | string | no |Script id. When script_id is passed in and script_version_id is empty, the online version of the script is used|
| script_content | string | no |Script content Base64. If script_version_id and script_id do not exist, script_content is used. Priority: script_version_id>script_id>script_content|
| task_name | string | no | Custom job name|
| script_param | string | no | Script parameter Base64. Note: The total length of the parameter cannot exceed 5000 characters; If there are multiple parameters, such as "param1 param2", you need to base64 encode "param1 param2" as a whole, rather than base64 encode each parameter and then concatenate them together.|
| 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 | yes | 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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Query job execution log by host

#### Interface parameters

| Fields | Type | Required | Description |
|-----------|------------|--------|------------|
| Fields | Type | Required | Description |
|-----------|--------|--------|------------|
| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set |
| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID |
| job_instance_id | long | yes |Job instance ID|
| step_instance_id | long | yes |Step instance ID|
| bk_cloud_id | int | no |Target server BK-Net ID|
| job_instance_id | long | yes |Job instance ID|
| step_instance_id | long | yes |Step instance ID|
| bk_cloud_id | int | no |Target server BK-Net ID|
| ip | string | no |Destination server IP. ***Deprecated, it is recommended to use the bk_host_id parameter|
| bk_host_id | string | no | Host ID|
| bk_host_id | long | no | Host ID|

### Example of request

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Check Job Plan details by Job Plan ID
"data": {
"bk_scope_type": "biz",
"bk_scope_id": "1",
"job_plan_id": 100,
"id": 100,
"name": "test",
"creator": "admin",
"create_time": 1546272000000,
Expand Down Expand Up @@ -208,7 +208,7 @@ Check Job Plan details by Job Plan ID
|------------------|-----------|-----------|
| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set |
| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID |
| job_plan_id | long | Job Plan ID |
| id | long | Job Plan ID |
| name | string | Job name|
| creator | string | Job creator account number|
| create_time | long | Creation time, Unix timestamp|
Expand Down
Loading
Loading