Soru

Zorluk: OrtaEnabling and Managing Cloud Service APIs

A Cloud Engineer needs to enable the Cloud Run API (`run.googleapis.com`) on a newly created Google Cloud project named `app-prod-101` using the `gcloud` command-line interface and verify that it is properly activated. In what order should the engineer execute the following procedural steps?

  1. 1Authenticate to Google Cloud CLI using `gcloud auth login` with an identity assigned the Service Usage Admin role.
  2. 2Set the active project context using `gcloud config set project app-prod-101`.
  3. 3Enable the Cloud Run service using `gcloud services enable run.googleapis.com`.
  4. 4Confirm activation by running `gcloud services list --enabled --filter="NAME:run.googleapis.com"`.

Cevap

The correct sequence of steps is: 1) Authenticate to Google Cloud CLI using gcloud auth login, 2) Set the active project context using gcloud config set project app-prod-101, 3) Enable the Cloud Run service using gcloud services enable run.googleapis.com, and 4) Confirm activation by running gcloud services list --enabled.
The correct procedural order requires authentication first, followed by establishing the project context, enabling the service API, and finally verifying that the API status is enabled.

Adım Adım Çözüm

1
Authenticate user or service account session
Establishes credentials needed to invoke API management calls.
Without authenticating with sufficient IAM permissions (e.g., Service Usage Admin), subsequent gcloud commands will fail due to lack of authorization.
2
Configure gcloud CLI project property
Sets `app-prod-101` as the default target project for command execution.
The gcloud CLI needs to know which Google Cloud project resource to target for enabling services.
3
Execute API enablement command
Enables the Cloud Run API (`run.googleapis.com`) for the specified project.
`gcloud services enable` sends an API call to Service Usage to activate the API infrastructure.
4
Verify enabled APIs in the project
Filters enabled services and verifies `run.googleapis.com` is present and active.
Auditing enabled services ensures the operational state matches requirements prior to deploying application workloads.

Anahtar Kavram

Managing Google Cloud Service APIs via gcloud CLI
Bu soruyu puanla