PlanyDocs
Services

PlayputeService

plany.playpute.v1.PlayputeService — game servers, autoscaling groups, schematics and allocation.

Endpoint api.plany.cloud:443 · Guide · Reference

Playpute runs game servers that cost nothing for compute while nobody is playing. This service creates them, starts and stops them, scales fleets of them, and hands a matchmaker a server to send players to.

Games and builds are in the Game Registry; a game server names a game and runs it.

Game servers

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

Creating, updating, starting, stopping, restarting and deleting a server each return an operation. Everything else answers at once.

Servers → New server → choose a game → Create

What a customer usually does with a server, and the call for each:

You want toCall
See it, and where players connectGetGameServer — state, player_count and endpoints, each with a ready-to-paste address
List a project's serversListGameServers
Change its settings, its size, or how soon it sleeps when emptyUpdateGameServer, with an update_mask
Stop paying for compute and keep the worldStopGameServer
Bring it back with its world as it wasStartGameServer
Remove it and its dataDeleteGameServer

The build a server runs is fixed when it is created, so changing the game later never changes a server that is already running.

A server's size is a machine_type; ListMachineTypes lists them and QuerySpotHistory says how often a type was available on spot and how often it was reclaimed. See Machine types.

An address marked proxied works whether or not the server is running: a player connecting to a stopped server starts it. See Addresses.

Autoscaling groups

projects/{project}/locations/{location}/gameServerGroups/{game_server_group}

A group keeps a fleet of identical servers sized to the players on it. You declare the game, a minimum and maximum, and a scaling policy; the group creates and drains members itself. CreateGameServerGroup and DeleteGameServerGroup return operations — deleting a group deletes the members it created. UpdateGameServerGroup answers at once: change the policy or the sizes, pause scaling, or roll the fleet onto a new build.

plany playpute groups create lobby --game games/minecraft-java --min-size 1 --max-size 10

state_message on a group says, in a sentence, why it is the size it is. See Autoscaling.

Allocating a server

AllocateGameServer is for a matchmaker: it picks a ready server in the project and region — the first that matches your selectors — marks it allocated so the fleet does not scale it in, and returns where players connect. A sleeping server is woken; the address is the same either way.

grpcurl
grpcurl -H "authorization: Bearer $PLANY_API_KEY" \
-d '{"parent": "projects//locations/"}' \
api.plany.cloud:443 plany.playpute.v1.PlayputeService/AllocateGameServer

If nothing matching is ready, the call answers RESOURCE_EXHAUSTED with reason NO_ALLOCATABLE_GAME_SERVER. See Errors.

Schematics

projects/{project}/locations/{location}/schematics/{schematic}

A schematic is a copy of a running server's disk — the game installed, the world generated — that new servers start from in seconds rather than minutes. CreateGameServerSchematic takes the server to capture and returns an operation; set schematic on a new server or group to start from it. Deleting a schematic does not disturb servers already started from it. See Schematics.

plany playpute schematics create survival-base --server survival

Permissions

PermissionLets you
playpute.gameServers.get, .listRead servers.
playpute.gameServers.create, .update, .deleteChange them.
playpute.gameServers.start, .stopStart, stop and restart them.
playpute.gameServers.allocateAllocate a server to a match.

Attaching a service_account to a server also needs iam.serviceAccounts.actAs on that service account. See Access control.