
Answer-first summary for fast verification
Answer: Enable the API directly through the Google Cloud Console.
The correct answer is **A** because the simplest and fastest way to enable an API for your project is by using the Google Cloud Console. This method is straightforward and doesn't require additional permissions beyond those needed to access the console. - **Option B** is incorrect because assigning the Pub/Sub Admin role to a service account doesn't grant the ability to enable APIs. Enabling an API requires specific IAM permissions (`servicemanagement.services.bind` and `serviceusage.services.enable`) that are not covered by the Pub/Sub Admin role. - **Option C** is incorrect because all applications, regardless of where they're hosted (including App Engine), require the relevant APIs to be enabled before they can be used. - **Option D** is incorrect because APIs are not automatically enabled upon first use; they must be explicitly enabled before they can be accessed by any application.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Your front-end is an App Engine application that needs to publish messages to Pub/Sub, but the Pub/Sub API hasn't been enabled yet. What's the quickest method to enable this API?
A
Enable the API directly through the Google Cloud Console.
B
Assign a service account the Pub/Sub Admin role to automatically enable the API.
C
APIs don't need to be enabled for applications running in App Engine.
D
The API will automatically enable upon the first code attempt to access Pub/Sub.