c.Apps and takes ctx first, then the app id. An appID can also be the composite <appId>-<workspaceId> of an app shared through a workspace.
Each snippet below runs on its own inside this program: paste one at a time into main and run goimports (see Running the examples).
c.Account.Me: its Applications slice has every app the key can see.
Getting an application
Status
Status(ctx, appID) returns the live state with formatted values:
StatusRaw(ctx, appID) returns numbers instead (CPU in %, RAM in MB, Storage in bytes, Network.Total and Network.Now as [in, out] byte pairs):
Uptime is a timestamp (when the app started), not a duration. Use time.Since(time.UnixMilli(*status.Uptime)) for how long it has been up.Status of every application
StatusAll(ctx, workspaceID) returns one summary per app the key can see, in a single request. Pass "" for all apps, or a workspace id for the apps of that workspace only. CPU and RAM are only set (not "") while the app runs.
Start, stop and restart
ctx deadline they wait at least 2 minutes before timing out. When the platform refuses the action, the call returns an *APIError with status 409, a Code and an empty Message:
“Already started” and “already stopped” are errors too. If they mean success for you, handle them:
Logs
Logs(ctx, appID) returns the latest console output as one string ("" when there is none).
Metrics
Metrics(ctx, appID) returns the last 24 hours, one point every 5 minutes, newest first.
Domains and load balancers
Domains(ctx) lists the default and custom hostnames of every app. LoadBalancers(ctx) lists the domains shared by several apps, with your plan’s limit.
Deleting an application
Next steps
Commit and upload
Create an app from a zip or send files to one.
Application API reference
The REST endpoints behind these methods.
Manage apps from the CLI
The same actions from the terminal.

