forked from TencentBlueKing/bk-job
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 提供账号查询、创建、删除的APIGW接口 TencentBlueKing#2472
增加接口文档
- Loading branch information
Showing
7 changed files
with
609 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
### 功能描述 | ||
|
||
创建账号(当前仅支持系统账号) | ||
|
||
### 请求参数 | ||
|
||
{{ bkapi_authorization_description }} | ||
|
||
#### Header参数 | ||
|
||
| 字段 | 类型 | 必选 | 描述 | | ||
|---------------------------|------------|---------|------------| | ||
| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | | ||
| Accept | string | 是 | 固定值。application/json| | ||
| Content-Type | string | 是 | 固定值。application/json| | ||
|
||
#### Body参数 | ||
|
||
| 字段 | 类型 | 必选 | 描述 | | ||
|---------------|------------|--------|------------| | ||
| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | ||
| bk_scope_id | string | 是 | 资源范围ID,与bk_scope_type对应,表示业务ID或者业务集ID | | ||
| account | string | 是 | 账号名称 | | ||
| type | int | 是 | 账号类型(1:Linux,2:Windows)| | ||
| category | int | 是 | 账号用途(1:系统账号)| | ||
| password | string | 否 | 系统账号密码,账号用途为系统账号且账号类型为Windows时必传 | | ||
| alias | string | 否 | 别名,不传则以账号名称作为别名 | | ||
| description | string | 否 | 描述 | | ||
|
||
### 请求参数示例 | ||
|
||
- POST | ||
```json | ||
{ | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "1", | ||
"account": "Admin", | ||
"type": 2, | ||
"category": 1, | ||
"password": "AdminPassword", | ||
"alias": "Admin", | ||
"description": "An account for windows" | ||
} | ||
``` | ||
|
||
### 返回结果示例 | ||
|
||
```json | ||
{ | ||
"code": 0, | ||
"message": null, | ||
"result": true, | ||
"data": { | ||
"id": 70, | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "1", | ||
"account": "Admin", | ||
"alias": "Admin", | ||
"category": 1, | ||
"type": 2, | ||
"db_system_account_id": null, | ||
"os": "Windows", | ||
"description": "An account for windows", | ||
"creator": "admin", | ||
"create_time": 1614659536108, | ||
"last_modify_user": "admin", | ||
"last_modify_time": 1614659536116 | ||
}, | ||
"job_request_id": "4e7acb216087eb96" | ||
} | ||
``` | ||
|
||
### 返回结果参数说明 | ||
|
||
#### response | ||
| 字段 | 类型 | 描述 | | ||
|--------------|-----------|-----------| | ||
| result | bool | 请求成功与否。true:请求成功;false请求失败 | | ||
| code | int | 错误编码。 0表示success,>0表示失败错误 | | ||
| message | string | 请求失败返回的错误信息| | ||
| data | object | 请求返回的数据| | ||
| permission | object | 权限信息| | ||
|
||
|
||
#### data | ||
|
||
| 字段 | 类型 | 描述 | | ||
|-----------------------|-----------|-----------| | ||
| id | long | 账号ID | | ||
| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | ||
| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | ||
| account | string | 账号名称 | | ||
| alias | string | 账号别名 | | ||
| category | int | 账号用途(1:系统账号) | | ||
| type | int | 账号类型(1:Linux,2:Windows)| | ||
| db_system_account_id | long | 账号用途为数据库账号时该字段生效,表示数据库账号对应的系统账号ID | | ||
| os | string | 账号用途为系统账号时该字段生效,账号对应的OS | | ||
| description | string | 账号描述 | | ||
| creator | string | 创建人 | | ||
| create_time | long | 创建时间Unix时间戳(ms) | | ||
| last_modify_user | string | 最近一次修改人 | | ||
| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
### 功能描述 | ||
|
||
删除账号。 | ||
|
||
### 请求参数 | ||
|
||
{{ bkapi_authorization_description }} | ||
|
||
#### Header参数 | ||
|
||
| 字段 | 类型 | 必选 | 描述 | | ||
|---------------------------|------------|---------|------------| | ||
| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | | ||
| Accept | string | 是 | 固定值。application/json| | ||
| Content-Type | string | 是 | 固定值。application/json| | ||
|
||
#### Body参数 | ||
|
||
| 字段 | 类型 | 必选 | 描述 | | ||
|---------------|------------|--------|------------| | ||
| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | ||
| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | ||
| id | long | 否 | 账号ID | | ||
|
||
### 请求参数示例 | ||
|
||
- DELETE | ||
```json | ||
{ | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "1", | ||
"id": 70 | ||
} | ||
``` | ||
|
||
### 返回结果示例 | ||
|
||
```json | ||
{ | ||
"code": 0, | ||
"message": null, | ||
"result": true, | ||
"data": { | ||
"id": 70, | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "1", | ||
"account": "Admin", | ||
"alias": "Admin", | ||
"category": 1, | ||
"type": 2, | ||
"db_system_account_id": null, | ||
"os": "Windows", | ||
"description": "An account for windows", | ||
"creator": "admin", | ||
"create_time": 1614659536108, | ||
"last_modify_user": "admin", | ||
"last_modify_time": 1614659536116 | ||
}, | ||
"job_request_id": "4e7acb216087eb96" | ||
} | ||
``` | ||
|
||
### 返回结果参数说明 | ||
|
||
#### response | ||
| 字段 | 类型 | 描述 | | ||
|--------------|-----------|-----------| | ||
| result | bool | 请求成功与否。true:请求成功;false请求失败 | | ||
| code | int | 错误编码。 0表示success,>0表示失败错误 | | ||
| message | string | 请求失败返回的错误信息| | ||
| data | object | 请求返回的数据| | ||
| permission | object | 权限信息| | ||
|
||
|
||
#### data | ||
|
||
| 字段 | 类型 | 描述 | | ||
|-----------------------|-----------|-----------| | ||
| id | long | 账号ID | | ||
| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | ||
| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | ||
| account | string | 账号名称 | | ||
| alias | string | 账号别名 | | ||
| category | int | 账号用途(1:系统账号,2:数据库账号) | | ||
| type | int | 账号类型(1:Linux,2:Windows,9:MySQL,10:Oracle,11:DB2)| | ||
| db_system_account_id | long | 账号用途为数据库账号时该字段生效,表示数据库账号对应的系统账号ID | | ||
| os | string | 账号用途为系统账号时该字段生效,账号对应的OS | | ||
| description | string | 描述 | | ||
| creator | string | 创建人 | | ||
| create_time | long | 创建时间Unix时间戳(ms) | | ||
| last_modify_user | string | 最近一次修改人 | | ||
| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
### 功能描述 | ||
|
||
搜索业务下的执行账号列表(含账号使用权限信息) | ||
|
||
### 请求参数 | ||
|
||
{{ bkapi_authorization_description }} | ||
|
||
#### Header参数 | ||
|
||
| 字段 | 类型 | 必选 | 描述 | | ||
|---------------------------|------------|---------|------------| | ||
| X-Bkapi-Authorization | string | 是 | 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) | | ||
| Accept | string | 是 | 固定值。application/json| | ||
| Content-Type | string | 是 | 固定值。application/json| | ||
|
||
#### Query参数 | ||
|
||
| 字段 | 类型 | 必选 | 描述 | | ||
|---------------|------------|--------|------------| | ||
| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | ||
| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | ||
| category | int | 否 | 账号用途(1:系统账号,2:数据库账号),不传则不区分 | | ||
| account | string | 否 | 账号名称,精确搜索 | | ||
| alias | string | 否 | 账号别名,精确搜索 | | ||
| start | int | 否 | 分页记录起始位置,不传默认为0 | | ||
| length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | | ||
|
||
### 请求参数示例 | ||
|
||
- GET | ||
```json | ||
/api/v3/search_account?bk_scope_type=biz&bk_scope_id=1&category=1&account=root&start=0&length=1 | ||
``` | ||
|
||
### 返回结果示例 | ||
|
||
```json | ||
{ | ||
"code": 0, | ||
"message": null, | ||
"result": true, | ||
"data": { | ||
"start": 0, | ||
"total": 12, | ||
"data": [ | ||
{ | ||
"id": 70, | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "1", | ||
"account": "root", | ||
"alias": "root", | ||
"category": 1, | ||
"type": 1, | ||
"db_system_account_id": null, | ||
"os": "Linux", | ||
"can_use": true, | ||
"creator": "admin", | ||
"create_time": 1614659536108, | ||
"last_modify_user": "admin", | ||
"last_modify_time": 1614659536116 | ||
} | ||
], | ||
"length": 1 | ||
}, | ||
"job_request_id": "4e7acb216087eb96" | ||
} | ||
``` | ||
|
||
### 返回结果参数说明 | ||
|
||
#### response | ||
| 字段 | 类型 | 描述 | | ||
|--------------|-----------|-----------| | ||
| result | bool | 请求成功与否。true:请求成功;false请求失败 | | ||
| code | int | 错误编码。 0表示success,>0表示失败错误 | | ||
| message | string | 请求失败返回的错误信息| | ||
| data | object | 请求返回的数据| | ||
| permission | object | 权限信息| | ||
|
||
|
||
#### data.data | ||
|
||
| 字段 | 类型 | 描述 | | ||
|-----------------------|-----------|-----------| | ||
| id | long | 账号ID | | ||
| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | ||
| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | ||
| account | string | 账号名称 | | ||
| alias | string | 账号别名 | | ||
| category | int | 账号用途(1:系统账号,2:数据库账号) | | ||
| type | int | 账号类型(1:Linux,2:Windows,9:MySQL,10:Oracle,11:DB2)| | ||
| db_system_account_id | long | 账号用途为数据库账号时该字段生效,表示数据库账号对应的系统账号ID | | ||
| os | string | 账号用途为系统账号时该字段生效,账号对应的OS | | ||
| can_use | bool | 是否有使用该账号的权限 | | ||
| creator | string | 创建人 | | ||
| create_time | long | 创建时间Unix时间戳(ms) | | ||
| last_modify_user | string | 最近一次修改人 | | ||
| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | |
96 changes: 96 additions & 0 deletions
96
docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_account.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
### 功能描述 | ||
|
||
创建账号(当前仅支持系统账号) | ||
|
||
### 请求参数 | ||
|
||
{{ common_args_desc }} | ||
|
||
#### 接口参数 | ||
|
||
| 字段 | 类型 | 必选 | 描述 | | ||
|---------------|------------|--------|------------| | ||
| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | ||
| bk_scope_id | string | 是 | 资源范围ID,与bk_scope_type对应,表示业务ID或者业务集ID | | ||
| account | string | 是 | 账号名称 | | ||
| type | int | 是 | 账号类型(1:Linux,2:Windows)| | ||
| category | int | 是 | 账号用途(1:系统账号)| | ||
| password | string | 否 | 系统账号密码,账号用途为系统账号且账号类型为Windows时必传 | | ||
| alias | string | 否 | 别名,不传则以账号名称作为别名 | | ||
| description | string | 否 | 描述 | | ||
|
||
### 请求参数示例 | ||
|
||
```json | ||
{ | ||
"bk_app_code": "esb_test", | ||
"bk_app_secret": "xxx", | ||
"bk_token": "xxx", | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "1", | ||
"account": "Admin", | ||
"type": 2, | ||
"category": 1, | ||
"password": "AdminPassword", | ||
"alias": "Admin", | ||
"description": "An account for windows" | ||
} | ||
``` | ||
|
||
### 返回结果示例 | ||
|
||
```json | ||
{ | ||
"code": 0, | ||
"message": null, | ||
"result": true, | ||
"data": { | ||
"id": 70, | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "1", | ||
"account": "Admin", | ||
"alias": "Admin", | ||
"category": 1, | ||
"type": 2, | ||
"db_system_account_id": null, | ||
"os": "Windows", | ||
"description": "An account for windows", | ||
"creator": "admin", | ||
"create_time": 1614659536108, | ||
"last_modify_user": "admin", | ||
"last_modify_time": 1614659536116 | ||
}, | ||
"job_request_id": "4e7acb216087eb96" | ||
} | ||
``` | ||
|
||
### 返回结果参数说明 | ||
|
||
#### response | ||
| 字段 | 类型 | 描述 | | ||
|--------------|-----------|-----------| | ||
| result | bool | 请求成功与否。true:请求成功;false请求失败 | | ||
| code | int | 错误编码。 0表示success,>0表示失败错误 | | ||
| message | string | 请求失败返回的错误信息| | ||
| data | object | 请求返回的数据| | ||
| permission | object | 权限信息| | ||
|
||
|
||
#### data | ||
|
||
| 字段 | 类型 | 描述 | | ||
|-----------------------|-----------|-----------| | ||
| id | long | 账号ID | | ||
| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | ||
| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | ||
| account | string | 账号名称 | | ||
| alias | string | 账号别名 | | ||
| category | int | 账号用途(1:系统账号) | | ||
| type | int | 账号类型(1:Linux,2:Windows)| | ||
| db_system_account_id | long | 账号用途为数据库账号时该字段生效,表示数据库账号对应的系统账号ID | | ||
| os | string | 账号用途为系统账号时该字段生效,账号对应的OS | | ||
| description | string | 账号描述 | | ||
| creator | string | 创建人 | | ||
| create_time | long | 创建时间Unix时间戳(ms) | | ||
| last_modify_user | string | 最近一次修改人 | | ||
| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | |
Oops, something went wrong.