Obtaining the List of Image Retention Policy
Function
Obtain the list of image retention policy.
URI
GET /v2/manage/namespaces/{namespace}/repos/{repository}/retentions
Table 1 describes the parameters.
Request
- Request parameters
Table 2 Request header parameters Parameter
Mandatory
Type
Description
Content-Type
Yes
String
Message body type (format). The value can be application/json or charset=utf-8 application/json.
The default value is application/json.
X-Auth-Token
Yes
String
User token.
The token can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.
- Example request
GET https://{Endpoint}/v2/manage/namespaces/group/repos/busybox/retentions
By default, 100 records will be returned.
Response
- Response parameters
Status code: 200
Table 3 Response body parameter description Parameter
Type
Description.
[Array element]
Array of objects
Obtaining the list of image retention policy.
Table 4 [Array element] parameters description Parameter
Type
Description
algorithm
String
Retention policy matching rule. The value is or.
id
Integer
Rule ID.
rules
Array of objects
Image retention policy.
scope
String
Reserved field.
Table 5 rules parameter description Parameter
Type
Description
template
String
Retention policy type. The value can be date_rule (number of days) or tag_rule (number of tags).
params
Object
- If template is set to date_rule, set params to {"days": "xxx"}.
- If template is set to tag_rule, set params to {"num": "xxx"}.
tag_selectors
Array of objects
Image tags that are not counted in the retention policy.
- Example response
Status Code
Status Code |
Description |
---|---|
200 |
Request successful. |
400 |
Request error. |
401 |
Authentication failed. |
404 |
The organization does not exist. |
500 |
Internal error. |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot