Output Formatting
Output formats
grn vks list-clusters --output json # JSON (default)
grn vks list-clusters --output table # Table
grn vks list-clusters --output text # Tab-separated text
JSON (default)
Table
Text
JMESPath query
Use --query to filter response data with JMESPath expressions:
# Get only cluster names
grn vks list-clusters --query "items[].name"
# ["my-cluster", "prod-cluster"]
# Get cluster status
grn vks get-cluster --cluster-id k8s-xxxxx --query "status"
# "ACTIVE"
# Filter clusters by status
grn vks list-clusters --query "items[?status=='ACTIVE'].name"
# ["my-cluster"]