文档首页/ 容器镜像服务 SWR/ API参考(基础版)/ API/ 镜像仓库管理/ 查询共享镜像列表 - ListSharedReposDetails
更新时间:2026-09-22 GMT+08:00

查询共享镜像列表 - ListSharedReposDetails

功能介绍

查询共享镜像列表

接口约束

无

调用方法

请参见如何调用API。

授权信息

账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。

  • 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
  • 如果使用身份策略授权,需具备如下身份策略权限。

    授权项

    访问级别

    资源类型(*为必须)

    条件键

    别名

    依赖的授权项

    swr:repo:listSharedRepos

    List

    repo *

    -

    -

    -

URI

GET /v2/manage/shared-repositories

表1 Query参数

参数

是否必选

参数类型

描述

namespace

否

String

组织名称。小写字母开头,后面跟小写字母、数字、小数点、下划线或中划线(其中下划线最多允许连续两个,小数点、下划线、中划线不能直接相连),小写字母或数字结尾,1-64个字符。

name

否

String

镜像仓库名称

center

是

String

只能填写self或者thirdparty。self: 我共享的镜像。thirdparty: 他人共享给我的镜像

domain_name

否

String

拥有者账号名称

status

否

String

false:共享已过期。true:正常

limit

否

Integer

返回条数。注意:offset和limit参数需要配套使用。如果不传该参数默认返回的条数是100条,最大返回条数是1000条。

offset

否

Integer

起始索引。注意:offset和limit参数需要配套使用。

order_column

否

String

按列排序,可设置为updated_at(按更新时间排序),name(名称)、tag_count(版本数)、namespace(组织)、domain_name(拥有者)。注意:order_column和order_type参数需要配套使用。

order_type

否

String

排序类型,可设置为desc(降序)、asc(升序)。注意:order_column和order_type参数需要配套使用。

filter

否

String

应填写 center::{center}|name::{name}|limit::{limit}|offset::{offset}|namespace::{namespace}|order_column::{order_column}|order_type::{order_type} ,其中

{center}可选为self: 我共享的镜像。thirdparty: 他人共享给我的镜像,namespace为组织名称,name为镜像仓库名称,

{limit}为返回条数,{offset}为起始索引,{order_column}为按列排序,updated_at(按更新时间排序),name(名称)、tag_count(版本数)、namespace(组织)、domain_name(拥有者),{order_type}为排序类型,可设置为desc(降序)、asc(升序)

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

Content-Type

是

String

消息体的类型(格式),下方类型可任选其一使用:

application/json;charset=utf-8

application/json

X-Auth-Token

是

String

用户Token。

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

响应参数

状态码:200

表3 响应Header参数

参数

参数类型

描述

Content-Range

String

offset(开始索引)-count(当前页记录条数)/total(总记录条数)

表4 响应Body参数

参数

参数类型

描述

[数组元素]

Array of ShowReposResp objects

表5 ShowReposResp

参数

参数类型

描述

name

String

仓库名称

category

String

仓库类型(计划改造,每个镜像会有多个label标示)

description

String

仓库描述信息

size

Long

仓库大小

is_public

Boolean

仓库是否为公共仓库,值为true或false

num_images

Long

仓库中镜像个数,0 ~ 9223372036854775807

num_download

Long

仓库下载次数

created_at

String

仓库创建时间,UTC日期格式,时间为UTC标准时间,用户需要根据本地时间计算偏移量;如东8区需要+8:00

updated_at

String

仓库更新时间,UTC日期格式,时间为UTC标准时间,用户需要根据本地时间计算偏移量;如东8区需要+8:00

logo

String

仓库logo地址(暂时未用)

url

String

仓库logo图片的URL,URL格式。(暂时未用)

path

String

镜像pull路径,格式为 swr.example.com/namespace/repository

internal_path

String

镜像pull路径,格式为 10.125.0.198:20202/namespace/repository

domain_name

String

租户名

namespace

String

租户的组织名称

tags

Array of strings

镜像版本列表

status

Boolean

查询他人共享的镜像时,表示是否过期

取值范围:

  • false:未过期

  • true:已过期

查询我共享的镜像时,默认为false,无意义

total_range

Long

总记录条数

请求示例

GET https://{endpoint}/v2/manage/shared-repositories

响应示例

状态码:200

[ {
  "name" : "nsname",
  "category" : "other",
  "description" : "",
  "size" : 115645792,
  "is_public" : false,
  "num_images" : 1,
  "num_download" : 0,
  "created_at" : "2018-03-21T12:22:37Z",
  "updated_at" : "2018-03-21T12:22:37Z",
  "logo" : "",
  "url" : "",
  "path" : "swr.example.com/namespace/repo_name",
  "internal_path" : "100.125.0.198:20202/namespace/repo_name",
  "domain_name" : "domain_name",
  "namespace" : "namespace",
  "tags" : [ "latest" ],
  "status" : true
} ]

状态码

状态码

描述

200

请求成功

400

错误的请求

401

鉴权失败

500

内部错误

错误码

请参见错误码。