Easy1 markMultiple Choice
GCP ACE · Question 03 · Domain 1.1: Setting up cloud projects and accounts
You are automating the setup of a new Google Cloud project using a bash script. You need to enable the Compute Engine API for the project before your script can create any virtual machines.
Which gcloud command should you use?
You are automating the setup of a new Google Cloud project using a bash script. You need to enable the Compute Engine API for the project before your script can create any virtual machines.
Which gcloud command should you use?
Answer options:
A.
gcloud compute apis enable compute.googleapis.com
B.
gcloud services enable compute.googleapis.com
C.
gcloud projects enable-api compute.googleapis.com
D.
gcloud api enable compute.googleapis.com
How to approach this question
Remember that enabling APIs is handled by the Service Usage API, which is accessed via the 'gcloud services' command group.
Full Answer
B.gcloud services enable compute.googleapis.com✓ Correct
gcloud services enable compute.googleapis.com
To enable an API via the Cloud SDK, you use the `gcloud services enable` command followed by the service name (e.g., compute.googleapis.com). The `gcloud services` command group manages the Service Usage API, which controls which APIs are enabled in a project.
Common mistakes
Guessing `gcloud compute` because the API is for Compute Engine, or guessing `gcloud api` because it sounds logical.
Practice the full GCP Associate Cloud Engineer Practice Exam 6
50 questions · hints · full answers · grading
More questions from this exam
Q01What is the primary purpose of a Google Cloud project?EasyQ02Your development team needs to manage Compute Engine instances in a specific project. They need t...MediumQ04Your startup has a strict monthly cloud budget of $500. You want to be notified immediately if yo...MediumQ05Your finance team wants to perform granular analysis of your Google Cloud spending using SQL. The...HardQ06You have just installed the Google Cloud SDK on your local workstation. You want to authenticate ...Easy
Expert