更新时间:2024-04-19 GMT+08:00

查询镜像仓库列表

功能介绍

查询镜像仓库列表。

URI

GET /v2/manage/repos

表1 Query参数

参数

是否必选

参数类型

描述

namespace

String

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

name

String

镜像仓库名称

category

String

镜像仓库分类,可设置为app_server, linux, framework_app, database, lang, other, arm。

limit

String

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

offset

String

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

order_column

String

按列排序,可设置为updated_at(按更新时间排序)。注意:order_column和order_type参数需要配套使用。

order_type

String

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

filter

String

注意:至少要传递一个filter参数。

其中{namespace}为组织名称,模糊匹配。

{name}为镜像仓库名称,模糊匹配。

{category}为镜像仓库分类,可设置为app_server、linux、framework_app、database、lang、other、arm。 {limit}为返回条数,{offset}为起始索引,注意:offset和limit参数需要配套使用。

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

请求消息

  • 请求参数

  • 请求样例
    GET https://{Endpoint}/v2/manage/repos?filter=center::self|namespace::group|name::busybox

响应消息

  • 响应参数
    表2 Response Header参数说明

    参数

    参数类型

    描述

    Content-Range

    String

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

    如果请求时传入offset和limit参数,则在Response Header中会增加Content-Range。

    表3 Response Body参数说明

    参数

    参数类型

    描述

    [数组元素]

    Array of objects

    镜像仓库列表

    表4 [数组元素]参数说明

    参数

    参数类型

    描述

    name

    String

    镜像仓库名称

    category

    String

    镜像仓库类型,取值为app_server、linux、framework_app、database、lang、other、arm。

    description

    String

    镜像仓库描述

    size

    Integer

    镜像仓库中镜像总大小

    is_public

    Boolean

    是否为公有镜像,值为true或false。

    num_images

    Integer

    镜像仓库下镜像版本数量

    num_download

    Integer

    下载次数

    created_at

    String

    镜像仓库创建时间,UTC日期格式,时间为UTC标准时间。

    updated_at

    String

    镜像仓库更新时间,UTC日期格式,时间为UTC标准时间。

    logo

    String

    镜像仓库logo地址(预留)

    url

    String

    镜像仓库logo的url地址(预留)

    path

    String

    集群外部docker pull地址,格式为{Repository address}/{Namespace name}/{Repository name}。

    internal_path

    String

    集群内部docker pull地址,格式为{Repository address}/{Namespace name}/{Repository name}。

    domain_name

    String

    账号名

    namespace

    String

    组织名称

    tags

    Array of strings

    镜像版本列表

    status

    Boolean

    状态(预留)

    total_range

    Integer

    总记录条数

  • 响应样例
    [
        {
            "name": "busybox",
            "category": "linux",
            "description": "this is a busybox repository",
            "size": 200977474,
            "is_public": false,
            "num_images": 2,
            "num_download": 0,
            "created_at": "2021-06-10T03:24:44.784402Z",
            "updated_at": "2021-06-10T03:40:59.199352Z",
            "logo": "",
            "url": "",
            "path": "{Repository address}/group/busybox",
            "internal_path": "{Repository address}/group/busybox",
            "domain_name": "root",
            "namespace": "group",
            "tags": [
                "latest",
                "log"
            ],
            "status": false,
            "total_range": 1
        }
    ]

状态码

状态码

描述

200

请求成功

400

错误请求,返回错误信息。

401

鉴权失败的报错信息

500

服务器内部错误,返回错误信息。

错误码

请参见错误码