Help Center> SoftWare Repository for Container> API Reference> API> Obtaining an Image Retention Policy Record

Obtaining an Image Retention Policy Record

Function

Obtain the details of an image retention policy.

URI

GET /v2/manage/namespaces/{namespace}/repos/{repository}/retentions/{retention_id}

Table 1 describes the parameters.

Table 1 Parameter description

Parameter

Mandatory

Type

Description

namespace

Yes

String

Organization name

repository

Yes

String

Image repository name

retention_id

Yes

String

Image retention policy ID

Request

NA

Response

Response parameters

Table 2 Response body parameter description

Parameter

Type

Description

algorithm

String

Retention policy matching rule. The value is or.

id

Interger

ID

rules

Array of object

For details, see Table 3.

scope

String

Reserved field

Response example

{
    "algorithm": "or",
    "id": 222,
    "rules": [
        {
            "params": {
                "days": "30"
            },
            "tag_selectors": [
                {
                    "kind": "label",
                    "pattern": "v5"
                },
                {
                    "kind": "label",
                    "pattern": "1.0.1"
                },
                {
                    "kind": "regexp",
                    "pattern": "^123$"
                }
            ],
            "template": "date_rule"
        }
    ],
    "scope": ""
}

Status Code

Table 3 describes the status codes of this API.

Table 3 Status code

Status Code

Description

200

Operation succeeded.

400

Request error.

401

Authentication failed.

404

The organization does not exist.

500

Failed to complete the request because of an internal service error.