Your team needs to enable the Cloud Vision API (`vision.googleapis.com`) in a Google Cloud project named `proj-ai-prod` using the `gcloud` CLI while adhering to Google Cloud security and administrative best practices. Which of the following sequences represents the correct order of steps to configure permissions, set project context, activate the service, and verify its status?
- 1Assign the Service Usage Admin role (`roles/serviceusage.serviceUsageAdmin`) to the engineer's identity on project `proj-ai-prod`.
- 2Set the active project context in the gcloud CLI by executing `gcloud config set project proj-ai-prod`.
- 3Enable the Cloud Vision API by executing `gcloud services enable vision.googleapis.com`.
- 4Confirm the API is enabled by executing `gcloud services list --enabled --filter="NAME:vision.googleapis.com"`.
Cevap
The correct sequence of steps is: 1) Assign the Service Usage Admin role (`roles/serviceusage.serviceUsageAdmin`) to the engineer's identity on project `proj-ai-prod`; 2) Set the active project context in the gcloud CLI by executing `gcloud config set project proj-ai-prod`; 3) Enable the Cloud Vision API by executing `gcloud services enable vision.googleapis.com`; 4) Confirm the API is enabled by executing `gcloud services list --enabled --filter="NAME:vision.googleapis.com"`.
The correct workflow follows standard GCP administration sequence: first authorization, then workspace context initialization, service execution, and status verification. Assigning `roles/serviceusage.serviceUsageAdmin` grants permissions to modify API states. Executing `gcloud config set project proj-ai-prod` explicitly targets the target project. Running `gcloud services enable vision.googleapis.com` enables the service API. Finally, running `gcloud services list --enabled --filter="NAME:vision.googleapis.com"` validates the operational status of the service.
Adım Adım Çözüm
Anahtar Kavram
Enabling Cloud Service APIs via the gcloud CLI requires establishing appropriate IAM roles, targeting the correct project context, executing enablement, and verifying status.