gcloud_alpha_resources_list (1)
NAME
- gcloud alpha resources list - list Google Cloud resources accessible from your account
SYNOPSIS
-
gcloud alpha resources list [--filter=FILTER] [--limit=LIMIT] [--page-size=PAGE_SIZE; default=500] [--sort-by=[FIELD,...]] [--uri] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(ALPHA) gcloud alpha resources list lists all indexed Google Cloud
FLAGS
-
- --filter=FILTER
-
A filter expression that is rewritten into a CloudResourceSearch query
expression. It is applied to the resource specific data in the search results.
By default all indexed resources are listed. Use @type:COLLECTION to select resources for COLLECTION. It is an error to specify a COLLECTION not indexed by the API. The supported collections are:-
- ---
- cloudresourcemanager.projects
- ---
- compute.disks
- ---
- compute.healthChecks
- ---
- compute.httpHealthChecks
- ---
- compute.httpsHealthChecks
- ---
- compute.images
- ---
- compute.instanceGroups
- ---
- compute.instances
- ---
- compute.subnetworks
-
Collections named resources.RESOURCE-TYPE may be used for
debugging, where RESOURCE-TYPE is defined by the CloudResourceSearch API.
See $ gcloud topic filters for filter expression details.
LIST COMMAND FLAGS
-
- --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; default=500
-
Some services group resource list output into pages. This flag specifies the
maximum number of resources per page. The default is 500. 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.
- --uri
-
Print a list of resource URIs instead of the default output.
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
EXAMPLES
List all compute instances URIs with names starting with test or prod:
-
$ gcloud alpha resources list --uri \
--filter="@type:compute.instances name:(test prod)"
Print the number of resources with any part containing the substring foobar:
- $ gcloud alpha resources list --filter="foobar" --uri | wc -l
The previous command uses --uri to count because each output line is the URI for one resource. Otherwise the resource descriptions could be multiple lines per resource.
NOTES
This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you will have to apply for early access and have your projects registered on the API whitelist to use it. To do so, contact Support at cloud.google.com/support