更新时间:2024-04-15 GMT+08:00
分享

查询共享镜像列表

功能介绍

查询共享镜像列表

接口约束

调用方法

请参见如何调用API

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

String

返回条数。注意:offset和limit参数需要配套使用。

offset

String

起始索引。取值范围:0或者limit值的正整数倍。

注意: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

缺省值: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

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

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.cn-north-1.myhuaweicloud.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,无意义

total_range

Long

总记录条数

请求示例

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

响应示例

状态码: 200

请求成功

[ {
  "name" : "huawei",
  "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.cn-north-1.myhuaweicloud.com/namespace/huawei",
  "internal_path" : "100.125.0.198:20202/namespace/huawei",
  "domain_name" : "domian",
  "namespace" : "namespace",
  "tags" : [ "latest" ],
  "status" : true
} ]

状态码

状态码

描述

200

请求成功

400

错误的请求

401

鉴权失败

500

内部错误

错误码

请参见错误码

分享:

    相关文档

    相关产品