更新时间:2024-12-02 GMT+08:00

获取镜像老化记录

功能介绍

获取镜像老化记录。

URI

GET /v2/manage/namespaces/{namespace}/repos/{repository}/retentions/histories?offset={offset}&limit={limit}

参数说明请参见表1

表1 参数说明

参数

是否必选

参数类型

描述

namespace

String

组织名称

repository

String

镜像仓库名称

表2 Query参数

参数

是否必选

参数类型

描述

filter

String

应填写 limit::{limit}|offset::{offset}, 其中{limit}为返回条数,{offset}为起始索引, 注意:offset和limit参数需要配套使用

请求消息

  • 请求参数
    表3 请求Header参数

    参数

    是否必选

    参数类型

    描述

    Content-Type

    String

    消息体的类型(格式),下方类型可任选其一使用: application/json;charset=utf-8 application/json

    缺省值:application/json

    X-Auth-Token

    String

    用户Token。

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

  • 请求样例
    GET https://{Endpoint}/v2/manage/namespaces/group/repos/busybox/retentions/histories

响应消息

  • 响应参数
    状态码: 200
    表4 Response Header参数说明

    参数

    参数类型

    描述

    Content-Range

    String

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

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

    表5 Response Body参数说明

    参数

    参数类型

    描述

    retention_log

    Array of objects

    镜像老化日志

    total

    Integer

    总个数

    表6 retention_log参数说明

    参数

    参数类型

    描述

    created_at

    String

    创建时间

    id

    Integer

    ID

    namespace

    String

    组织名

    repo

    String

    镜像仓库名

    retention_id

    Integer

    老化规则ID

    rule_type

    String

    规则

    tag

    String

    镜像版本

  • 响应样例

    状态码: 200

    请求成功
    {
        "retention_log": [
            {
                "created_at": "2020-04-17T08:01:09.658309Z",
                "id": 9088,
                "namespace": "hwstaff_l00283074",
                "repo": "experience_2048",
                "retention_id": 91,
                "rule_type": "{\"template\":\"tag_rule\",\"params\":{\"num\":\"7\"},\"tag_selectors\":[]}",
                "tag": "4"
            }
        ],
        "total": 1
    }

状态码

状态码

描述

201

请求成功

400

错误的请求

401

鉴权失败

404

组织不存在

500

内部错误

错误码

请参见错误码