
    b                         S r SSKrSSKJr  SSKJr  SSKJr  SSKJ	r
  \R                  " SSS	.5      r\R                  " \R                  R                  5       " S
 S\R                  5      5       rg)z)Command to list Container Registry usage.    N)	gcr_utils)base)flags)utilsz{description}aG           To list Container Registry usage in a project:

          $ {command} --project=my-proj

        To list Container Registry usage in an organization:

          $ {command} --organization=my-org

        To list Container Registry usage in a folder:

          $ {command} --folder=my-folder

        To list all active Container Registry usage in an organization:

          $ {command} --organization=my-org --filter="usage=ACTIVE"

        To list all projects that aren't redirected yet:

          $ {command} --organization=my-org --filter="usage!=REDIRECTED"
        )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)ListGCRUsage3   a  List Container Registry usage.

List Container Registry usage for all projects in the specified scope
(project/organization/folder). Caller must have
`cloudasset.assets.searchAllResources` permission on the requested scope and
`storage.objects.list permission` on the Cloud Storage buckets used by
Container Registry.

The tool returns the following lists of usage states:

ACTIVE: Container Registry usage has occurred in the last 30 days. The host
location and project are not redirected.

INACTIVE: No Container Registry usage has occurred in the last 30 days. The
host location and project are not redirected.

REDIRECTED: The project has been redirected to Artifact Registry but still has
Container Registry Cloud Storage buckets. This project will continue to
function after Container Registry is turned down and no further action is
required. You can reduce costs by deleting the Container Registry Cloud
Storage buckets.

REDIRECTION_INCOMPLETE: Requests are redirected to Artifact Registry, but data
is still being copied from Container Registry.

LEGACY: Container Registry usage is unknown. This state is caused by legacy
Container Registry projects that store container image metadata files in Cloud
Storage buckets. For more information on legacy Container Registry projects,
see
https://cloud.google.com/container-registry/docs/deprecations/feature-deprecations#container_image_metadata_storage_change.
c                 t    [         R                  " U SSS5        [        R                  R	                  U 5        g )NzProject ID.zOrganization ID.z
Folder ID.)asset_flagsAddParentArgsr   URI_FLAGRemoveFromParser)parsers    .lib/surface/container/images/list_gcr_usage.pyArgsListGCRUsage.ArgsW   s0    	 	MM""6*    c              #      #    [         R                  " UR                  UR                  UR                  5      n[
        R                  " U5      nU H  n[
        R                  " U5      v   M     g 7f)N)asset_utilsGetParentNameForExportorganizationprojectfolderr   ListGCRReposCheckGCRUsage)selfargsparent	gcr_reposgcr_repos        r   RunListGCRUsage.Runa   sY     //F
 &&v.I##H-- s   A/A1 N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr   r#   __static_attributes__r%   r   r   r
   r
   3   s&    @ !-+ +.r   r
   )r*   
frozendict'googlecloudsdk.api_lib.container.imagesr   googlecloudsdk.callioper    googlecloudsdk.command_lib.assetr   r   r   r   r+   ReleaseTracksReleaseTrackGAListCommandr
   r%   r   r   <module>r7      sp     0  = ( A A &&"( 4 D%%(()5.4## 5. *5.r   