Skip to content

[Service] Implement Service Usage (REST) #81

Description

@trevorWieland

Summary

Implement Service Usage (serviceusage.googleapis.com) — the API that
enables/lists a project's GCP services. It's the first thing every IaC program
touches: Terraform google_project_service and Pulumi gcp.projects.Service
both call it, so today they fail immediately against floci-gcp (endpoint 404s).
A minimal accept-and-succeed control plane unblocks any multi-service terraform apply / pulumi up.

Protocol / transport

REST JSON (/v1/). gRPC google.api.serviceusage.v1.ServiceUsage exists too,
but REST is what the Terraform/Pulumi Google provider and gcloud use — priority
is the REST surface reachable via serviceusage_custom_endpoint.

Authoritative reference

Scope (MVP — accept-and-succeed, per-project state)

  • services.enable → POST …/services/{svc}:enable → returns a done LRO
  • services.batchEnable → POST …/services:batchEnable → done LRO
  • services.disable → POST …/services/{svc}:disable → done LRO
  • services.get → GET …/services/{svc}state: ENABLED|DISABLED
  • services.list → GET …/services (honor ?filter=state:ENABLED)
  • services.batchGet → GET …/services:batchGet?names=…

Enable flips the service to ENABLED (persisted, project-namespaced); disable
reverses it; get/list echo that state. No real API gating or dependency
resolution — just faithful shapes and state so IaC create/read/destroy cycles.

Parity notes

  • enable/batchEnable/disable return google.longrunning.Operation with
    done: true — reuse the existing operations service.
  • Service resource shape: { name, parent, state, config { name } }.
  • Storage namespaced by project ID via StorageFactory.

Test plan

  • compat-terraform: a google_project_service (e.g. run.googleapis.com)
    applies cleanly and reads back enabled; destroy disables it.
  • sdk-test-java: ServiceUsageClient enable → get roundtrip asserts ENABLED.

I'd like to implement this one — happy to follow the google-parity workflow in
AGENTS.md and validate against sdk-test-java + compat-terraform. Could you
assign it to me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions