Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Overview

platform talks to the API from a terminal. It manages tenants, app services, instances, images, volumes, snapshots, backup policies, SSH keys, firewalls, floating IPs, operations, and the catalog.

Install or download a binary.

Terminal window
platform login --rest https://api.m12p.com

The CLI opens your browser at the M12P sign-in page. You sign in there, with your password and authenticator, and the browser hands the session back to the CLI. The CLI never sees your password.

The session is kept in ~/.platform/config.json, which only you can read. The access token lasts 15 minutes. The CLI renews it with a refresh token that lasts 30 days and is replaced on every use. --rest is remembered, so you pass it once.

FlagWhat it does
--rest <url>API address to sign in to and use from now on
--no-browserPrint the sign-in address instead of opening a browser, for a remote shell
--with-tokenRead an access token from standard input
--client-id <id> --tenant <tenant> --client-secret-stdinSign in as a service principal with its secret
--client-id <id> --tenant <tenant> --githubSign in as a service principal from GitHub Actions, without a secret

platform logout removes the session, and a stored service principal secret. platform token prints a fresh access token, for a curl you run yourself.

M12P publishes only the REST API, at https://api.m12p.com. gRPC is not public. The commands under tenant and service use REST, so they work against production. The other commands use gRPC, and work against a local stack.

CommandWhat it does
platform tenant listList the tenants you can open
platform tenant rename <tenant-id> <name>Change the name people see
platform service list [--app <id>]List app services in every app you can open
platform service get <id>Containers, domains, and the names of environment values
platform service pods <id> [--container <name>]Pods, and why any of them is not ready
platform service events <id> [--warnings]What Kubernetes reported for the service, newest first
platform service logs <id> [--container <name>] [--tail 200] [--previous]A container’s log. --previous shows the run before the last restart
platform service deployments <id>Recent deployments and their result
platform service deploy <id> [--compose <file>] [--restart <container>] [--wait] [--timeout 10m]Deploy
platform service rename <id> <name>Rename. The id, domains, deploy hook, and pods stay as they are

service get prints environment names only. No command prints a secret value or the registry password.

service deploy --compose docker-compose.paas.yml replaces the saved Compose file with yours, then deploys it. Without --compose it deploys what is saved. The platform answers at once and deploys in the background. With --wait the CLI follows that deployment. When it fails, the CLI prints why and exits non-zero, so a pipeline fails with it.

Terminal window
platform service list
platform service events service_06gsviu9kcdrn6dn2rfuq1u924 --warnings
platform service deploy service_06gsviu9kcdrn6dn2rfuq1u924 --compose docker-compose.paas.yml --wait

When an app does not start, read Troubleshooting.

CommandWhat it does
platform catalog typesList instance types
platform instance listList compute instances
platform instance create --name web-1Create an instance
platform instance get <id>Show one instance
platform volume listList storage volumes
platform snapshot listList disk snapshots
platform backup-policy listList scheduled volume backups
platform ssh-key listList SSH key pairs
platform firewall listList security groups
platform floating-ip listList floating IPs
platform operation listInspect long-running operations
platform image listList SYSTEM and MACHINE images

~/.platform/config.json holds endpoint, rest_endpoint, app, and the session. These environment variables override it:

VariableMeaning
PLATFORM_RESTREST address
PLATFORM_GRPCgRPC address
PLATFORM_TOKENAccess token to use as is
PLATFORM_APPApp, when the file names none
PLATFORM_CLIENT_ID, PLATFORM_TENANTSign in as this service principal. Nothing is written to disk
PLATFORM_CLIENT_SECRETThe principal’s secret
PLATFORM_FEDERATION=githubUse the GitHub Actions token instead of a secret

If you set nothing: REST http://127.0.0.1:8080, gRPC 127.0.0.1:9090, app app_default. On a local compose stack, use PLATFORM_REST=http://cloud-api.localhost.