UpdateRepository - 更新代码库

更新时间:
复制 MD 格式

更新代码库基本信息、常用设置。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求语法

PUT /repository/{repositoryId} HTTP/1.1

路径参数

名称

类型

必填

描述

示例值

repositoryId

integer

是

代码库 ID

2080398

请求参数

名称

类型

必填

描述

示例值

organizationId

string

是

企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】

60de7a6852743a5162b5f957

accessToken

string

否

个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段

c3c09f1230187a879678da43c973d069

body

object

否

请求 Body

id

integer

否

代码库 ID

2080398

name

string

否

代码库名称

codeup

path

string

否

代码库路径

codeup-demo

description

string

否

代码库描述

codeup描述信息

defaultBranch

string

否

默认分支

master

issuesEnabled

boolean

否

是否开启 issues 可选值:true / false

true

mergeRequestsEnabled

boolean

否

是否开启代码合并 可选值:true / false

true

buildsEnabled

boolean

否

是否开启构建 可选值:true / false

true

wikiEnabled

boolean

否

是否开启 wiki 可选值:true / false

true

snippetsEnabled

boolean

否

是否开启 snippets

false

visibilityLevel

integer

否

代码仓库可见性 0:私有,仅代码库成员可见 10:企业内公开,企业成员可见

0

checkEmail

boolean

否

是否检查邮箱 可选值:true / false

true

avatar

string

否

头像地址

https://xxxx

openCloneDownloadControl

boolean

否

是否开启克隆下载控制 可选值:true / false

false

projectCloneDownloadRoleList

array<object>

否

被允许的拉取代码角色列表

object

否

角色

roleCode

integer

否

角色代码 15:空间成员 60:空间管理员 70:空间拥有者

15

allowed

boolean

否

是否允许 可选值:true / false

true

projectCloneDownloadMethodList

array<object>

否

被允许的拉取代码方法列表

object

否

允许拉取代码的方法

permissionCode

string

否

clone 下载权限码 project:ssh-clone :允许 ssh clone project:http-clone:允许 http clone project:download:允许下载

project:download

allowed

boolean

否

是否允许 可选值:true / false

true

adminSettingLanguage

string

否

仓库主要编程语言(需管理员权限)

Java

返回参数

名称

类型

描述

示例值

object

Schema of Response

requestId

string

请求 ID

EAE03103-5497-58D1-9169-E524DDE8604C

errorMessage

string

错误信息

“”

errorCode

string

错误码

SYSTEM_UNKNOWN_ERROR

success

boolean

调用是否成功

true

result

object

返回结果

id

integer

代码库 ID

2825387

name

string

代码库名称

codeup

nameWithNamespace

string

代码库完整名称(含完整组名称)

codeup-test-org / codeup(斜杠两侧有空格)

path

string

代码库路径

codeup

pathWithNamespace

string

代码库完整路径(含完整组路径)

codeup-test-org / codeup

description

string

代码库描述

codeup代码库描述

defaultBranch

string

默认分支

master

visibilityLevel

integer

可见性 0:私有,仅代码库成员可见 10:企业内公开,企业成员可见

0

sshUrlToRepo

string

代码库的 SSH 克隆地址

git@codeup.aliyun.com:xxx/test/test.git

httpUrlToRepo

string

代码库的 HTTP 克隆地址

https://codeup.aliyun.com/xxx/test/test.git

webUrl

string

代码库的页面访问地址

https://codeup.aliyun.com/xxx/test/test

issuesEnabled

boolean

是否开启 issues 可选值:true / false

true

mergeRequestsEnabled

boolean

是否开启合并请求 可选值:true / false

true

buildsEnabled

boolean

是否开启构建 可选值:true / false

false

wikiEnabled

boolean

是否开启 wiki 可选值:true / false

true

snippetsEnabled

boolean

是否开启 snippets 可选值:true / false

false

createdAt

string

创建时间,格式为 YYYY-MM-DD HH:mm:ss。

2022-03-18 14:24:54

lastActivityAt

string

最后活跃时间

2022-03-20 14:24:54

creatorId

integer

创建者 ID

19238

namespace

object

代码库所属组或企业空间信息

id

integer

组或企业空间 ID

29322

name

string

组或企业空间名称

codeup

path

string

组或企业路径(判断父路径是组还是企业)

地址:https://codeup.aliyun.com/60d54f3daccf2bbd6659f3ad/blank923/repo-test 组路径:blank923 企业路径:60d54f3daccf2bbd6659f3ad

ownerId

integer

组或企业空间的拥有者 ID

19238

createdAt

string

创建时间,格式为 YYYY-MM-DD HH:mm:ss。

2022-02-18 14:24:54

updatedAt

string

更新时间,格式为 YYYY-MM-DD HH:mm:ss。

2022-03-18 14:24:54

description

string

描述

组或企业空间的描述信息

avatar

string

空间的头像地址

https://xxx

visibilityLevel

integer

代码仓库可见性 0:私有 10:企业内公开,企业成员可见

0

archived

boolean

归档标识

false

avatarUrl

string

代码库的头像地址

https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100

示例

正常返回示例

JSON格式

{
  "requestId": "EAE03103-5497-58D1-9169-E524DDE8604C",
  "errorMessage": "“”",
  "errorCode": "SYSTEM_UNKNOWN_ERROR\n",
  "success": true,
  "result": {
    "id": 2825387,
    "name": "codeup",
    "nameWithNamespace": "codeup-test-org / codeup(斜杠两侧有空格)",
    "path": "codeup",
    "pathWithNamespace": "codeup-test-org / codeup",
    "description": "codeup代码库描述",
    "defaultBranch": "master",
    "visibilityLevel": 0,
    "sshUrlToRepo": "git@codeup.aliyun.com:xxx/test/test.git\n",
    "httpUrlToRepo": "https://codeup.aliyun.com/xxx/test/test.git\n",
    "webUrl": "https://codeup.aliyun.com/xxx/test/test\n",
    "issuesEnabled": true,
    "mergeRequestsEnabled": true,
    "buildsEnabled": false,
    "wikiEnabled": true,
    "snippetsEnabled": false,
    "createdAt": "2022-03-18 14:24:54",
    "lastActivityAt": "2022-03-20 14:24:54",
    "creatorId": 19238,
    "namespace": {
      "id": 29322,
      "name": "codeup",
      "path": "地址:https://codeup.aliyun.com/60d54f3daccf2bbd6659f3ad/blank923/repo-test\n组路径:blank923\n企业路径:60d54f3daccf2bbd6659f3ad",
      "ownerId": 19238,
      "createdAt": "2022-02-18 14:24:54",
      "updatedAt": "2022-03-18 14:24:54",
      "description": "组或企业空间的描述信息",
      "avatar": "https://xxx",
      "visibilityLevel": 0
    },
    "archived": false,
    "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100"
  }
}

错误码

HTTP status code

错误码

错误信息

描述

403 Forbidden.AccessDenied The user is not authorized to perform the operation. 用户无权限执行相关操作
403 Forbidden.UserNotAdminOrOwner The current user is not an admin or owner in the organization and is not authorized to perform the operation. 当前用户非该企业管理员或拥有者,无权进行操作。
403 Forbidden.UserNotInCurrentOrganization The user is not in the organization and is not authorized to perform the operation. 当前用户不在该企业中,无权进行操作。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。