PlanyDocs
Using the API

Errors

Status codes, and the details that make a refusal actionable.

Errors are gRPC statuses with google.rpc details attached. Read the details. A bare code says little; the details say what was wrong and, usually, where to go to fix it.

Codes you will meet

CodeMeansRetry?
INVALID_ARGUMENTThe request is malformed, or asks for something that can never be satisfied.No
NOT_FOUNDNo such resource, or you cannot see it.No
ALREADY_EXISTSThat id is taken.No
PERMISSION_DENIEDYou lack a permission on that resource. The message names it.No
UNAUTHENTICATEDNo credential, or one that is invalid, expired or revoked.After fixing the credential
FAILED_PRECONDITIONThe resource or account is not in a state for this — including insufficient credit and a plan that does not include the feature.After fixing it
RESOURCE_EXHAUSTEDA quota limit.After an increase
ABORTEDA concurrent change: the etag you sent is stale.Yes, after re-reading
UNAVAILABLETransient — no capacity right now, or a brief outage.Yes
DEADLINE_EXCEEDEDThe call ran out of time.Yes
INTERNALPlany's fault. Carries a trace id.Yes

Retry UNAVAILABLE, DEADLINE_EXCEEDED and ABORTED with backoff. When an error carries a RetryInfo, wait the delay it gives rather than choosing your own.

Quota versus credit

These are different errors with different remedies. Quota is raised by asking; credit is raised by paying.

RESOURCE_EXHAUSTED, with a google.rpc.QuotaFailure naming the metric and, usually, a google.rpc.Help link to request more:

text
code: RESOURCE_EXHAUSTED
message: "the request would exceed the playpute.plany.cloud/game_server_groups
quota (limit 2 groups, 2 in use)"
details:
QuotaFailure:
violations:
- subject: "playpute.plany.cloud/game_server_groups"
Help:
links:
- description: "Request a higher playpute.plany.cloud/game_server_groups limit"
url: "https://plany.cloud/quotas?consumer=projects/"

Every quota can be raised by asking. See Quotas.

Capacity

UNAVAILABLE, with ErrorInfo { reason: "NO_CAPACITY", domain: "plany.cloud" } and usually a RetryInfo.

This is transient: more room is being made. Wait the RetryInfo delay and try again.

Other details you will see

DetailOn
ResourceInfoNOT_FOUND and ALREADY_EXISTS — the resource type and name.
BadRequestINVALID_ARGUMENT — which field, and why.
PreconditionFailureFAILED_PRECONDITION — a typed violation.
ErrorInfoA machine-readable reason in domain plany.cloud.
RetryInfoHow long to wait before retrying.
HelpWhere to go to fix it.

Internal errors

An INTERNAL error's message and its ErrorInfo carry a trace id. Quote it when you open a support case — it is what lets Plany find your exact request.

Errors that look like something else

NOT_FOUND for something you know exists›

You may not have permission to see it. Where knowing that a resource exists would itself tell you something — a network in a project you have no access to, for instance — Plany answers NOT_FOUND rather than PERMISSION_DENIED. Check the name, then check your role on the project.

FAILED_PRECONDITION at sign-in listing accounts›

You belong to several accounts and named none. Choose one with plany auth login --account, or pass account on IssueToken.

Everything refused after signing in with a one-time password›

A session from a one-time password can only change the password. Choose a new one — the console asks you to straight away — and sign in again.