PlanyDocs
Get started

Resource names

Every resource has one name, and the name is what you pass everywhere.

Plany follows AIP-122: a resource is identified by a single string that carries its whole location. There are no separate project_id and server_id parameters — the name holds both.

text
projects/{project}/locations/{location}/gameServers/{game_server}

Read it right to left: a game server called {game_server}, in region {location}, in project {project}.

The patterns

ResourceName
Accountaccounts/{account}
Userusers/{user}
Projectprojects/{project}
API keyaccounts/{account}/apiKeys/{api_key}
Service accountaccounts/{account}/serviceAccounts/{service_account}
Game (published by Plany)games/{game}
Game (yours)accounts/{account}/games/{game}
Build (published by Plany)builds/{build}
Build (yours)accounts/{account}/builds/{build}
Game serverprojects/{p}/locations/{l}/gameServers/{game_server}
Schematicprojects/{p}/locations/{l}/schematics/{schematic}
Autoscaling groupprojects/{p}/locations/{l}/gameServerGroups/{game_server_group}
Connection.../gameServers/{game_server}/connections/{connection}
Sandboxprojects/{p}/locations/{l}/sandboxes/{sandbox}
Sandbox revision.../sandboxes/{sandbox}/revisions/{revision}
Networkprojects/{p}/locations/{l}/vpcs/{vpc}
Firewall rule.../vpcs/{vpc}/firewallRules/{firewall_rule}
Secretprojects/{p}/locations/{l}/secrets/{secret}
Container repositoryprojects/{p}/locations/{l}/repositories/{repository}
Encoreaccounts/{account}/encores/{encore}
Agones Autopilot fleetprojects/{p}/locations/{l}/fleets/{fleet}
Support caseaccounts/{account}/cases/{case}
Activity entryaccounts/{account}/auditEvents/{audit_event}

Parents

A List or Create call takes the parent — the container the collection lives in — rather than a resource's own name:

# The CLI fills the parent in from your configured project and region
plany playpute servers list

Ids you choose

The last part of a name is an id you choose when you create the resource — survival in .../gameServers/survival. It cannot be changed afterwards, and it is unique among its siblings, so creating a second resource with the same id is refused rather than producing a duplicate. That makes a create safe to retry.

The name is the URL in the console

The console puts a resource's name straight into the address bar:

text
/servers/projects/my-game/locations/eu-west-2/gameServers/survival

So a link to a resource works for anybody who can see it, whichever project or region they currently have selected.

Names carry access

A role granted on a name applies to that resource and everything beneath it. A role on accounts/acme reaches everything in the account; a role on one game server reaches that server and nothing else. See Access control.

Granting a role below the thing somebody needs to reach does nothing — a role on one game server does not let anybody list the project's servers. Grant on the resource itself, or on something above it.