Skip to content

Commit

Permalink
docs: 蓝盾Agent安装支持手动安装 (closed TencentBlueKing#2211)
Browse files Browse the repository at this point in the history
  • Loading branch information
Huayeaaa committed May 16, 2024
1 parent 0685bbe commit 4346f9f
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 1 deletion.
140 changes: 140 additions & 0 deletions docs/apidoc/get_job_commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
### 功能描述

获取安装命令

### 请求参数

{{common_args_desc }}

#### 路径参数

| 字段 | 类型 | <div style="width: 50pt">必选</div> | 描述 |
| ---- | ---- | ----------------------------------- | ------ |
| pk | int || 任务ID |

#### 接口参数

| 字段 | 类型 | <div style="width: 50pt">必选</div> | 描述 |
| ------------ | ---- | ----------------------------------- | ---------- |
| bk_host_id | int || 主机ID |
| is_uninstall | bool || 是否为卸载 |

### 请求参数示例

```json
{
"bk_app_code": "esb_test",
"bk_app_secret": "xxx",
"bk_username": "admin",
"bk_host_id": 1
}
```

### 返回结果示例

```json
{
"result": true,
"data": {
"solutions": [
{
"type": "shell",
"description": "通过 bash 进行安装",
"steps": [
{
"type": "commands",
"contents": [
{
"name": "create_dir",
"text": "sudo mkdir -p /tmp/",
"description": "创建 /tmp/",
"child_dir": null,
"show_description": false,
"always_download": false
}
],
"description": "创建依赖目录"
},
{
"type": "commands",
"contents": [
{
"name": "combine",
"text": "curl setup_agent.sh -o /tmp/setup_agent.sh && chmod +x /tmp/setup_agent.sh'",
"description": "下载安装脚本并赋予执行权限",
"child_dir": null,
"show_description": false,
"always_download": false
}
],
"description": "下载安装脚本并赋予执行权限"
},
{
"type": "commands",
"contents": [
{
"name": "run_cmd",
"text": "bash /tmp/setup_agent.sh",
"description": "执行安装脚本",
"child_dir": null,
"show_description": false,
"always_download": false
}
],
"description": "执行安装脚本"
}
],
"target_host_solutions": []
}
]
},
"code": 0,
"message": ""
}
```

### 返回结果参数说明

#### response

| 字段 | 类型 | 描述 |
| ------- | ------ | ------------------------------------------ |
| result | bool | 请求成功与否。true:请求成功;false请求失败 |
| code | int | 错误编码。 0表示success,>0表示失败错误 |
| message | string | 请求失败返回的错误信息 |
| data | object | 请求返回的数据,见data定义 |

#### data

| 字段 | 类型 | 描述 |
| --------- | ----- | ------------------------- |
| solutions | array | 安装方案,见solutions定义 |

##### solutions

| 字段 | 类型 | 描述 |
| --------------------- | ------ | --------------------- |
| type | string | 脚本执行类型 |
| description | string | 脚本执行类型描述 |
| target_host_solutions | array | 执行目标方案 |
| steps | array | 安装步骤,见steps定义 |

###### steps

| 字段 | 类型 | 描述 |
| ----------- | ------ | ---------------------------- |
| type | string | 安装步骤类型 |
| description | string | 安装步骤动作描述 |
| contents | array | 安装步骤内容,见contents定义 |

###### contents

| 字段 | 类型 | 描述 |
| ---------------- | ------ | ---------------- |
| name | string | 安装内容名称 |
| text | string | 安装命令 |
| description | string | 安装命令描述 |
| child_dir | string | 子路径 |
| show_description | bool | 是否展示描述信息 |
| always_download | bool | 是否实时更新 |

2 changes: 1 addition & 1 deletion docs/apidoc/install_job.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
| data_ip | string || 数据IP |
| inner_ipv6 | string || 内网IPv6 |
| outer_ipv6 | string || 外网IPv6 |
| os_type | string | | 操作系统,1:LINUX 2:WINDOWS 3:AIX 4:SOLARIS |
| os_type | string | | 操作系统,1:LINUX 2:WINDOWS 3:AIX 4:SOLARIS |
| auth_type | string || 认证类型,1:PASSWORD,密码认证 2: KEY,秘钥认证 3:TJJ_PASSWORD,默认为密码认证 |
| account | string || 账户 |
| password | string || 密码 |
Expand Down

0 comments on commit 4346f9f

Please sign in to comment.