文档首页> 代码托管 CodeArts Repo> API参考> API> Repository> 查询某个仓库的详细信息
更新时间:2023-07-20 GMT+08:00
分享

查询某个仓库的详细信息

功能介绍

根据仓库UUID(由CreateRepository接口返回)获取仓库信息仓库信息。返回 包含id,name,组名,仓库访问URL。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v2/repositories/{repository_uuid}

表1 路径参数

参数

是否必选

参数类型

描述

repository_uuid

String

仓库的uuid

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。

通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

error

Error object

响应错误

result

RepoInfoV2 object

响应结果

status

String

响应状态

表4 Error

参数

参数类型

描述

code

String

错误码

message

String

错误信息

表5 RepoInfoV2

参数

参数类型

描述

created_at

String

创建时间

creator_name

String

创建者的用户名,在用户是租户的情况下,用户名和租户名相等

domain_name

String

创建者的租户名

group_name

String

仓库组名(克隆地址中域名后面仓库名前的一段 示例:git@repo.alpha.devcloud.inhuawei.com:Demo00228/testword.git 组名:Demo00228 )

https_url

String

使用 https 克隆仓库时所使用的 url

iam_user_uuid

String

用户的 iam user uuid

is_owner

Integer

当前用户是否是仓库的创建者,1:是,0:不是

lfs_size

String

仓库 LFS 容量,单位为M,大于 1024M 则单位为 G

project_is_deleted

String

项目是否被删除

project_uuid

String

项目ID,获取方式请参见获取项目ID

repository_id

Integer

仓库主键id

repository_name

String

仓库名

repository_size

String

仓库总容量 = 仓库 LFS 容量 + git 库容量,单位为M,大于 1024M 则单位为 G

repository_uuid

String

仓库uuid(由CreateRepository接口返回)

ssh_url

String

使用 ssh 方式克隆仓库时所使用的 url

star

Boolean

当前用户是否收藏该仓库

status

Integer

仓库状态, 0:仓库正常创建成功 1:仓库创建中 2:创建失败 3:仓库冻结 4:仓库已经关闭

updated_at

String

更新时间

userRole

Integer

用户在仓库中的权限:20:只读成员 30:普通成员 40:管理员

visibility_level

Integer

是否可见:0私有仓库,20公有仓库

web_url

String

web url 路径,访问它将跳转至仓库详情页

请求示例

GET https://{endpoint}/v2/repositories/{repository_uuid}

响应示例

状态码: 200

OK

{
  "result" : {
    "repository_uuid" : "045ceabb9aea40579d5a759e84fa7f0a",
    "repository_id" : 468485,
    "repository_name" : "CreatRepository_MI9Af",
    "ssh_url" : "git@repo.alpha.devcloud.inhuawei.com:Demo00228/CreatRepository_MI9Af.git",
    "https_url" : "https://repo.alpha.devcloud.inhuawei.com/Demo00228/CreatRepository_MI9Af.git",
    "group_name" : "Demo00228",
    "web_url" : "https://alpha.devcloud.inhuawei.com/repo/468485/home",
    "visibility_level" : 0,
    "created_at" : "2019-10-15 09:40:27",
    "updated_at" : null,
    "repository_size" : null,
    "lfs_size" : null,
    "creator_name" : null,
    "domain_name" : null,
    "star" : null,
    "status" : null,
    "is_owner" : null,
    "iam_user_uuid" : null,
    "project_uuid" : "4838955a48e2492bbe44b31bc4c272f6",
    "project_is_deleted" : "false",
    "userRole" : null
  },
  "status" : "success"
}

状态码

状态码

描述

200

OK

错误码

请参见错误码

分享:

    相关文档

    相关产品