1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-11 23:49:35 +00:00
gcloud-help/gcloud/container/images/list-gcr-usage
2024-03-06 09:53:10 +00:00

118 lines
5 KiB
Text

NAME
gcloud container images list-gcr-usage - list Container Registry usage
SYNOPSIS
gcloud container images list-gcr-usage
(--folder=FOLDER_ID | --organization=ORGANIZATION_ID
| --project=PROJECT_ID) [--filter=EXPRESSION] [--limit=LIMIT]
[--page-size=PAGE_SIZE] [--sort-by=[FIELD,...]] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
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.
EXAMPLES
To list Container Registry usage in a project:
$ gcloud container images list-gcr-usage --project=my-proj
To list Container Registry usage in an organization:
$ gcloud container images list-gcr-usage --organization=my-org
To list Container Registry usage in a folder:
$ gcloud container images list-gcr-usage --folder=my-folder
To list all active Container Registry usage in an organization:
$ gcloud container images list-gcr-usage --organization=my-org \
--filter="usage=ACTIVE"
To list all projects that aren't redirected yet:
$ gcloud container images list-gcr-usage --organization=my-org \
--filter="usage!=REDIRECTED"
REQUIRED FLAGS
Exactly one of these must be specified:
--folder=FOLDER_ID
Folder ID.
--organization=ORGANIZATION_ID
Organization ID.
--project=PROJECT_ID
Project ID.
The Google Cloud project ID to use for this invocation. If omitted,
then the current project is assumed; the current project can be
listed using gcloud config list --format='text(core.project)' and can
be set using gcloud config set project PROJECTID.
--project and its fallback core/project property play two roles in
the invocation. It specifies the project of the resource to operate
on. It also specifies the project for API enablement check, quota,
and billing. To specify a different project for quota and billing,
use --billing-project or billing/quota_project property.
LIST COMMAND FLAGS
--filter=EXPRESSION
Apply a Boolean filter EXPRESSION to each resource item to be listed.
If the expression evaluates True, then that item is listed. For more
details and examples of filter expressions, run $ gcloud topic filters.
This flag interacts with other flags that are applied in this order:
--flatten, --sort-by, --filter, --limit.
--limit=LIMIT
Maximum number of resources to list. The default is unlimited. This
flag interacts with other flags that are applied in this order:
--flatten, --sort-by, --filter, --limit.
--page-size=PAGE_SIZE
Some services group resource list output into pages. This flag
specifies the maximum number of resources per page. The default is
determined by the service if it supports paging, otherwise it is
unlimited (no paging). Paging may be applied before or after --filter
and --limit depending on the service.
--sort-by=[FIELD,...]
Comma-separated list of resource field key names to sort by. The
default order is ascending. Prefix a field with ``~'' for descending
order on that field. This flag interacts with other flags that are
applied in this order: --flatten, --sort-by, --filter, --limit.
GCLOUD WIDE FLAGS
These flags are available to all commands: --access-token-file, --account,
--billing-project, --configuration, --flags-file, --flatten, --format,
--help, --impersonate-service-account, --log-http, --project, --quiet,
--trace-token, --user-output-enabled, --verbosity.
Run $ gcloud help for details.