Skip to main content

Apps

Deploy, manage, and monitor containerized applications.

Overview

The client.apps resource lets you:

  • Create and deploy containerized applications
  • Manage the full application lifecycle (start, stop, restart, deploy)
  • Monitor status, logs, and resource metrics
  • Configure environment variables, replicas, and resource limits

Basic Usage

from strongly import Strongly

client = Strongly()

# List all running apps
for app in client.apps.list(status="running"):
print(f"{app.name}{app.status}{app.url}")

# Create a new app
app = client.apps.create({
"name": "my-api",
"description": "Customer-facing REST API",
"image": "my-org/my-api:latest",
"port": 8080,
})

print(f"Created: {app.id}")

Creating an App

Pass a dictionary with your app configuration to create():

from strongly import Strongly

client = Strongly()

app = client.apps.create({
"name": "data-processor",
"description": "Processes incoming data events",
"image": "my-org/data-processor:v2.1",
"port": 8000,
"replicas": 2,
"environment": {
"LOG_LEVEL": "info",
"WORKERS": "4",
},
"resources": {
"cpu": "500m",
"memory": "1Gi",
},
"labels": {
"team": "backend",
"tier": "production",
},
})

print(f"App ID: {app.id}")
print(f"Status: {app.status}")

Create Body Fields

FieldTypeRequiredDescription
namestrYesUnique application name
descriptionstrNoHuman-readable description
imagestrNoContainer image (e.g., my-org/app:v1)
portintNoPort the container listens on
replicasintNoNumber of replicas (default: 1)
environmentdictNoEnvironment variables as key-value pairs
resourcesdictNoCPU/memory resource limits
project_idstrNoProject to associate the app with
labelsdictNoKey-value labels for organization

Deploying an App

After creating an app, deploy it to make it live:

from strongly import Strongly

client = Strongly()

app = client.apps.create({
"name": "my-service",
"image": "my-org/my-service:latest",
"port": 3000,
})

# Deploy the app
client.apps.deploy(app.id)

Application Lifecycle

Control your application with lifecycle methods:

from strongly import Strongly

client = Strongly()

app_id = "app-abc123"

# Stop a running app
client.apps.stop(app_id)

# Start a stopped app
client.apps.start(app_id)

# Restart an app (rolling restart)
client.apps.restart(app_id)

Checking Status

Monitor deployment health and readiness:

from strongly import Strongly
import time

client = Strongly()

# Deploy and wait for readiness
client.apps.deploy(app.id)

while True:
status = client.apps.status(app.id)
print(f"State: {status.state}, Ready: {status.ready_replicas}/{status.replicas}")

if status.ready_replicas and status.ready_replicas > 0:
print(f"App is live at {status.url}")
break

time.sleep(5)

AppStatus Fields

FieldTypeDescription
statestrCurrent state (e.g., running, deploying, stopped)
messagestrHuman-readable status message
replicasintDesired number of replicas
ready_replicasintNumber of replicas that are ready
urlstrPublic URL of the application

Viewing Logs

Retrieve container logs for debugging:

from strongly import Strongly

client = Strongly()

# Get the last 100 lines
logs = client.apps.logs("app-abc123", lines=100)
print(logs)

# Get logs from the last 30 minutes
logs = client.apps.logs("app-abc123", since="30m")

# Get logs from a specific container
logs = client.apps.logs("app-abc123", container="worker")

Viewing Metrics

Retrieve resource usage metrics:

from strongly import Strongly

client = Strongly()

metrics = client.apps.metrics("app-abc123")
print(metrics)

Updating an App

Update any field on an existing app. All body fields are optional:

from strongly import Strongly

client = Strongly()

updated = client.apps.update("app-abc123", {
"description": "Updated description",
"replicas": 3,
"environment": {
"LOG_LEVEL": "debug",
"WORKERS": "8",
},
})

print(f"Replicas: {updated.replicas}")

Deleting an App

from strongly import Strongly

client = Strongly()

client.apps.delete("app-abc123")

Filtering and Searching

Use keyword arguments on list() to filter results:

from strongly import Strongly

client = Strongly()

# Filter by status
for app in client.apps.list(status="running"):
print(app.name)

# Filter by environment
for app in client.apps.list(environment="production"):
print(f"{app.name}{app.environment}")

# Search by name
for app in client.apps.list(search="api"):
print(app.name)

# Combine filters
for app in client.apps.list(status="running", environment="production"):
print(f"{app.name}: {app.url}")

# Get all results as a list
all_apps = client.apps.list().to_list()
print(f"Total apps: {len(all_apps)}")

Complete Example

from strongly import Strongly
import time

def main():
client = Strongly()

# --- Create and deploy ---
print("Creating app...")
app = client.apps.create({
"name": "example-api",
"description": "Example REST API service",
"image": "my-org/example-api:v1.0",
"port": 8080,
"replicas": 2,
"environment": {
"NODE_ENV": "production",
"LOG_LEVEL": "info",
},
"resources": {
"cpu": "500m",
"memory": "512Mi",
},
"labels": {
"team": "platform",
"tier": "production",
},
})
print(f"Created app: {app.id}")

# --- Deploy ---
print("\nDeploying...")
client.apps.deploy(app.id)

# --- Wait for readiness ---
while True:
status = client.apps.status(app.id)
print(f" State: {status.state}, Ready: {status.ready_replicas}/{status.replicas}")
if status.ready_replicas and status.ready_replicas >= 2:
print(f" Live at: {status.url}")
break
time.sleep(5)

# --- View logs ---
print("\nRecent logs:")
logs = client.apps.logs(app.id, lines=20)
print(logs)

# --- View metrics ---
print("\nMetrics:")
metrics = client.apps.metrics(app.id)
print(metrics)

# --- Scale up ---
print("\nScaling to 4 replicas...")
client.apps.update(app.id, {"replicas": 4})
client.apps.restart(app.id)

# --- Cleanup ---
print("\nStopping app...")
client.apps.stop(app.id)

status = client.apps.status(app.id)
print(f"Final state: {status.state}")

if __name__ == "__main__":
main()

App Model

FieldTypeDescription
idstrUnique app identifier
namestrApplication name
descriptionstrHuman-readable description
statusstrCurrent status (e.g., running, stopped, deploying)
imagestrContainer image
portintContainer port
replicasintDesired replica count
environmentdictEnvironment variables
resourcesdictCPU/memory resource configuration
urlstrPublic URL
organization_idstrOwning organization
project_idstrAssociated project
labelsdictKey-value labels
ownerstrOwner user ID
permissionsdictAccess permissions
created_atstrCreation timestamp
updated_atstrLast update timestamp

Method Reference

MethodDescriptionReturns
list(*, status=None, environment=None, search=None, limit=50)List apps with optional filtersSyncPaginator[App]
create(body)Create a new appApp
retrieve(app_id)Get an app by IDApp
update(app_id, body)Update app fieldsApp
delete(app_id)Delete an appdict
deploy(app_id, **kwargs)Deploy the appdict
start(app_id)Start a stopped appdict
stop(app_id)Stop a running appdict
restart(app_id)Restart the appdict
status(app_id)Get deployment statusAppStatus
create_with_upload(file, *, name=None, description=None, framework=None, runtime=None, **kwargs)Create an app from a file uploaddict
deploy_upload(app_id, file, **kwargs)Deploy from a file uploaddict
logs(app_id, *, lines=None, since=None, container=None)Retrieve container logsAny
metrics(app_id)Get resource usage metricsdict