ASSOCIATE-CLOUD-ENGINEER practice question 12 of 35
You need to produce a list of the enabled Google Cloud Platform APIs for a GCP project using the gcloud command line in the Cloud Shell. The project name is my-project. What should you do?
Full set: 332 questionsThe gcloud services list command is used to list the APIs and services for a Google Cloud project. By default, this command lists only the services that are currently enabled. To target a specific project, the --project flag must be used, followed by the project ID. Since the question provides the project name (my-project), the gcloud projects list command can first be used to retrieve the corresponding project ID, which is then used in the second command.
B: The --available flag lists all services that can be enabled, not the ones that are currently enabled, which contradicts the requirement. C: The gcloud services list command operates on a project, not a user account. It does not have an --account flag, making the command invalid. D: The --available flag lists all possible services, not just the enabled ones for the specified project, which is incorrect for this scenario.
1. Google Cloud SDK Documentation
gcloud services list: "By default
it lists all enabled services for the active project. To list all available services
use the --available flag." The documentation also specifies the use of the --project flag to "specify a project ID to operate on."
Source: Google Cloud. (n.d.). gcloud services list. Google Cloud SDK documentation. Retrieved from https://cloud.google.com/sdk/gcloud/reference/services/list
2. Google Cloud SDK Documentation
gcloud projects list: This command is used to "List projects for the active account." The output table includes PROJECTID
NAME
and PROJECTNUMBER
confirming its use for finding a project ID from a known project name.
Source: Google Cloud. (n.d.). gcloud projects list. Google Cloud SDK documentation. Retrieved from https://cloud.google.com/sdk/gcloud/reference/projects/list
3. Google Cloud Documentation
Enabling and disabling services: "To list the enabled services for a project
run the gcloud services list command... To list the services that are available to be enabled in a project
run the following command: gcloud services list --available" This page explicitly distinguishes between the default behavior (listing enabled services) and using the --available flag.
Source: Google Cloud. (n.d.). Enabling and disabling services. Service Usage documentation. Retrieved from https://cloud.google.com/service-usage/docs/enable-disable#listingservices
Keep practicing
Take the free ASSOCIATE-CLOUD-ENGINEER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ASSOCIATE-CLOUD-ENGINEER practice questions
- Question 1You need to verify that a Google Cloud Platform service account was created at a particul…
- Question 2You are building a new version of an application hosted in an App Engine environment. You…
- Question 3You need to create a new billing account and then link it with an existing Google Cloud P…
- Question 4You want to configure 10 Compute Engine instances for availability when maintenance occur…
- Question 5You need to create a custom VPC with a single subnet. The subnet’s range must be as large…
- Question 6You significantly changed a complex Deployment Manager template and want to confirm that …
