You need to enable JavaScript to run this app.
导航
ListResources
最近更新时间:2024.07.02 21:03:13首次发布时间:2024.07.02 21:03:13

查询代码源列表。

请求说明

请求方式:POST
请求地址:https://open.volcengineapi.com/?Action=ListResources&Version=2023-05-01

请求参数

参数类型是否必选示例值描述
ActionStringListResources公共参数,本接口值:ListResources。
VersionString2023-05-01公共参数,本接口值:2023-05-01。
WorkspaceIdString000ce713ebd2487a9b4666c7ed81****工作区 ID。
PageNumberInteger1分页查询时的起始页码,从 1 开始,默认为 1。

PageSize

Integer

10

分页查询时每页显示的记录数,取值:

  • 最小值:1
  • 最大值:100
  • 默认值:10
FilterObject ResourceFilter待查询代码源列表的过滤条件。

ResourceFilter

参数类型是否必选示例值描述

Types

Array of String

["Github"]

待查询代码源类型。取值有:

  • GitHub:GitHub 代码仓库
  • GitLab:GitLab 代码仓库
  • Gitee:Gitee 代码仓库
  • Gerrit:Gerrit 代码仓库
  • BitbucketCloud:BitbucketCloud 代码仓库
  • Git:通用 Git 类型代码仓库
  • Codeup:Codeup代码仓库
NameStringgithub-demo按代码源名称过滤,模糊查询。
IdsArray of String["1bfc821c23594ebbb7df1ae6b636****"]按代码源 ID 过滤,精确查询。

请求示例

POST /?Action=ListResources&Version=2023-05-01 HTTP/1.1
Content-Type:application/json
{
    "WorkspaceId":"000ce713ebd2487a9b4666c7ed81****",
    "Filter":{
        "Types":[
            "Github"
        ],
        "Name":"github-demo",
        "Ids":[
            "1bfc821c23594ebbb7df1ae6b636****"
        ]
    }
}

返回参数

参数类型示例值描述
TotalCountInteger10代码源总数。
ItemsArray of Resource代码源列表。
PageNumberInteger1当前页码。
PageSizeInteger10单页数量。

Resource

参数类型示例值描述
IdString1bfc821c23594ebbb7df1ae6b636****代码源 ID。
WorkspaceIdString000ce713ebd2487a9b4666c7ed81****工作区 ID。
NameStringtest代码源名称。
DescriptionString这是一段描述代码源描述。
TypeStringGitee代码源类型。
ConfigurationObject ResourceConfiguration代码源配置信息。

Creator

Object IAMUser

{
"AccountId": 24506499****,
"UserId": 0
}

代码源创建人。

CreateTimeString2021-07-19T12:21:31Z代码源创建时间。
UpdateTimeString2021-07-19T12:22:31Z代码源更新时间。

ResourceConfiguration

参数类型示例值描述
GitObject GitConfigurationGit 配置信息。

GitConfiguration

参数类型示例值描述
UrlStringhttps://gitee.com/****代码仓库 URL。
UserTokenString0f6832949f31ef77****用户 Token。
UserNameStringuser用户名。
PasswordStringpwd****密码。
CloneDepthInteger0代码克隆深度,默认值或最小值都为 0。
AccessKeyStringqAfRxTpscsRg****第三方云的 AccessKey。
SecretKeyStringQtlcApscsRgA3****第三方云的 SecretKey。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "20240402200758937550AAA43B9E05****",
        "Action": "ListResources",
        "Version": "2023-05-01",
        "Service": "cp",
        "Region": "cn-beijing",
    },
    "Result": {
        "Items": [
            {
                "Id": "1bfc821c23594ebbb7df1ae6b636****",
                "WorkspaceId": "000ce713ebd2487a9b4666c7ed81****",
                "Name": "test",
                "Type": "Gitee",
                "Configuration": {
                    "Git": {
                        "Url": "[https://gitee.com/](https://gitee.com/)****",
                        "UserToken": "0f6832949f31ef77****",
                        "CloneDepth": 0
                    }
                },
                "CreateTime": "2023-04-28T11:54:24+08:00",
                "UpdateTime": "2023-05-08T22:07:26+08:00",
                "Creator": {
                    "AccountId": 24506499****,
                    "UserId": 0
                }
            }
        ],
        "PageNumber": 1,
        "PageSize": 10,
        "TotalCount": 1
    }
}

错误码

当前接口暂无独立错误码,若接口调用返回异常,可参考 公共错误码 进行故障排查。