Getting information about lifecycle policies
Find out how to get:
Getting a list of lifecycle policies in a repository or registry
Note
In the management console, you can only get a list of lifecycle policies for a repository.
- In the management console
, select the folder the registry was created in. - In the list of services, select Container Registry.
- Select the registry and click the row with its name.
- Select the repository and click the row with its name.
- In the left-hand panel, click
Lifecycle.
If you do not 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 crp2hlbs67tj********/ubuntu
Result:
+----------------------+-------------+----------------------+----------+---------------------+-------------------------------+ | ID | NAME | REPOSITORY ID | STATUS | CREATED | DESCRIPTION | +----------------------+-------------+----------------------+----------+---------------------+-------------------------------+ | crp6lg1868p3******** | test-policy | crp3cpm16edq******** | 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 crp2hlbs67tj********
Result:
+----------------------+-------------+----------------------+----------+---------------------+-------------------------------+ | ID | NAME | REPOSITORY ID | STATUS | CREATED | DESCRIPTION | +----------------------+-------------+----------------------+----------+---------------------+-------------------------------+ | crp6lg1868p3******** | test-policy | crp3cpm16edq******** | DISABLED | 2020-05-28 15:05:58 | disabled lifecycle-policy for | | | | | | | tests | | crpbia0qsdqp******** | | crpo17tgeemu******** | 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
- In the management console
, select the folder the registry was created in. - In the list of services, select Container Registry.
- Select the registry and click the row with its name.
- Select the repository and click the row with its name.
- In the left-hand panel, click
Lifecycle. - Click the name of the lifecycle policy you need.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
Get detailed information about a lifecycle policy using the id
from the previous item:
yc container repository lifecycle-policy get crp6lg1868p3********
Result:
id: crp6lg1868p3********
name: test-policy
repository_id: crp3cpm16edq********
...
expire_period: 172800s
tag_regexp: test.*
untagged: true
To get detailed information about a lifecycle policy, use the Get method for the LifecyclePolicyService resource. Specify the policy ID in the lifecycle_policy_id
parameter.
You can retrieve a list of policies using the List method for the LifecyclePolicyService resource.