Question

Difficulty: MediumEnabling and Managing Cloud Service APIs

A data engineering team is attempting to deploy an automated batch processing pipeline inside a target Google Cloud project named `warehouse-analytics-live`. The execution fails because the Cloud Dataflow API (`dataflow.googleapis.com`) has not been activated in the project. As a Cloud Engineer, you must enable this service specifically for `warehouse-analytics-live` using the Google Cloud CLI. Which command should you execute?

  1. gcloud services enable dataflow.googleapis.com --project=warehouse-analytics-liveAnswer
  2. B
    gcloud services enable dataflow.googleapis.com
  3. C
    gcloud resource-manager folders add-iam-policy-binding --id=12345678 --role=roles/owner
  4. D
    gcloud compute quotas update --service=dataflow.googleapis.com --project=warehouse-analytics-live

Answer

Execute `gcloud services enable dataflow.googleapis.com --project=warehouse-analytics-live` to activate the Dataflow API explicitly in the target project.
The command `gcloud services enable dataflow.googleapis.com --project=warehouse-analytics-live` directly activates the specified Google Cloud API endpoint for the designated project. Including the `--project` flag ensures deterministic execution against the target environment.

Step-by-Step Solution

1
Identify the required Google Cloud API service endpoint name.
The canonical service name for Cloud Dataflow is `dataflow.googleapis.com`.
Google Cloud API enablement commands require the full service identifier.
2
Select the correct gcloud CLI component for managing APIs.
Use `gcloud services enable` command group.
The `gcloud services` command group is designed for enabling, disabling, and listing Service Usage APIs.
3
Append the `--project` flag to specify the target project.
Command becomes `gcloud services enable dataflow.googleapis.com --project=warehouse-analytics-live`.
Specifying `--project` guarantees the API is enabled in the intended project regardless of the active local gcloud configuration context.

Key Concept

Enabling Cloud Service APIs using gcloud CLI with explicit project flags
Estimated Time:1m 0s
Rate this question