gdcloud-Themenformate

NAME

gdcloud topic formats – Zusätzliche Hilfe zu Ressourcenformaten.

BESCHREIBUNG

Viele gdcloud-Befehlszeilenbefehle geben bei Erfolg eine Liste von Ressourcen zurück. Standardmäßig werden sie in der Standardausgabe angezeigt. Mit dem Flag --format=NAME[PROJECTIONS] können Sie die Standardausgabe formatieren und in ein aussagekräftigeres Ergebnis ändern.

Mit dem Flag --format können Sie das Standardausgabeformat eines Befehls ändern. Ressourcenformate werden später ausführlich beschrieben.

Mit Projektionen können Sie eine Teilmenge von Ressourcenschlüsseln in einer Ressource auflisten.

Hinweis: Wenn Sie auf eine Liste von Feldern verweisen möchten, können Sie die einzelnen Ressourcen sortieren und formatieren. Sie können den Befehl list mit dem Format yaml, json, csv, text oder table ausführen. Beispiel:

gdcloud clusters list --format=yaml

Formate

Mit einem Formatausdruck wird das Standardausgabeformat eines Befehls geändert. Es sind viele Ausgabeformate verfügbar, einige für die formatierte Ausgabe, die für Menschen lesbar ist, und andere für die Rückgabe von maschinenlesbarer Ausgabe. Ein Formatierungsausdruck besteht aus zwei Teilen:

NAME name

PROJECTIONS [ resource-key [, …] ]

NAME ist erforderlich und PROJECTIONS kann auf die Formate csv, text und table angewendet werden. Unbekannte Werte werden automatisch ignoriert. Jeder gdcloud list-Befehl hat einen Standardformatierungsausdruck. Mit dem Flag --format kann die Standardeinstellung geändert oder ersetzt werden. Beispiel:

In --format="table(clusterref.name,controlPlane.name,controlPlane.image)" werden Ressourcen der Steuerungsebene in Tabellenform aufgeführt.

--format=json listet die Ressource im JSON-Format auf.

Folgende Formate sind verfügbar:

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

## Tabelle

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.

BEISPIELE

Status aller Clusterinformationen im JSON-Format auflisten

gdcloud clusters list --format=json

Clusterreferenzdetails des Nutzerclusters ausgeben

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