Skip to main content
Every method on this page lives on client.apps and takes the app id first. An app_id can also be the composite <appId>-<workspaceId> of an app shared through a workspace.
With AsyncSquareCloud, every call below is the same with await in front. To list your apps, use client.account.me(): its applications list has every app the key can see.

Getting an application

Optional fields may be missing from the dict: read them with app.get("domain").

Status

status(app_id) returns the live state with formatted values:
Pass raw=True to get numbers instead (cpu in %, ram in MB, network["total"] and network["now"] as [in, out] byte pairs):
uptime is a timestamp (when the app started), not a duration. Use time.time() * 1000 - status["uptime"] for how long it has been up, in ms.

Status of every application

status_all() returns one summary per app the key can see, in a single request. cpu and ram are only present while the app runs.

Start, stop and restart

The server holds these calls open until the container acts, so they wait at least 120 s before timing out. When the platform refuses the action, the call raises a SquareCloudAPIError 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(app_id) returns the latest console output as one string ('' when there is none).
For a live stream of logs, use Realtime.

Metrics

metrics(app_id) returns the last 24 hours, one point every 5 minutes, newest first.

Domains and load balancers

domains() lists the default and custom hostnames of every app. load_balancers() lists the domains shared by several apps, with your plan’s limit.
To set a custom domain, see Network.

Deleting an application

Deletion is permanent. Create a snapshot first if you may need the files again.

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.