Skip to content

swarm_stack

The swarm_stack domain has 9 actions. On the meta surface they are all reached through arcane_swarm_stack; on the individual surface each one is its own tool; on the dynamic surface run them with arcane_execute_action and the canonical ID.

ActionTitleKind
swarm_stack.deleteDelete swarm stackdestructive
swarm_stack.deployDeploy swarm stackdestructive
swarm_stack.getGet swarm stackread
swarm_stack.listList swarm stacksread
swarm_stack.render_configRender/validate swarm stack configread
swarm_stack.servicesList swarm stack servicesread
swarm_stack.source_getGet swarm stack sourceread
swarm_stack.source_updateUpdate swarm stack sourcedestructive
swarm_stack.tasksList swarm stack tasksread

Delete swarm stack

  • Kind: destructive — requires confirm: true
  • Required parameters: name
  • Meta tool: arcane_swarm_stack with "action": "delete"
  • Individual tool: arcane_swarm_stack_delete
  • Arcane route: DELETE /api/environments/{id}/swarm/stacks/{name}
  • Operation ID: delete-swarm-stack
  • Usage: Removes the stack’s services, waits for their tasks to stop, then removes its networks, configs, secrets and saved source in one call. Volumes are kept. Also removes a stack that only has a saved source. name from swarm_stack.list.
  • Related actions: swarm_stack.list, swarm_stack.services, volume.list

Deploy swarm stack

  • Kind: destructive — requires confirm: true
  • Required parameters: composeContent, name
  • Meta tool: arcane_swarm_stack with "action": "deploy"
  • Individual tool: arcane_swarm_stack_deploy
  • Arcane route: POST /api/environments/{id}/swarm/stacks
  • Operation ID: deploy-swarm-stack
  • Usage: Creates a stack, or updates it when name already exists, from composeContent (optional envContent, overrideContent). Like docker stack deploy, services start in the background, so check swarm_stack.services or swarm_stack.tasks afterwards. Files referenced by the compose (configs/secrets file: ./app.conf, env_file) go in files as {relativePath, base64 content}. The saved source is replaced, so omitted extra files are deleted. prune (default false) removes services no longer in the file. resolveImage is always (default), changed or never. withRegistryAuth uses the matching registry from registry.list. The source is saved before deploying and kept if the deploy fails. Needs a Swarm manager and swarm:stacks.
  • Related actions: swarm_stack.render_config, swarm_stack.services, swarm_stack.tasks, swarm_stack.source_update, registry.list

Get swarm stack

  • Kind: read
  • Required parameters: name
  • Meta tool: arcane_swarm_stack with "action": "get"
  • Individual tool: arcane_swarm_stack_get
  • Arcane route: GET /api/environments/{id}/swarm/stacks/{name}
  • Operation ID: get-swarm-stack
  • Usage: name from swarm_stack.list. Returns only name, namespace, services count, createdAt and updatedAt (404 if the stack has neither services nor a saved source). Use swarm_stack.services, swarm_stack.tasks and swarm_stack.source_get for the details.
  • Related actions: swarm_stack.list, swarm_stack.services, swarm_stack.tasks, swarm_stack.source_get

List swarm stacks

  • Kind: read
  • Required parameters: none
  • Meta tool: arcane_swarm_stack with "action": "list"
  • Individual tool: arcane_swarm_stack_list
  • Arcane route: GET /api/environments/{id}/swarm/stacks
  • Operation ID: list-swarm-stacks
  • Usage: The starting point for every stack name: returns a page of stacks (name, namespace, services count, createdAt, updatedAt) built from the com.docker.stack.namespace label of the Swarm services, plus stacks Arcane only has a saved source for (services 0, e.g. after a failed deploy). search matches the name. Sort by name, services, created or updated. Paginate with start and limit (default 20). Needs a Swarm manager.
  • Related actions: swarm_stack.get, swarm_stack.services, swarm_stack.deploy, swarm_service.list

Render/validate swarm stack config

  • Kind: read
  • Required parameters: composeContent, name
  • Meta tool: arcane_swarm_stack with "action": "render_config"
  • Individual tool: arcane_swarm_stack_render_config
  • Arcane route: POST /api/environments/{id}/swarm/stacks/config/render
  • Operation ID: render-swarm-stack-config
  • Usage: Validates and interpolates a stack without deploying it. It takes no files: configs or secrets read from files resolve against the stack’s saved source, so they render only once the stack has been deployed. name and composeContent are required (envContent and overrideContent optional). Returns renderedCompose and the services, networks, volumes, configs and secrets names. Invalid YAML is a 400 error.
  • Related actions: swarm_stack.deploy, swarm_stack.source_get

List swarm stack services

  • Kind: read
  • Required parameters: name
  • Meta tool: arcane_swarm_stack with "action": "services"
  • Individual tool: arcane_swarm_stack_services
  • Arcane route: GET /api/environments/{id}/swarm/stacks/{name}/services
  • Operation ID: list-swarm-stack-services
  • Usage: name from swarm_stack.list. Returns a page of the stack’s services (id, name as <stack>_<service>, image, mode, replicas, runningReplicas, ports, networks, nodes, stackName). 404 when the stack has no Swarm services at all, even if a saved source exists. search matches name, image, id or mode. Sort by name, image, mode, replicas, created or updated. The id feeds swarm_service.get, swarm_service.logs and swarm_service.scale.
  • Related actions: swarm_stack.list, swarm_stack.tasks, swarm_service.get, swarm_service.logs, swarm_service.scale

Get swarm stack source

  • Kind: read
  • Required parameters: name
  • Meta tool: arcane_swarm_stack with "action": "source_get"
  • Individual tool: arcane_swarm_stack_source_get
  • Arcane route: GET /api/environments/{id}/swarm/stacks/{name}/source
  • Operation ID: get-swarm-stack-source
  • Usage: name from swarm_stack.list. Returns the source Arcane saved at deploy time: composeContent, envContent, overrideContent and files (extra files with base64 content). 404 for stacks deployed outside Arcane or already deleted. Needs the swarm:stacks permission, not just swarm:read. Edit it and send it back whole with swarm_stack.source_update.
  • Related actions: swarm_stack.source_update, swarm_stack.list, swarm_stack.render_config

Update swarm stack source

  • Kind: destructive — requires confirm: true
  • Required parameters: name, composeContent
  • Meta tool: arcane_swarm_stack with "action": "source_update"
  • Individual tool: arcane_swarm_stack_source_update
  • Arcane route: PUT /api/environments/{id}/swarm/stacks/{name}/source
  • Operation ID: update-swarm-stack-source
  • Usage: Saves the stack’s compose/.env/files and redeploys it at once (with prune: services removed from the file are removed). A failed redeploy restores the previous source. It replaces the whole saved source: start from swarm_stack.source_get and send every extra file again, or it is deleted.
  • Related actions: swarm_stack.source_get, swarm_stack.deploy, swarm_stack.services

List swarm stack tasks

  • Kind: read
  • Required parameters: name
  • Meta tool: arcane_swarm_stack with "action": "tasks"
  • Individual tool: arcane_swarm_stack_tasks
  • Arcane route: GET /api/environments/{id}/swarm/stacks/{name}/tasks
  • Operation ID: list-swarm-stack-tasks
  • Usage: name from swarm_stack.list. Returns a page of tasks of all the stack’s services, past ones included (id, name, serviceName, nodeName, desiredState, currentState, error, containerId, slot). 404 when the stack has no services. search matches name, service, node, id or state. Sort by service, node, state, created or updated. Use it to see where replicas run and why one fails.
  • Related actions: swarm_stack.services, swarm_service.logs, swarm_node.get, swarm_task.list