镜像仓库接口
更新时间:2025-04-30
使用前提
查询镜像仓库列表
接口描述
查询镜像仓库列表。
请求结构
Plain Text
1GET /v1/instances/{instanceId}/projects/{projectName}/repositories?repositoryName={repositoryName}&pageNo={pageNo}&pageSize={pageSize} HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
instanceId | String | 是 | Path参数 | 实例ID |
projectName | String | 是 | Path参数 | 命名空间名称 |
repositoryName | String | 否 | Query参数 | 镜像仓库名称 |
pageNo | Integer | 否 | Query参数 | 当前页 |
pageSize | Integer | 否 | Query参数 | 每页记录数,默认10,最大100 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
total | Integer | 记录总数 |
pageNo | Integer | 当前页 |
pageSize | Integer | 每页记录数 |
items | List<Repository> | 结果列表 |
请求示例
Plain Text
1GET /v1/instances/ccr-4k74gw7d/projects/ns-test/repositories HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: bce-auth-v1/687882a4ec614bf788766895ecebb7f5/2022-07-29T06:01:42Z/1800/content-type;host/119caf7a75eae7423aebefca3648374053a0fe3817ae11a1664b33af7d57dfa5
响应示例
Plain Text
1 Content-Type: application/json; charset=utf-8
2 Date: Thu, 28 Jul 2022 03:25:43 GMT
3 X-Bce-Gateway-Region: BJ
4 X-Bce-Request-Id: b42840ec-a200-49c9-86bd-58687b7009bb
5
6{
7 "total": 2,
8 "pageNo": 1,
9 "pageSize": 10,
10 "items": [
11 {
12 "tagCount": 1,
13 "creationTime": "2022-07-29T02:55:57.041Z",
14 "description": "",
15 "repositoryName": "python2",
16 "pullCount": 0,
17 "updateTime": "2022-07-29T02:55:57.041Z",
18 "repositoryPath": "ccr-4k74gw7d-pub.cnc.bd.baidubce.com/ns-test/python2",
19 "privateRepositoryPath": "ccr-4k74gw7d-vpc.cnc.bd.baidubce.com/ns-test/python2",
20 "projectName": "ns-test"
21 },
22 {
23 "tagCount": 2,
24 "creationTime": "2022-07-29T02:53:34.289Z",
25 "description": "",
26 "repositoryName": "ubuntu",
27 "pullCount": 0,
28 "updateTime": "2022-07-29T02:53:34.289Z",
29 "repositoryPath": "ccr-4k74gw7d-pub.cnc.bd.baidubce.com/ns-test/ubuntu",
30 "privateRepositoryPath": "ccr-4k74gw7d-vpc.cnc.bd.baidubce.com/ns-test/ubuntu",
31 "projectName": "ns-test"
32 }
33 ]
34}
通过镜像仓库名称查询镜像仓库
接口描述
通过镜像仓库名称查询镜像仓库。
请求结构
Plain Text
1 GET /v1/instances/{instanceId}/projects/{projectName}/repositories/{repositoryName} HTTP/1.1
2 Host: ccr.bd.baidubce.com
3 Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
instanceId | String | 是 | Path参数 | 实例ID |
projectName | String | 是 | Path参数 | 命名空间名称 |
repositoryName | String | 是 | Path参数 | 镜像仓库名称 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
projectName | String | 命名空间名称 |
repositoryName | String | 镜像仓库名称 |
description | String | 镜像仓库描述 |
repositoryPath | String | 公网访问镜像路径 |
privateRepositoryPath | String | vpc 内访问镜像路径 |
tagCount | Integer | 镜像的Tag个数 |
pullCount | Integer | 镜像拉取次数 |
creationTime | String | 创建时间 |
updateTime | String | 更新时间 |
请求示例
Plain Text
1 GET /v1/instances/ccr-4k74gw7d/projects/ns-test/repositories/ubuntu HTTP/1.1
2 Host: ccr.bd.baidubce.com
3 Authorization: bce-auth-v1/687882a4ec614bf788766895ecebb7f5/2022-07-29T06:01:42Z/1800/content-type;host/119caf7a75eae7423aebefca3648374053a0fe3817ae11a1664b33af7d57dfa5
响应示例
Plain Text
1 Content-Type: application/json; charset=utf-8
2 Date: Thu, 28 Jul 2022 03:25:43 GMT
3 X-Bce-Gateway-Region: BJ
4 X-Bce-Request-Id: b42840ec-a200-49c9-86bd-58687b7009bb
5
6{
7 "tagCount": 2,
8 "creationTime": "2022-07-29T02:53:34.289Z",
9 "description": "",
10 "repositoryName": "ubuntu",
11 "pullCount": 0,
12 "updateTime": "2022-07-29T02:53:34.289Z",
13 "repositoryPath": "ccr-4k74gw7d-pub.cnc.bd.baidubce.com/ns-test/ubuntu",
14 "privateRepositoryPath": "ccr-4k74gw7d-vpc.cnc.bd.baidubce.com/ns-test/ubuntu",
15 "projectName": "ns-test"
16}
修改单个镜像仓库
接口描述
修改单个镜像仓库。
请求结构
Plain Text
1 PUT /v1/instances/{instanceId}/projects/{projectName}/repositories/{repositoryName} HTTP/1.1
2 Host: ccr.bd.baidubce.com
3 Authorization: authorization string
4
5 {
6 "description":"${description}"
7 }
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
instanceId | String | 是 | Path参数 | 实例ID |
projectName | String | 是 | Path参数 | 命名空间名称 |
repositoryName | String | 是 | Path参数 | 镜像仓库名称 |
description | String | 是 | Body参数 | 镜像仓库描述信息 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
projectName | String | 命名空间名称 |
repositoryName | String | 镜像仓库名称 |
description | String | 镜像仓库描述 |
repositoryPath | String | 公网访问镜像路径 |
privateRepositoryPath | String | vpc 内访问镜像路径 |
tagCount | Integer | 镜像的Tag个数 |
pullCount | Integer | 镜像拉取次数 |
creationTime | String | 创建时间 |
updateTime | String | 更新时间 |
请求示例
Plain Text
1 PUT /v1/instances/ccr-4k74gw7d/projects/ns-test/repositories/ubuntu HTTP/1.1
2 Host: ccr.bd.baidubce.com
3 Authorization: bce-auth-v1/687882a4ec614bf788766895ecebb7f5/2022-07-29T06:01:42Z/1800/content-type;host/119caf7a75eae7423aebefca3648374053a0fe3817ae11a1664b33af7d57dfa5
4 {
5 "description":"update desc"
6 }
响应示例
Plain Text
1 Content-Type: application/json; charset=utf-8
2 Date: Thu, 28 Jul 2022 03:25:43 GMT
3 X-Bce-Gateway-Region: BJ
4 X-Bce-Request-Id: b42840ec-a200-49c9-86bd-58687b7009bb
5
6
7{
8 "tagCount": 2,
9 "creationTime": "2022-07-29T02:53:34.289Z",
10 "description": "update desc",
11 "repositoryName": "ubuntu",
12 "pullCount": 0,
13 "updateTime": "2022-07-29T05:09:09.899Z",
14 "repositoryPath": "ccr-4k74gw7d-pub.cnc.bd.baidubce.com/ns-test/ubuntu",
15 "privateRepositoryPath": "ccr-4k74gw7d-vpc.cnc.bd.baidubce.com/ns-test/ubuntu",
16 "projectName": "ns-test"
17}
删除单个镜像仓库
接口描述
删除单个镜像仓库。
请求结构
Plain Text
1 DELETE /v1/instances/{instanceId}/projects/{projectName}/repositories/{repositoryName} HTTP/1.1
2 Host: ccr.bd.baidubce.com
3 Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
instanceId | String | 是 | Path参数 | 实例ID |
projectName | String | 是 | Path参数 | 命名空间名称 |
repositoryName | String | 是 | Path参数 | 镜像仓库名称 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
无响应参数
请求示例
Plain Text
1 DELETE /v1/instances/ccr-4k74gw7d/projects/ns-test/repositories/ubuntu-1 HTTP/1.1
2 Host: ccr.bd.baidubce.com
3 Authorization: authorization string
4
响应示例
Plain Text
1 Content-Type: application/json; charset=utf-8
2 Date: Thu, 28 Jul 2022 03:25:43 GMT
3 X-Bce-Gateway-Region: BJ
4 X-Bce-Request-Id: b42840ec-a200-49c9-86bd-58687b7009bb
批量删除镜像仓库
接口描述
批量删除镜像仓库。
请求结构
Plain Text
1 DELETE /v1/instances/{instanceId}/projects/{projectName}/repositories HTTP/1.1
2 Host: ccr.bd.baidubce.com
3 Authorization: authorization string
4
5 {
6 "items":["{repositoryName}","{repositoryName}"]
7 }
8
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
instanceId | String | 是 | Path参数 | 实例ID |
projectName | String | 是 | Path参数 | 命名空间名称 |
items | List<String> | 是 | Body参数 | 镜像仓库名称数组 |
响应参数
无响应参数。
请求示例
Plain Text
1 DELETE /v1/instances/ccr-4k74gw7d/projects/ns-test/repositories HTTP/1.1
2 Host: ccr.baidubce.com
3 Authorization: authorization string
4 {
5 "items":["ubuntu-4","ubuntu-3"]
6 }
响应示例
Plain Text
1 Content-Type: application/json; charset=utf-8
2 Date: Thu, 28 Jul 2022 03:25:43 GMT
3 X-Bce-Gateway-Region: BJ
4 X-Bce-Request-Id: b42840ec-a200-49c9-86bd-58687b7009bb