When to use this runbook
Use to read current group and instance state, retrieve logs or system events, scale safely, start or stop a group, and report asynchronous or partial outcomes.When not to use it
Do not use it to create or change runtime configuration beyond replica count. Do not reallocate, recreate, restart, delete, or replace anything without the task-specific evidence and explicit user intent described here and in the troubleshooting runbook.Required inputs
SALAD_API_KEY,SALAD_ORGANIZATION,SALAD_PROJECT, and exactSALAD_CONTAINER_GROUPname.- The requested observation window in UTC for logs/events.
- For scaling, the intended replica count and quota/capacity constraints.
- Explicit user intent before stop, scale-down, delete, reallocate, recreate, restart, or replacement.
- A caller-defined polling attempt and elapsed-time budget.
Authoritative sources
The canonical
get_system_logs page marks that endpoint deprecated and directs users to query_log_entries, although
the current OpenAPI operation is not marked deprecated. Prefer query_log_entries and use
Log Queries for filters.
Dynamic values to retrieve
- Group
status,replicas,version,pending_change, andinstance_status_counts. - Every instance
id,machine_id,state,ready,started,version,update_time, and pulling progress when present. - Current quota/availability before scale-up.
- Queue length and in-flight jobs before reducing workers.
- Logs and events for a bounded UTC range; query both controller resource types and
containerlogs when diagnosing.
Preflight checks
- Read the group, then list instances. Stop on
404until the supplied scope/name is reconfirmed. - Compare the current state with the requested state; avoid a no-op mutation.
- Before scale-up, run quota and availability preflight for the additional replicas.
- Before scale-down or stop, identify active jobs/requests, externalize state, and obtain explicit user intent. If
queue_connectionis configured, read the exact queue withget_queueand jobs withlist_queue_jobs. For direct gateway traffic, stop if the caller cannot provide a safe drain predicate; no active-request read is documented. - Record the current version, desired replicas, instance IDs/states, and a success predicate.
- For log queries, use explicit UTC
start_time/end_time, project and group filters, and the smallest useful page size/window.
Procedure
Read and classify current capacity
- Call
get_container_group. - Call
list_container_group_instances. - Treat
replicasas desired capacity. Usecurrent_state.instance_status_countsfor allocating, creating, running, and stopping totals. The summary has no downloading count; countstate: downloadingin the instance list. - Count ready capacity from instances where
stateisrunningandreadyistrue. Do not infer afailedinstance state; it is not in the current enum.
Scale up or down
- Read with
get_container_groupimmediately before the mutation. - For scale-up, validate quota and availability. For scale-down, confirm explicit intent and workload drain behavior.
- Operation:
update_container_group. SendContent-Type: application/merge-patch+jsonand only the approvedreplicasvalue. - Verify with
get_container_groupandlist_container_group_instancesuntil the desired and required ready capacity predicate is met or the polling budget ends.
Start
- Read with
get_container_group; skip if it already satisfies the user’s running predicate. - Operation:
start_container_group. A successful request returns202 Acceptedwith no response body. - Verify with
get_container_groupandlist_container_group_instancesuntil the group isrunningand required instances are current-version, running, and ready.
Stop
- Read with
get_container_groupand list instances. Confirm explicit stop intent and record active work. - Operation:
stop_container_group. A successful request returns202 Acceptedwith no response body. - Verify with
get_container_groupandlist_container_group_instances. A group can reportstoppedwhile stop messages are still propagating, so report pending until no instance remains running or the polling budget ends.
Inspect logs and system events
Use Operation:query_log_entries with resource filters:
resource.type = "deployment_controller"for group-level system events.resource.type = "instance_controller"for instance lifecycle and probe events.resource.type = "container"for stdout/stderr application logs.
resource.labels.project_name and resource.labels.container_group_name; add instance_id or machine_id
only after retrieving it live. Keep relevant trace/span identifiers from the response when present.
Decision rules
Expected states and responses
Group statuses arepending, running, stopped, succeeded, failed, and deploying. Instance states are
allocating, downloading, creating, running, and stopping. Instance started reports startup completion;
ready reports readiness. A running instance can therefore be started but not ready.
update_container_group returns 200; start and stop return 202. The current spec defines 202 for
get_container_group_instance, even though it is a read; consume the response body and do not reinterpret that status
as completion of a mutation.
Retry behavior
Poll with bounded exponential backoff and jitter within the caller’s total time/attempt budget. HonorRetry-After when
present. Re-read state before retrying a start, stop, or scale request. Do not retry a scale-down or stop without the
original explicit intent, and do not extend the polling budget indefinitely.
Verification
Rollback or recovery
- Scale-up can be reversed only with explicit approval to reduce capacity; do not auto-scale back down.
- A mistaken scale-down can be corrected by restoring the captured replica count after fresh quota/availability checks.
- A mistaken start can be stopped only with explicit stop intent. A mistaken stop can be started after confirming the intended capacity and availability.
- Preserve logs/events before instance turnover or another mutation changes the evidence.
Stop and escalation conditions
Stop on missing intent, ambiguous scope, insufficient quota, active work that cannot drain, groupfailed, repeated
non-transient errors, or convergence beyond the polling budget. When pending, return the last state and UTC update time;
do not claim failure solely because allocation is slow. Use the troubleshooting decision tree and collect an escalation
package if evidence remains inconclusive.