SMLL Docs

Services API

Create, configure, build, deploy, roll back and inspect container services over the API.

Services are the containers you run. Everything the dashboard's service pages do is available here: create a service, push a new image, deploy it, watch the rollout, and roll back if it goes wrong.

All paths below are relative to:

https://api.smll.io/api/v1/workspaces/{workspaceID}/vpcs/{vpcID}/services

Endpoints

MethodPathRolePurpose
GET/MemberList services in the VPC
POST/AdminCreate a service
GET/{serviceID}MemberService detail, with live status
PATCH/{serviceID}AdminUpdate configuration
DELETE/{serviceID}AdminDelete the service
POST/{serviceID}/deployAdminDeploy an image
POST/{serviceID}/restartAdminRestart without changing the image
POST/{serviceID}/rollbackAdminRoll back to an earlier deployment
GET/{serviceID}/deploymentsMemberDeployment history
GET/{serviceID}/logsMemberRecent logs
GET/{serviceID}/logs/historyMemberHistorical logs
GET/{serviceID}/envMemberList environment variables
PUT/{serviceID}/envAdminSet environment variables
DELETE/{serviceID}/env/{envVarID}AdminRemove one variable
GET/{serviceID}/domainsMemberList custom domains
POST/{serviceID}/domainsAdminAttach a custom domain
POST/{serviceID}/domains/{domainID}/verifyAdminRe-check DNS and issue TLS
DELETE/{serviceID}/domains/{domainID}AdminDetach a domain
GET/{serviceID}/uptimeMemberUptime monitor status
POST/{serviceID}/uptimeAdminEnable uptime monitoring
DELETE/{serviceID}/uptimeAdminDisable uptime monitoring

Build and disk-backup endpoints are listed under Builds and Disk backups.

Create a service

curl -s -X POST -H "$AUTH" -H "Content-Type: application/json" \
  -d '{
        "name": "api",
        "service_type": "web",
        "instance_type": "smll.small",
        "image": "registry.smll.io/vpc-4f2c413b/api:v1",
        "port": 8080,
        "health_check_path": "/healthz",
        "min_replicas": 1,
        "max_replicas": 3
      }' \
  "$BASE/workspaces/$WORKSPACE_ID/vpcs/$VPC_ID/services"
FieldTypeDefaultNotes
namestringrequiredUnique in the VPC
service_typestringwebweb, worker or cron
instance_typestringsmll.nanosmll.nano through smll.xlarge
deployment_modestringalways_onalways_on, or on_demand to scale to zero
imagestringImage reference to run
portinteger8080 for webPort your process listens on
health_check_pathstringHTTP path probed for readiness
min_replicasinteger1Lower bound, 0 with on_demand
max_replicasintegerUpper bound for autoscaling
cron_schedulestringRequired when service_type is cron
disk_size_gbintegerAttach a persistent volume
disk_mount_pathstringWhere to mount it
commandstring[]Override the image entrypoint
argsstring[]Override the image arguments
run_as_userinteger1000Container UID

A cron service without cron_schedule is rejected with 400. A web service with no port defaults to 8080, which will fail its health check if your process listens elsewhere.

Creation fails with 503 if the platform cannot reach Kubernetes, and no record is written. There is no half-created service to clean up.

Deploy

Deploying means pointing the service at an image and rolling the pods:

curl -s -X POST -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"image_tag":"v1.4.2"}' \
  "$BASE/workspaces/$WORKSPACE_ID/vpcs/$VPC_ID/services/$SERVICE_ID/deploy"

image_tag takes either form:

  • A bare tag (v1.4.2), appended to the service's configured base image.
  • A full reference (registry.smll.io/vpc-4f2c413b/api:v1.4.2), used as-is.

Use the full reference when the image lives somewhere other than the service's usual repository.

The call returns once the rollout has been requested, not once it is healthy. Poll the service detail endpoint and watch status to know when it has landed.

Roll back

Every deploy is recorded. List them, then roll back to one:

curl -s -H "$AUTH" \
  "$BASE/workspaces/$WORKSPACE_ID/vpcs/$VPC_ID/services/$SERVICE_ID/deployments"

curl -s -X POST -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"deployment_id":"7c4a..."}' \
  "$BASE/workspaces/$WORKSPACE_ID/vpcs/$VPC_ID/services/$SERVICE_ID/rollback"

A rollback is itself a deployment, so it appears in the history too.

Environment variables

PUT /env sets variables in one call. It takes the full list you want applied:

curl -s -X PUT -H "$AUTH" -H "Content-Type: application/json" \
  -d '{
        "variables": [
          {"key": "LOG_LEVEL", "value": "info"},
          {"key": "DATABASE_URL", "secret_id": "9f21...", "secret_key": "url"}
        ]
      }' \
  "$BASE/workspaces/$WORKSPACE_ID/vpcs/$VPC_ID/services/$SERVICE_ID/env"

Each entry is either a literal or a reference to a shared secret:

FieldPurpose
keyThe variable name in the container
valueA literal value
secret_idThe secret to read from, instead of value
secret_keyWhich key inside that secret

A secret reference means the value is never stored on the service, and updating the secret updates every service that links to it. Changing environment variables triggers a rollout so the new values take effect.

Builds

You can have SMLL build the image rather than pushing one yourself.

MethodPathRolePurpose
GET/{serviceID}/buildsMemberList builds (accepts limit)
POST/{serviceID}/builds/gitAdminBuild from a public git repository
POST/{serviceID}/builds/source-uploadAdminBuild from an uploaded archive
GET/{serviceID}/builds/{buildID}MemberBuild status
GET/{serviceID}/builds/{buildID}/logsMemberBuild logs
POST/{serviceID}/builds/{buildID}/cancelAdminCancel a running build

Git builds clone without credentials, so they only work with public repositories. For private source, upload an archive with builds/source-upload (which is what smll deploy does), or build in your own CI and push the image to the VPC registry.

Disk backups

For services with a persistent volume:

MethodPathRolePurpose
GET/{serviceID}/backupsMemberList disk backups
POST/{serviceID}/backupsAdminTake a backup now
POST/{serviceID}/backups/restoreAdminRestore a backup
PUT/{serviceID}/backups/scheduleAdminSet a backup schedule
DELETE/{serviceID}/backups/scheduleAdminRemove the schedule

Restoring scales the service down, replaces the volume contents, and scales it back up. Expect downtime for the length of the restore.

Shell access

GET /{serviceID}/exec upgrades to a WebSocket and attaches a shell to a running pod. It authenticates by query parameter, not the Authorization header, because browsers cannot set headers on a WebSocket handshake.

In practice, use the CLI:

smll services exec my-app
# or
smll shell my-app

Status values

status on a service reflects reality in the cluster, resynced on each read:

StatusMeaning
creatingBeing provisioned
runningHealthy and serving
deployingA rollout is in progress
restartingRestarting on the same image
scaledScaled to zero, either on-demand or by billing enforcement
crashedThe container is failing or restart-looping
deletingTeardown in progress
deletedSoft-deleted, excluded from lists

Because status is resynced against Kubernetes on every read, a service that died outside the platform still shows as crashed on the next GET.

On this page