-
Notifications
You must be signed in to change notification settings - Fork 201
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
Merged
jsonwan
merged 3 commits into
TencentBlueKing:master
from
liuliaozhong:master_issue_2830
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,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=2&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 | | ||
| name | string | 凭证名称 | | ||
| type | string | 类型。可选值:APP_ID_SECRET_KEY,PASSWORD,USERNAME_PASSWORD,SECRET_KEY| | ||
| description | string | 描述 | | ||
| creator | string | 作业创建人账号 | | ||
| create_time | long | 创建时间,Unix时间戳(ms) | | ||
| last_modify_user | string | 作业修改人账号 | | ||
| last_modify_time | long | 最后修改时间,Unix时间戳(ms) | |
85 changes: 85 additions & 0 deletions
85
docs/apidoc/bk-api-gateway/v3/zh/get_file_source_detail.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,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=2&code=bkrepo-1 | ||
``` | ||
|
||
### 返回结果示例 | ||
|
||
```json | ||
{ | ||
"result": true, | ||
"code": 0, | ||
"message": "", | ||
"data": { | ||
"bk_scope_type": "biz", | ||
"bk_scope_id": "2", | ||
"id": 10001, | ||
"code": "bkrepo-1", | ||
"alias": "xxx", | ||
"status": 0, | ||
"file_source_type_code": "BLUEKING_ARTIFACTORY", | ||
"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_code | string | 文件源类型code。可选值:BLUEKING_ARTIFACTORY | | ||
| is_public | bool | 是否为公用文件源 | | ||
| credential_id | string | 凭证ID | | ||
| enable | bool | 是否启用 | | ||
| 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
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
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
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
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
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
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
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
21 changes: 21 additions & 0 deletions
21
...in/java/com/tencent/bk/job/file_gateway/model/req/esb/v3/EsbGetFileSourceDetailV3Req.java
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,21 @@ | ||
package com.tencent.bk.job.file_gateway.model.req.esb.v3; | ||
|
||
import com.tencent.bk.job.common.esb.model.EsbAppScopeReq; | ||
import com.tencent.bk.job.common.validation.NotBlankField; | ||
import com.tencent.bk.job.common.validation.NotContainSpecialChar; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
@EqualsAndHashCode(callSuper = true) | ||
@Data | ||
public class EsbGetFileSourceDetailV3Req extends EsbAppScopeReq { | ||
|
||
/** | ||
* 文件源Code | ||
*/ | ||
@ApiModelProperty(value = "文件源Code") | ||
@NotBlankField(fieldName = "code") | ||
@NotContainSpecialChar(fieldName = "code") | ||
private String code; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
这里不要直接改接口路径,避免发布时任务异常。
添加一个新的接口,并将老接口标记为Deprecated,在下个大版本再删除,以实现无损发布。
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.
已修改