NAME
gdcloud topic formats - Supplementary help for resource formats.
DESCRIPTION
Many gdcloud
CLI commands return a list of resources on success. By default, they are pretty-printed in the standard output. The --format=NAME[PROJECTIONS]
flag can be used to format and change the default output to a more meaningful result.
Use the --format
flag to change the default output format of a command. Resource formats are described in detail later.
Use projections to list a subset of resource keys in a resource.
Note To refer to a list of fields, you can sort and format by each resource. You can run a list
command with the format set to yaml
, json
, csv
, text
, or table
. For example,
gdcloud clusters list --format=yaml
Formats
A format expression is used to change the default output format of a command. Many output formats are available; some for pretty-printing human-readable output and others for returning machine-readable output. A format expression has two parts
NAME name
PROJECTIONS [ resource-key [, …] ]
NAME is required and PROJECTIONS can be applied to csv
, text
, and table
formats. Unknown values are silently ignored. Each gdcloud list
command has a default format expression. The --format
flag can alter or replace the default. For example,
--format="table(clusterref.name,controlPlane.name,controlPlane.image)"
lists control plane resources in table format.
--format=json
lists the resource in JSON format.
The available formats are
Comma Separated Values (<https //www.ietf.org/rfc/rfc4180.txt>) with no keys. Use this format with a projection to define values to print.
JSON (<https //www.json.org>), JavaScript Object Notation.
Aligned left-adjusted columns and column headings are the disambiguated right hand components of the column keys in uppercase. For example, the projection keys `(first.name, last.name)` produce the default column heading `('FIRST.NAME', 'LAST.NAME')`. If the screen reader option is `True`, you might observe flattened list output instead of a table with columns. To turn it off, run `gdcloud config set accessibility/screen_reader false`.
A flattened tree. Each output line contains one `key` `value` pair. Use this format with a projection to define values to print.
YAML (<https //www.yaml.org>), YAML ain't markup language.
EXAMPLES
List the status of all clusters information in JSON format
gdcloud clusters list --format=json
Print the cluster reference details of the user cluster
gdcloud clusters describe user-vm-1 --format="table(clusterref.name,clusterref.namespace)"