-
Notifications
You must be signed in to change notification settings - Fork 203
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
feat: 增加查询文件源与凭证详情的ApiGW接口 #2830 #2870
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
### 功能描述 | ||
|
||
查询凭证详情 | ||
|
||
### 请求参数 | ||
|
||
{{ 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 | | ||
| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | | ||
| id | String | 是 | 凭据ID | | ||
|
||
### 请求参数示例 | ||
|
||
- GET | ||
```json | ||
/api/v3/get_credential_detail?bk_scope_type=biz&bk_scope_id=1&id=xxx | ||
``` | ||
|
||
### 返回结果示例 | ||
|
||
```json | ||
{ | ||
"result": true, | ||
"code": 0, | ||
"message": "", | ||
"data": { | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "2", | ||
"id": "xxx", | ||
"name": "xxx", | ||
"type": "xxx", | ||
"description": "xxx", | ||
"creator": "admin", | ||
"create_time": 1712049204719, | ||
"last_modify_user": "admin", | ||
"last_modify_time": "1712049204719" | ||
} | ||
} | ||
``` | ||
|
||
### 返回结果参数说明 | ||
|
||
| 字段 | 类型 | 描述 | | ||
|-----------|-----------|-----------| | ||
| result | bool | 请求成功与否。true:请求成功;false请求失败 | | ||
| code | int | 错误编码。 0表示success,>0表示失败错误 | | ||
| message | string | 请求失败返回的错误信息| | ||
| data | object | 请求返回的数据| | ||
| permission | object | 权限信息| | ||
|
||
##### data | ||
| 字段 | 类型 | 描述 | | ||
| ---------------- | ------ | ------------------------------------------------------------ | | ||
| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | ||
| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | ||
| id | string | 凭据ID | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 统一使用“凭证”,与页面保持一致,其他地方也检查下,有“凭据”的地方都改过来。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改 |
||
| name | string | 凭证名称 | | ||
| type | string | 类型。可选值:APP_ID_SECRET_KEY,PASSWORD,USERNAME_PASSWORD,SECRET_KEY| | ||
| description | string | 描述 | | ||
| creator | string | 作业创建人账号 | | ||
| create_time | long | 创建时间,Unix 时间戳 | | ||
| last_modify_user | string | 作业修改人账号 | | ||
| last_modify_time | long | 最后修改时间,Unix 时间戳 | |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
### 功能描述 | ||
|
||
查询文件源详情 | ||
|
||
### 请求参数 | ||
|
||
{{ 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 | | ||
| bk_biz_id | long | 是 | *已弃用*。业务ID。此字段已被弃用并由字段bk_scope_type+bk_scope_id替换 | | ||
| code | String | 是 | 文件源code | | ||
|
||
### 请求参数示例 | ||
|
||
- GET | ||
```json | ||
/api/v3/get_file_source_detail?bk_scope_type=biz&bk_scope_id=1&code=1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. code=1不太合适,看着像数字,可改为bkrepo-1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改 |
||
``` | ||
|
||
### 返回结果示例 | ||
|
||
```json | ||
{ | ||
"result": true, | ||
"code": 0, | ||
"message": "", | ||
"data": { | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "2", | ||
"id": 0, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. id改为大于0的数字 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改 |
||
"code": "xxx", | ||
"alias": "xxx", | ||
"status": 0, | ||
"file_source_type": 3, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个字段建议改为文件源类型的code There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改 |
||
"is_public": false, | ||
"credential_id": "xxx", | ||
"enable": true, | ||
"creator": "admin", | ||
"create_time": 1712050614742, | ||
"last_modify_user": "admin", | ||
"last_modify_time": 1712050614742 | ||
} | ||
} | ||
``` | ||
|
||
### 返回结果参数说明 | ||
|
||
| 字段 | 类型 | 描述 | | ||
|-----------|-----------|-----------| | ||
| result | bool | 请求成功与否。true:请求成功;false请求失败 | | ||
| code | int | 错误编码。 0表示success,>0表示失败错误 | | ||
| message | string | 请求失败返回的错误信息| | ||
| data | object | 请求返回的数据| | ||
| permission | object | 权限信息| | ||
|
||
##### data | ||
| 字段 | 类型 | 描述 | | ||
| ---------------- | ------ | ------------------------------------------------------------ | | ||
| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | ||
| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | ||
| id | int | 文件源ID | | ||
| code | string | 文件源code | | ||
| alias | string | 文件源别名 | | ||
| status | int | 状态 | | ||
| file_source_type | int | 类型。可选值:蓝鲸制品库 | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个字段建议改为文件源类型的code,类型与描述需要相应修改 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改 |
||
| is_public | bool | 是否为公用文件源 | | ||
| credential_id | string | 凭据ID | | ||
| enable | bool | 是否启用 | | ||
| creator | string | 作业创建人账号 | | ||
| create_time | long | 创建时间,Unix 时间戳 | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 需要注明单位为ms There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改 |
||
| last_modify_user | string | 作业修改人账号 | | ||
| last_modify_time | long | 最后修改时间,Unix 时间戳 | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 需要注明单位为ms There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
### Function Description | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ESB文档可去除,只提供ApiGW的接口 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已去除 |
||
|
||
Query credential details | ||
|
||
### Request Parameters | ||
|
||
{{ common_args_desc }} | ||
|
||
#### 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 | | ||
| id | String | yes | Credential 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": "xxx" | ||
} | ||
``` | ||
|
||
### Example of responses | ||
|
||
```json | ||
{ | ||
"result": true, | ||
"code": 0, | ||
"message": "", | ||
"data": { | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "2", | ||
"id": "xxx", | ||
"name": "xxx", | ||
"type": "xxx", | ||
"description": "xxx", | ||
"creator": "admin", | ||
"create_time": 1712049204719, | ||
"last_modify_user": "admin", | ||
"last_modify_time": "1712049204719" | ||
} | ||
} | ||
``` | ||
|
||
### 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 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 | | ||
| id | string | Credential ID | | ||
| name | string | Credential name | | ||
| type | string | Type. Optional values:APP_ID_SECRET_KEY,PASSWORD,USERNAME_PASSWORD,SECRET_KEY| | ||
| description | string | 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) | |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
### Function Description | ||
|
||
Query file source details | ||
|
||
### Request Parameters | ||
|
||
{{ common_args_desc }} | ||
|
||
#### 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 code | | ||
|
||
### 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": "xxx" | ||
} | ||
``` | ||
|
||
### Example of responses | ||
|
||
```json | ||
{ | ||
"result": true, | ||
"code": 0, | ||
"message": "", | ||
"data": { | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "2", | ||
"id": 0, | ||
"code": "xxx", | ||
"alias": "xxx", | ||
"status": 0, | ||
"file_source_type": 3, | ||
"is_public": false, | ||
"credential_id": "xxx", | ||
"enable": true, | ||
"creator": "admin", | ||
"create_time": 1712050614742, | ||
"last_modify_user": "admin", | ||
"last_modify_time": 1712050614742 | ||
} | ||
} | ||
``` | ||
|
||
### 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 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 | | ||
| id | int | File source ID | | ||
| code | string | File source code | | ||
| alias | string | File source alias | | ||
| status | int | Status | | ||
| file_source_type | int | File source type.Optional values: blueking artifactory | | ||
| is_public | bool | Is it a public file source | | ||
| credential_id | string | Credential ID | | ||
| enable | bool | Enable | | ||
| 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) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
统一使用“凭证”,与页面保持一致,其他地方也检查下,有“凭据”的地方都改过来。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已改