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.
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
| Resource | Name |
|---|---|
| Account | accounts/{account} |
| User | users/{user} |
| Project | projects/{project} |
| API key | accounts/{account}/apiKeys/{api_key} |
| Service account | accounts/{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 server | projects/{p}/locations/{l}/gameServers/{game_server} |
| Schematic | projects/{p}/locations/{l}/schematics/{schematic} |
| Autoscaling group | projects/{p}/locations/{l}/gameServerGroups/{game_server_group} |
| Connection | .../gameServers/{game_server}/connections/{connection} |
| Sandbox | projects/{p}/locations/{l}/sandboxes/{sandbox} |
| Sandbox revision | .../sandboxes/{sandbox}/revisions/{revision} |
| Network | projects/{p}/locations/{l}/vpcs/{vpc} |
| Firewall rule | .../vpcs/{vpc}/firewallRules/{firewall_rule} |
| Secret | projects/{p}/locations/{l}/secrets/{secret} |
| Container repository | projects/{p}/locations/{l}/repositories/{repository} |
| Encore | accounts/{account}/encores/{encore} |
| Agones Autopilot fleet | projects/{p}/locations/{l}/fleets/{fleet} |
| Support case | accounts/{account}/cases/{case} |
| Activity entry | accounts/{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 regionplany playpute servers listIds 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:
/servers/projects/my-game/locations/eu-west-2/gameServers/survivalSo 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.