gdcloud 주제 형식

이름

gdcloud topic formats - 리소스 형식에 대한 추가 도움말

설명

많은 gdcloud CLI 명령어는 성공 시 리소스 목록을 반환합니다. 기본적으로 표준 출력에 인쇄됩니다. --format=NAME[PROJECTIONS] 플래그를 사용하여 기본 출력을 더 의미 있는 결과로 형식화하고 변경할 수 있습니다.

--format 플래그를 사용하여 명령어의 기본 출력 형식을 변경합니다. 리소스 형식은 나중에 자세히 설명합니다.

프로젝션을 사용하여 리소스의 리소스 키 하위 집합을 나열합니다.

참고 필드 목록을 참조하려면 각 리소스별로 정렬하고 형식을 지정하면 됩니다. 형식이 yaml, json, csv, text 또는 table으로 설정된 list 명령어를 실행할 수 있습니다. 예를 들면 다음과 같습니다.

gdcloud clusters list --format=yaml

형식

형식 표현식은 명령어의 기본 출력 형식을 변경하는 데 사용됩니다. 다양한 출력 형식을 사용할 수 있습니다. 사람이 읽을 수 있는 출력을 예쁘게 인쇄하는 형식과 머신이 읽을 수 있는 출력을 반환하는 형식이 있습니다. 형식 표현식은 두 부분으로 구성됩니다.

NAME name

PROJECTIONS [ resource-key [, …] ]

NAME은 필수이며 PROJECTIONScsv, text, table 형식에 적용할 수 있습니다. 알 수 없는 값은 자동으로 무시됩니다. 각 gdcloud list 명령어에는 기본 형식 표현식이 있습니다. --format 플래그는 기본값을 변경하거나 대체할 수 있습니다. 예를 들면 다음과 같습니다.

--format="table(clusterref.name,controlPlane.name,controlPlane.image)"에는 제어 영역 리소스가 표 형식으로 나열되어 있습니다.

--format=json은 리소스를 JSON 형식으로 나열합니다.

사용 가능한 형식은 다음과 같습니다.

## csv

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

JSON (<https //www.json.org>), JavaScript Object Notation.

## table

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`.

## text

A flattened tree. Each output line contains one `key` `value` pair. Use this format with a projection to define values to print.

## yaml

YAML (<https //www.yaml.org>), YAML ain't markup language.

EXAMPLES

JSON 형식으로 모든 클러스터 정보의 상태를 나열합니다.

gdcloud clusters list --format=json

사용자 클러스터의 클러스터 참조 세부정보를 출력합니다.

gdcloud clusters describe user-vm-1 --format="table(clusterref.name,clusterref.namespace)"