PlanyDocs
Using the API

API overview

The Plany API: gRPC services, one endpoint each, and the clients that call them.

Everything the console, the plany CLI and the Terraform provider do goes through the Plany API, so anything you can do there you can do from your own code.

The API is gRPC, defined in Protocol Buffers. It follows the Google API Improvement Proposals and reuses googleapis types rather than inventing its own: resource names follow AIP-122, long-running work returns google.longrunning.Operation, money is google.type.Money, time ranges are google.type.Interval, and errors carry google.rpc details.

Calling it

export PLANY_API_KEY=pk_...
plany playpute servers list --project --region

The Go SDK, github.com/plany-cloud/apis/sdk/go, presents your key on every call. For another language, generate a client from the published schema (below).

The endpoint

Every service answers at one address:

text
api.plany.cloud:443

It is TLS only, and every call carries your API key as authorization: Bearer <api key> — see Authentication. A call is routed by the service named in its method, so one connection reaches every service below.

Regional resources name their region in the resource name — projects/{project}/locations/eu-west-2/.... eu-west-2 is the region Plany serves. See Regions.

ServiceWhat it is forGuide
plany.playpute.v1.PlayputeServiceGame servers, autoscaling groups, schematics, allocationPlaypute
plany.game.v1.GameRegistryServiceGames and buildsGame Registry
plany.gamelog.v1.LogServiceWhat servers and sandboxes printedGame logs
plany.gamelog.v1.EventServiceHow far player detection has got for a gameReference
plany.session.v1.PlayerSessionServiceWho is playing, and who wasPlayers
plany.sandbox.v1.SandboxServiceSandboxes, revisions and triggersSandbox
plany.agones.v1.AutopilotServiceAgones Autopilot fleets and allocationAgones Autopilot
plany.encore.v1.EncoreServiceEncoreEncore
plany.secret.v1.SecretServiceSecretsReference
plany.containerregistry.v1.RegistryServiceContainer Registry repositories and credentialsReference
plany.vpc.v1.VpcServiceNetworks and firewall rulesNetworks
plany.iam.v1.IamServiceRoles, API keys, service accountsIAM
plany.account.v1.AccountServiceYour account and its membersAccounts
plany.project.v1.ProjectServiceProjectsProjects
plany.billing.v1.BillingServicePrices, balance and costsBilling
plany.quota.v1.QuotaServiceLimits, and asking for moreQuotas
plany.audit.v1.AuditServiceYour activity logActivity
plany.support.v1.SupportServiceSupport casesSupport

Long-running operations are followed with google.longrunning.Operations at the same address. See Operations.

Getting the schema

The public schema is a buf module, github.com/plany-cloud/apis, holding exactly the services, methods, messages and fields in the reference. It declares the googleapis dependency it imports, so generating a client is one command:

Shell
buf generate --template buf.gen.yaml

A client generated from it uses the same field numbers as the servers, so it is wire-compatible with the API.

Calls that need no credential

Pricing is readable before you have an account: BillingService/ListPlans, ListSkus and EstimateCost answer without a credential, as does IamService/IssueToken, which is how a credential is obtained. Nothing that changes anything is in that set.

Read on