0
0
GCPcloud~10 mins

Output formatting in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to output the name of the Google Cloud project.

GCP
gcloud config get-value [1]
Drag options to blanks, or click blank then click option'
Aregion
Bzone
Caccount
Dproject
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'zone' or 'region' instead of 'project' will output different values.
Forgetting to specify the config key after 'get-value'.
2fill in blank
medium

Complete the command to list all Compute Engine instances in JSON format.

GCP
gcloud compute instances list --format=[1]
Drag options to blanks, or click blank then click option'
Atable
Byaml
Cjson
Dcsv
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'table' outputs a human-readable table, not JSON.
Using 'csv' or 'yaml' outputs other formats.
3fill in blank
hard

Fix the error in the command to output only the instance names in a list.

GCP
gcloud compute instances list --format='value([1])'
Drag options to blanks, or click blank then click option'
Aname
Bzone
Cstatus
DmachineType
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'zone' or 'status' outputs other instance details.
Forgetting to use 'value()' format to get a clean list.
4fill in blank
hard

Fill both blanks to output instance names and their zones in a table format.

GCP
gcloud compute instances list --format='table([1], [2])'
Drag options to blanks, or click blank then click option'
Aname
Bstatus
Czone
DmachineType
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'status' or 'machineType' instead of 'zone' will show wrong columns.
Not separating fields with a comma inside the table format.
5fill in blank
hard

Fill all three blanks to output instance names, zones, and their status filtered by RUNNING state.

GCP
gcloud compute instances list --filter='status=[1]' --format='table([2], [3], status)'
Drag options to blanks, or click blank then click option'
ARUNNING
Bname
Czone
DSTOPPED
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'STOPPED' in filter will show stopped instances, not running.
Mixing up field names in the table format.