Getting information about lifecycle policies
Written by
Find out how to get:
Retrieving a list of lifecycle policies in a repository or registry
CLI
API
If you don't have the Yandex Cloud command line interface yet, install and initialize it.
-
Retrieve a list of lifecycle policies in a repository:
yc container repository lifecycle-policy list --repository-name crp2hlbs67tj4ggrfodb/ubuntu
Command output:
+----------------------+-------------+----------------------+----------+---------------------+-------------------------------+ | ID | NAME | REPOSITORY ID | STATUS | CREATED | DESCRIPTION | +----------------------+-------------+----------------------+----------+---------------------+-------------------------------+ | crp6lg1868p3i0emkv1b | test-policy | crp3cpm16edqql0t30s2 | DISABLED | 2020-05-28 15:05:58 | disabled lifecycle-policy for | | | | | | | tests | +----------------------+-------------+----------------------+----------+---------------------+-------------------------------+
-
Retrieve a list of lifecycle policies in a registry:
yc container repository lifecycle-policy list --registry-id crp2hlbs67tj4ggrfodb
Command output:
+----------------------+-------------+----------------------+----------+---------------------+-------------------------------+ | ID | NAME | REPOSITORY ID | STATUS | CREATED | DESCRIPTION | +----------------------+-------------+----------------------+----------+---------------------+-------------------------------+ | crp6lg1868p3i0emkv1b | test-policy | crp3cpm16edqql0t30s2 | DISABLED | 2020-05-28 15:05:58 | disabled lifecycle-policy for | | | | | | | tests | | crpbia0qsdqpi28444jn | | crpo17tgeemuto888jdh | DISABLED | 2020-05-28 08:06:14 | | +----------------------+-------------+----------------------+----------+---------------------+-------------------------------+
To retrieve a list of lifecycle policies, use the List method for the LifecyclePolicyService resource.
Getting information about a lifecycle policy
CLI
API
Get detailed information about a lifecycle policy using the id
from the previous item:
yc container repository lifecycle-policy get crp6lg1868p3i0emkv1b
Command output:
id: crp6lg1868p3i0emkv1b
name: test-policy
repository_id: crp3cpm16edqql0t30s2
...
expire_period: 172800s
tag_regexp: test.*
untagged: true
To get detailed information about a lifecycle policy, use the Get method for the LifecyclePolicyService resource. In the lifecycle_policy_id
parameter, specify a policy ID.
You can retrieve a list of policies using the List method for the LifecyclePolicyService resource.