Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Container Registry
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Authentication in Yandex Container Registry
    • Managing a Docker image
      • Getting information about available Docker images
      • Creating a Docker image
      • Pushing a Docker image to a registry
      • Pulling a Docker image from a registry
      • Deleting a Docker image from a registry
    • Managing a registry
      • Getting information about existing registries
      • Creating a registry
      • Updating a registry
      • Deleting a registry
    • Managing a repository
      • Getting information about existing repositories
    • Managing policies for automatically deleting Docker images
      • Getting information about existing lifecycle policies
      • Creating a lifecycle policy
      • Updating a lifecycle policy
      • Performing lifecycle policy dry runs
      • Deleting a lifecycle policy
    • Working with roles
      • Assign a role
      • Viewing assigned roles
      • Revoke a role
  • Yandex Container Solution
  • Use cases
    • All use cases
    • Running a Docker image on a VM
  • Concepts
    • Overview
    • Docker image
    • Registry
    • Repository
    • Policies for automatically deleting Docker images
    • Backups
    • Quotas and limits
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • ImageService
      • LifecyclePolicyService
      • RegistryService
      • RepositoryService
      • ScannerService
      • OperationService
    • REST
      • Overview
      • Image
        • Overview
        • delete
        • get
        • list
      • LifecyclePolicy
        • Overview
      • Registry
        • Overview
        • create
        • delete
        • get
        • list
        • listAccessBindings
        • setAccessBindings
        • update
        • updateAccessBindings
      • Repository
        • Overview
        • get
        • list
        • listAccessBindings
        • setAccessBindings
        • updateAccessBindings
      • Scanner
        • Overview
  • Troubleshooting
  • Questions and answers
  1. Step-by-step instructions
  2. Managing policies for automatically deleting Docker images
  3. Getting information about existing lifecycle policies

Getting information about lifecycle policies

  • Getting a list of lifecycle policies in a repository or registry
  • Getting information about a lifecycle policy

Find out how to get:

  • A list of lifecycle policies in a repository or registry
  • Detailed information about a lifecycle policy

Getting a list of lifecycle policies in a repository or registry

CLI

If you don't have the Yandex.Cloud command line interface yet, install and initialize it.

  • Get a list of lifecycle policies in a repository:

    $ yc container repository lifecycle-policy list --repository-name crp2hlbs67tj4ggrfodb/ubuntu
    
    +----------------------+-------------+----------------------+----------+---------------------+--------------------------------+
    |          ID          |    NAME     |    REPOSITORY ID     |  STATUS  |       CREATED       |          DESCRIPTION           |
    +----------------------+-------------+----------------------+----------+---------------------+--------------------------------+
    | crp6lg1868p3i0emkv1b | test-policy | crp3cpm16edqql0t30s2 | DISABLED | 2020-05-28 15:05:58 | disabled lifecycle-policy for  |
    |                      |             |                      |          |                     | tests                          |
    +----------------------+-------------+----------------------+----------+---------------------+--------------------------------+
    
  • Get a list of lifecycle policies in a registry:

    $ yc container repository lifecycle-policy list --registry-id crp2hlbs67tj4ggrfodb
    
    +----------------------+-------------+----------------------+----------+---------------------+--------------------------------+
    |          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 |                                |
    +----------------------+-------------+----------------------+----------+---------------------+--------------------------------+
    

Getting information about a lifecycle policy

CLI

If you don't 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 crp6lg1868p3i0emkv1b

id: crp6lg1868p3i0emkv1b
name: test-policy
repository_id: crp3cpm16edqql0t30s2
description: disabled lifecycle-policy for tests
status: DISABLED
created_at: "2020-05-28T15:05:58.143Z"
rules:
- description: remove prod images older than 60 days except 20 last ones
expire_period: 5184000s
tag_regexp: prod
retained_top: "20"
- description: remove all test and untagged images older than 48 hours
expire_period: 172800s
tag_regexp: test.*
untagged: true
In this article:
  • Getting a list of lifecycle policies in a repository or registry
  • Getting information about a lifecycle policy
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC