Soru

Zorluk: Çok zorEnabling and Managing Cloud Service APIs

Your enterprise organization is preparing a new Google Cloud project `prod-ml-app-402` to host an automated image processing pipeline. You need to enable the Cloud Vision API (`vision.googleapis.com`) using the `gcloud` CLI while following Google Cloud security and operational best practices. In what logical sequence should you perform the configuration, authorization, enablement, and verification steps?

  1. 1Set the active `gcloud` CLI configuration context to the target project using `gcloud config set project prod-ml-app-402`.
  2. 2Verify or grant the Service Usage Admin role (`roles/serviceusage.serviceUsageAdmin`) on `prod-ml-app-402` for the operating identity.
  3. 3Execute `gcloud services enable vision.googleapis.com` to enable the Cloud Vision API on `prod-ml-app-402`.
  4. 4Execute `gcloud services list --enabled --filter="name:vision.googleapis.com"` to confirm active service status.

Cevap

The proper sequence starts with setting the target project context in gcloud CLI, verifying that the deploying identity possesses the Service Usage Admin role, executing the API enablement command for vision.googleapis.com, and finally running a list command to verify that the service status is enabled.
The correct operational sequence mandates establishing the target project context in gcloud CLI first to avoid misconfiguration across environments. Next, administrative IAM authorization must be confirmed using the specific predefined role required for API management (Service Usage Admin). Once authorized within the correct context, the gcloud services enable command initiates API activation. Finally, operational state verification using gcloud services list ensures that the API endpoint is fully active before application deployment.

Adım Adım Çözüm

1
Set project context
Local CLI environment is bound to prod-ml-app-402
Prevents targeting the wrong project or inheriting unintended environment defaults.
2
Check/Grant IAM permissions
Operating principal holds roles/serviceusage.serviceUsageAdmin
Required least-privilege predefined role to modify API enablement states on the project.
3
Run service enablement
vision.googleapis.com state is updated to enabled
Activates the specific service endpoint in Service Usage API for the designated project.
4
Validate enabled service state
CLI output confirms vision.googleapis.com is active
Ensures complete propagation of enablement before application workloads attempt API requests.

Anahtar Kavram

API Enablement Workflow and Privilege Scoping using gcloud CLI
Bu soruyu puanla