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?

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