Deploy Container Stack
Overview
This tutorial walks through the 4-Contaienr-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
- Completed Get Access Token —
accessTokenis set - Completed Manage Organizations —
org_idis set - A WEDA Node device registered and activated (for deployment steps)
Auto-captured Variables
| Variable | Set by | Used by |
|---|---|---|
registryId | Create Registry (AWS ECR) | Stack creation, registry operations |
uniqueStackName | Check Stack Name Availability | Create Stack |
stackConfigId | Create Stack | All stack management requests |
stackRevisionId | Create Stack | Deploy, query, delete revision |
deploymentTaskId | Deploy Stack to Device | Deployment tracking |
deploymentId | Wait for Deployment Running Status | Delete Deployment |
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 (AWS ECR)
Creates a registry connection. Update the URL and credentials in the request body to match your registry.
- API: Create Registry
- Script:
registryIdsaved to environment automatically - Result:
201 Created
2. Get All Registries
Lists all registry configs in the org.
- API: List Registries
- Result:
200 OK
3. Get Registry by ID
Retrieves details of the registry stored in registryId.
- API: Get Registry
- Result:
200 OK
4. Update Registry
Updates the registry connection settings.
- API: Update Registry
- Result:
200 OK
5. Delete Registry
Deletes the registry config stored in registryId.
- API: Delete Registry
- Result:
200 OKor204 No Content
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
Checks whether the stack name in the request body is already in use.
- Script: if name collision detected, auto-generates a unique name with a suffix and saves as
uniqueStackName; otherwise saves the original name - Result:
200 OK
7. Create Stack
Creates a new Stack configuration using the Docker Compose definition in the request body.
- API: Create Container Stack
- Script: uses
uniqueStackNameas the stack name; savesstackConfigIdandstackRevisionId - Result:
201 Created
The request body contains a sample Docker Compose definition. Replace the image and
service configuration with your own before sending.
8. Get Stacks
Lists all stack configurations in the org.
- API: List Stack Configs
- Result:
200 OK
9. Delete Deployments under this Device
Clears any existing deployments on the target device before deploying a new stack. This step is optional — skip it if the device has no existing deployments.
- Result:
200 OKor204 No Content
10. 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.
- API: Deploy Container Stack
- Script:
deploymentTaskIdsaved to environment automatically - Result:
202 Accepted
11. Query Deployment Result
Manually queries the current deployment status. Use this for a one-shot check.
- Endpoint:
GET .../stack-configs/{{stackConfigId}}/revisions/{{stackRevisionId}}/deployments(revision-scoped; not yet published in the API Hub) - Result:
200 OK
12. Get Specific Stack Details
Returns the full configuration of the current stack revision.
- API: Get Stack Revision Config
- Result:
200 OK
13. Wait for Deployment Running Status
Waits until the deployment reaches Running state.
After you send this request once, the Postman script takes over. It automatically
re-sends the request at a fixed interval until the deployment state becomes Running.
Just wait — clicking Send again will reset the polling counter.
- Endpoint:
GET .../stack-configs/{{stackConfigId}}/revisions/{{stackRevisionId}}/deployments(revision-scoped; not yet published in the API Hub) - Script: polls until
Running; savesdeploymentIdwhen confirmed; clears polling variables - Result: deployment state =
Running
14. Get All Deployments (Org Level)
Lists all deployments across the org.
- API: Get Stack Deployments
- Result:
200 OK
15. Get Stacks Deployments under Device
Lists all stack deployments on the current device.
- Script:
deploymentIdupdated from the first result - Result:
200 OK
16. Delete Deployment
Removes the stack deployment from the device.
- API: Remove Stack from Device
- Result:
200 OKor204 No Content
17. Confirm Deployment Deletion
Verifies the deployment has been removed.
- Result:
200 OK— deployment list is empty
18. Delete Stack
Deletes the stack configuration (revision and config record).
- API: Delete Stack Revision
- Result:
200 OKor204 No Content
19. Confirm Stack Deletion
Verifies the stack has been removed.
- Result:
200 OK— stack no longer appears in the list
Folder 3 — Stack Command
This folder sends lifecycle commands to a running Container Stack on a device.
The device must have an active deployment before running Stack Commands.
20. Execute Stack Command (Pause)
Pauses all containers in the deployed stack on the device.
- API: Manage Container State
- Result:
200 OKor202 Accepted
21–23. Query Command Results
Three variants for retrieving command execution logs:
| Request | Filter |
|---|---|
| Query Command Execution Logs | No range filter |
| Query Command Results — Without Range Parameter | Fetches all results |
| Query Command Results — Latest Only | Returns only the most recent result |
- API: List State Changing Results
- Result:
200 OK
24. Execute Stack Command (Resume)
Resumes a paused stack.
- API: Manage Container State
- Result:
200 OKor202 Accepted
Related
- For API details and developer reference: Container Management
- For stack concepts and API details: Container Stack