Prepare and test your skills

Prepare and test your skills

API Discovery and Activation Methods are the project-scoped steps that let a Google Cloud project find and turn on the services it needs. Cloud APIs (opens in a new tab) are the programmatic interfaces for Google Cloud products and services, and each API must be enabled for a specific project before that project can use it. The same API can be enabled in one project and remain disabled in another.
Cloud APIs give code a standard way to reach Google Cloud services without using the console by hand. Each API defines the service name, its current status, and the operations it supports through a simple JSON REST interface. Cloud Client Libraries (opens in a new tab) for languages such as Java, Python, and .NET handle the connection, authentication, and request formatting, so application code calls the library and the library calls the API.
The API Library is the catalog where available Cloud APIs can be browsed and inspected. In Cloud Code, the library view groups APIs by category and provides a search bar to find a specific API by name. Clicking an API name opens its details page, which shows the service name, status, language-specific installation instructions for its client libraries, links to documentation, and related code samples that can be filtered by text or language and then copied or opened in GitHub.
Enabling an API turns on that service interface for the selected project. On the API details page, first choose the Google Cloud project that should use the API, then click Enable API. After activation succeeds, a confirmation message is displayed and the project can start sending requests to that API. The console can also open a direct enable flow that enables one or more APIs identified by service names such as pubsub.googleapis.com or run.googleapis.com.
The Google Cloud CLI (gcloud CLI) enables APIs programmatically with the services enable command for setup scripts and repeatable project integration. Activation flows from the CLI to the Service Usage service, which then updates the project state, and it depends on the CLI being installed and pointed at the correct project with billing verified:
gcloud init to sign in and set defaults.gcloud projects create PROJECT_ID or select one with gcloud config set project PROJECT_ID.gcloud services enable followed by the service names.For example, the following command enables Cloud Run, Cloud Storage, Eventarc, and Pub/Sub for the current project: gcloud services enable eventarc.googleapis.com pubsub.googleapis.com run.googleapis.com storage.googleapis.com.
Permissions and prerequisites for activation are the project, billing, and Identity and Access Management (IAM) requirements that must be met before an API can be enabled. The caller needs the serviceusage.services.enable permission, which project creators usually have through the Owner role. Project access, enabled billing, and an enable-services role must all be present at the same time.
Exam tip: APIs are enabled per project, not for an entire organization, and enabling requires serviceusage.services.enable, supplied by Service Usage Admin when the caller is not a project Owner.
Service Interdependencies and Management means understanding which Google Cloud APIs must be turned on together and checking that those APIs stay enabled in the right projects. A Google Cloud project (opens in a new tab) is the resource container that holds resources such as service accounts, virtual machines, storage buckets, and datasets. The project also provides an isolation boundary for billing, quota limits, and usage telemetry, so each project can be managed independently.
Project relationships determine where an API must be enabled and which project pays for use. When an application calls a Google Cloud API, the project that owns the application credentials is called the client project, and the project that owns the target resource is called the resource project. If one request touches resources in several projects, multiple resource projects are involved and the API may need to be enabled in more than one project.
| Project type | Owns | Used for billing and quota |
|---|---|---|
| Client project | Application credentials that make the API call | Client-based APIs charge billing and quota to this project |
| Resource project | Target resource being accessed, such as a bucket or dataset | Resource-based APIs charge billing and quota to this project |
The table shows why billing follows the project type. Usage in a project is charged to the billing account associated with that project, and enabling an API means accepting its Terms of Service and billing responsibility.
Dependent APIs are supporting service interfaces that are automatically enabled when the main API that needs them is enabled. Some Google Cloud APIs are enabled by default, while others must be enabled manually through the API Library, the Google Cloud CLI, or the Service Usage API. When you enable an API that depends on other APIs, those dependency APIs are also enabled at the same time.
To enable an API for a project using the console, follow this ordered workflow:
The same task can be done from the command line with gcloud services enable pubsub.googleapis.com and reversed with gcloud services disable pubsub.googleapis.com. Enabling APIs requires the serviceusage.services.enable permission on the project, which is included in Owner and Service Usage Admin.
Common dependency groups are sets of APIs that must all be enabled for one product or tutorial to work correctly. Apigee hybrid (opens in a new tab) is one example where five interfaces work together across management, runtime, monitoring, and validation:
apigee.googleapis.com) provides communication between your project and other hybrid services and Google Cloud APIs.apigeeconnect.googleapis.com) provides communication between the Apigee management plane and the runtime plane.monitoring.googleapis.com) is required for access to Cloud Monitoring metrics.pubsub.googleapis.com) is required for the Apigee quota feature to operate.cloudresourcemanager.googleapis.com) is used by hybrid to validate service accounts.Other workloads have their own required groups. Cloud Functions (opens in a new tab) event tutorials require Cloud Functions, Cloud Build, Cloud Storage, and Eventarc, with some tutorials also adding Cloud Pub/Sub, Cloud Translation, and Cloud Vision. A Google Kubernetes Engine project using Config Sync requires container.googleapis.com, anthosconfigmanagement.googleapis.com, and artifactregistry.googleapis.com, while an App Engine project for Java or Node.js requires the Cloud Build API. If any member of the group is missing, builds, event delivery, validation, or monitoring can fail even when the main service appears enabled.
Monitoring active APIs means verifying the list of enabled services in a project to ensure resources stay correctly provisioned. The command gcloud services list --project $PROJECT_ID returns the enabled APIs, and if the required API names appear in that list, they are enabled. This check is useful after running a multi-API enable command such as gcloud services enable apigee.googleapis.com apigeeconnect.googleapis.com cloudresourcemanager.googleapis.com monitoring.googleapis.com pubsub.googleapis.com. From the same API page where APIs are enabled, an unused API can be disabled to avoid misuse and accidental billing charges.
Exam tip: Enabling one API automatically enables the APIs it depends on, but you must still verify with gcloud services list that every required name is present.
Quotas, billing, and access control in Google Cloud are all tied to the project where APIs are enabled. A Google Cloud project acts as the container for enabled service interfaces, the usage counted against service quotas, and the costs charged to a linked billing account. Identity and Access Management (IAM) controls who can perform each step, so API activation only succeeds when billing is associated and the caller holds the correct permission.
A Cloud Billing account pays for the usage that flows from enabled APIs in a project. Every project is charged to the billing account associated with that project, so billing must be verified as enabled before services such as Compute Engine, BigQuery, Pub/Sub, Cloud Storage, Dataflow, Cloud Logging, and Resource Manager can be used. If no billing account exists, one is created in the Google Cloud console billing page and then linked to the project. This dependency creates a clear order of operations for setting up a project environment:
Access control for enabling APIs is enforced by IAM through the serviceusage.services.enable permission. A principal with this permission can call the Service Usage (opens in a new tab) interface from the console or run gcloud services enable to activate APIs in the project. Project creation is controlled separately by the resourcemanager.projects.create permission, while selecting an existing project requires no special role beyond already having a role on that project.
| Role | Key permission | Use when |
|---|---|---|
Owner (roles/owner) | Includes serviceusage.services.enable | The caller created the project and already holds broad project ownership |
Service Usage Admin (roles/serviceusage.serviceUsageAdmin) | Includes serviceusage.services.enable | The caller needs to enable APIs without full Owner access |
Project Creator (roles/resourcemanager.projectCreator) | Includes resourcemanager.projects.create | The caller needs to create a new project before billing and APIs are set up |
The table shows that project creation and API enablement are separate decisions. Project Creator alone allows creating a project but does not allow enabling APIs.
Exam tip: Enabling APIs requires serviceusage.services.enable through Owner or Service Usage Admin; Project Creator alone allows creating a project but does not allow enabling APIs.
Application access after APIs are enabled depends on IAM roles assigned to users and service accounts inside the project. A user account often needs the Service Account User role to act as a service account, while workload identities such as the Compute Engine default service account need service-specific roles like Dataflow Worker, Dataflow Admin, Pub/Sub Editor, Storage Object Admin, and BigQuery Data Editor. Creating a service account itself requires the Create Service Accounts role and the Project IAM Admin role. Roles are granted on the IAM page by editing a principal and adding each required role, or with gcloud projects add-iam-policy-binding.
How an application authenticates to an enabled API depends on the environment and the authentication methods that API supports:
Google Cloud client libraries are recommended for building applications because the libraries handle authentication, error handling, retries, and payload validation. Credentials are passed to the client libraries during initialization, so calls from the application to Google Cloud APIs flow under the identity and roles granted in the project.
API enablement follows one connected chain across discovery, dependencies, and billing with access control. A caller with the correct IAM permission selects a billed project, discovers the service in the API Library, and enables it with the console or gcloud services enable, which also enables required dependencies. The project then carries the quota and billing for use, while gcloud services list confirms that every API in the dependency group stayed enabled.
gcloud services enable with service names.gcloud services list --project $PROJECT_ID verifies that every required API is enabled.serviceusage.services.enable permission through Owner or Service Usage Admin, while Project Creator only permits creating a project.To enable an API for a selected project, choose the project on the API details page in the API Library and click Enable API, after which a confirmation message is displayed and the project can start sending requests. For programmatic setup, run gcloud services enable followed by the service names such as pubsub.googleapis.com or run.googleapis.com after installing and initializing the CLI, selecting the target project, and verifying that billing is enabled.
Enabling APIs requires the serviceusage.services.enable permission on the target project. This permission is included in Owner and Service Usage Admin, while Project Creator only permits creating a project and does not allow enabling APIs.
The client project owns the application credentials that make the API call, while the resource project owns the target resource being accessed such as a bucket or dataset. Client-based APIs charge billing and quota to the client project and resource-based APIs charge billing and quota to the resource project, with usage charged to the billing account associated with that project.
Your team is preparing a new Google Cloud project for an application backend. Before configuring your deployment pipelines, you need to use the Google Cloud CLI (gcloud) to find the exact service identifier for a required API and then activate it for the project.
Which sequence of gcloud commands should you run?
Run gcloud apis discover to find the service identifier, and then run gcloud apis activate [SERVICE_NAME].
Run gcloud services list --available to find the service identifier, and then run gcloud services enable [SERVICE_NAME].
Run gcloud components list to find the service identifier, and then run gcloud components install [SERVICE_NAME].
Run gcloud services list --enabled to find the service identifier, and then run gcloud services add [SERVICE_NAME].
Last updated