rest.Rest client:
Fetching an application
api.GetApplication(appID) returns the full squarecloud.Application record.
Application properties
| Field | Type | Description |
|---|---|---|
ID | string | Application ID (24 hex chars) |
Name | string | Display name |
Description | string | Description from the config file |
Owner | string | Owner user ID |
Cluster | string | Cluster the app runs on |
RAM | int | Allocated RAM in MB |
Language | string | javascript | typescript | python | java | elixir | go | rust | ruby | php | dotnet | static |
Domain | *string | Default <subdomain>.squareweb.app host — nil for non-web apps |
Custom | *string | Custom domain bound to the app — nil when not configured |
CreatedAt | string | Creation date |
Domain and Custom are pointers — always nil-check before dereferencing:
Getting the application status
api.GetApplicationStatus(appID) returns the live runtime state with human-formatted values.
Uptime is a *int64 holding the start timestamp in Unix milliseconds — it is nil when the application is stopped.
Raw status
api.GetApplicationStatusRaw(appID) calls the same endpoint with ?rawData=true and returns numeric values instead of formatted strings — CPU/RAM as numbers and network as [in, out] byte pairs. Use it when you want to compute or plot instead of print.
Formatted status is convenient for display (
"120/512MB"); raw status is what you want for dashboards, alerts or any arithmetic — parsing formatted strings back into numbers is fragile.Summary status for every application
To avoid one request per app, callapi.GetApplicationListStatus():
Getting the logs
api.GetApplicationLogs(appID) returns the most recent log output.
Getting metrics
api.GetApplicationMetrics(appID) returns the last 24 hours of CPU, RAM and network samples (up to 288 points, one every 5 minutes) as a []squarecloud.MetricPoint.
Lifecycle
api.PostApplicationSignal(appID, signal) starts, stops or restarts the application. The signal is one of the squarecloud.ApplicationSignal* constants:

