Skip to main content

Deploy Container Stack

Overview

This tutorial walks through the 4-Container-Stack collection — configuring a container image registry, creating and deploying a Container Stack to a WEDA Node device, and managing the stack lifecycle including pausing, resuming, and cleanup.

Prerequisites

Auto-captured Variables

VariableSet byUsed by
registryIdCreate Registry ConfigRegistry get, update, delete
uniqueStackNameCheck Stack Name Availability in OrgCreate Stack
stackConfigIdCreate StackAll stack management requests
stackRevisionIdCreate StackDeploy, get details, delete revision
finalStackNameCreate StackCheck Stack Name Availability in Org
deploymentTaskIdDeploy Stack to DeviceDeployment tracking
deploymentIdList Stacks Deployments in DeviceDeployment tracking

Folder 1 — Registry Mgmt

This folder manages container image registry connections. A registry config tells WEDA where to pull container images from when deploying a stack.

1. Create Registry Config (Custom Registry)

Creates a registry connection. Update the URL and credentials in the request body to match your registry.

  • API: Create Registry
  • Script: saves registryId as a collection variable
  • Result: 201 Created

2. Get All Registry Configs

Lists all registry configs in the org.

3. Get Registry Config by ID

Retrieves details of the registry stored in registryId.

4. Update Registry Config

Updates the registry connection settings.

5. Delete Registry Config

Deletes the registry config stored in registryId.


Folder 2 — Stack Mgmt & Deployment

This folder covers the full flow from creating a stack to deploying it on a device.

6. Check Stack Name Availability in Org

Checks whether the stack name in the request body is already in use.

  • API: List Stack Configs, filtered by stackName
  • Script: if the name is already taken, generates a unique name with a suffix and saves it as uniqueStackName
  • Result: 200 OK
caution

Create Stack prefers uniqueStackName whenever that variable holds a value, and the script only sets it on a collision. If an earlier run left a value behind, the next run reuses that old name even when your original name is free. Clear uniqueStackName between runs to start from the original name.

7. Create Stack

Creates a new Stack configuration using the Docker Compose definition in the request body.

  • API: Create Container Stack
  • Script: uses uniqueStackName as the stack name; saves stackConfigId and stackRevisionId
  • Result: 201 Created
tip

The request body contains a sample Docker Compose definition. Replace the image and service configuration with your own before sending.

8. Get Stacks by Organization

Lists all stack configurations in the org.

9. Deploy Stack to Device

Deploys the stack revision to the target device. Confirm the deviceId in the request body is set to the correct device.

Deployment is asynchronous

200 OK means WEDA accepted the request and recorded what it will do per device, which the response returns as deviceActions. It does not mean the containers are running yet. Use List Stacks Deployments in Device below to watch the state.

10. Get Specific Stack Details

Returns the full configuration of the current stack revision.

11. List Stacks Deployments in Device

Lists the deployments on the current device, filtered to stackConfigId. Run this after deploying to watch the state progress toward Running.

12. Clear Device Containers

Removes every stack deployment from the device.

caution

This clears all deployments on the device, not just the one created in this tutorial.

13. Delete Stack Revision

Deletes the stack revision. A revision cannot be deleted while it still has an active deployment — run Clear Device Containers first.

14. Confirm Stack Deletion

Re-requests the revision to verify it is gone.

15. Query deployment by device

Lists every deployment on the device, with no stackConfigId filter. Use it to confirm the device has nothing left after cleanup.


Folder 3 — Stack Command

This folder sends lifecycle commands to a running Container Stack on a device.

note

The device must have an active deployment before running Stack Commands.

16. Manage Container State (Pause)

Pauses all containers in the deployed stack on the device. The request body carries the stackConfigId identifying which stack to act on.

17. Latest Container State Changing Results

Retrieves the outcome of the most recent command, filtered by stackConfigId with range=latest.

tip

range accepts all (the default) or latest. The collection uses latest so you see the result of the command you just sent rather than the full history.

18. Manage Container State (Resume)

Resumes a paused stack.



Last updated on Aug-2, 2026 | Version 1.1.1