Skip to main content
Every operation on this page lives on the rest.Rest client:

Fetching an application

api.GetApplication(appID) returns the full squarecloud.Application record.

Application properties

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, call api.GetApplicationListStatus():
CPU and RAM figures are only present for applications that are currently running.

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:

Deleting an application

DeleteApplication permanently removes the application. Unless you have a snapshot, the data cannot be recovered.