Skip to main content

Ready AI in Your Device

STEP 1: Create a Container Stack

This section describes how to deploy container applications to the edge device.

1.1 Prepare a Docker Compose File

Prepare a docker-compose.yml file, or select a container from the Advantech Catalog which has a GitHub repository link.

WEDA Catalog

WEDA Catalog Container

WEDA Github Link

WEDA Github Repo

WEDA docker-compose.yml

1.2 Encode the File in Base64

Copy the docker-compose.yml content and encode it in Base64 format. The encoded result will used as composeFileContent in the stack creation API request.

WEDA Base64 Encode

1.3 Create a Container Stack

Use the following API to create a container stack. Put the Base64-encoded Compose file in composeFileContent. The system will automatically assign a revision number.

Endpoint

POST /api/v1/orgs/{orgID}/docker-settings/stack-configs

Example Request

curl --location --request POST 'https://{domain}/api/v1/orgs/3a1d40ed-4f97-aed8-c727-57704d3d5d2e/docker-settings/stack-configs' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access-token}' \
--data '{
"stackName": "stack-name1",
"type": "compose",
"composeFileContent": "{Base64-encoded}",
"environment": {},
"description": "this is description"
}'

Example Response

{
"stackConfigId": "e700312d-18e9-4a93-b291-0108596b0a91",
"stackRevision": "70e1771a-0fd3-4e85-9a17-6ea752f92d0b",
"stackName": "stack-name1",
"type": "compose",
"composeFileContent": "{Base64-encoded}",
"environment": {},
"description": "this is description",
"creationTime": "2025-10-30T09:42:39.014305Z"
}

1.4 List Stack Configurations

After a stack is created, use the following API to list all stack configurations in the organization to confirm the active stack deployments.

Endpoint

GET /api/v1/orgs/{orgID}/docker-settings/stack-configs

Example Request

curl --location --request GET 'https://{domain}/api/v1/orgs/3a1d40ed-4f97-aed8-c727-57704d3d5d2e/docker-settings/stack-configs' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access-token}'

Example Response

{
"totalCount": 1,
"items": [
{
"stackConfigId": "e700312d-18e9-4a93-b291-0108596b0a91",
"stackRevision": "70e1771a-0fd3-4e85-9a17-6ea752f92d0b",
"stackName": "stack-name1",
"type": "compose",
"composeFileContent": "{Base64-encoded}",
"environment": {},
"description": "this is description",
"creationTime": "2025-10-30T09:42:39.014305Z"
}
]
}

STEP 2: Deploy the Container Stack to the Device

2.1 Deploy the Container

Use the following API to deploy the container stack to an edge device. You can deploy the same stack to multiple devices by providing a list of deviceIds.

Endpoint

POST /api/v1/orgs/{orgID}/docker-settings/stack-configs/{stackConfigId}/revisions/{stackRevision}:deploy

Example Request

curl --location --request POST 'https://{domain}/api/v1/orgs/3a1d40ed-4f97-aed8-c727-57704d3d5d2e/docker-settings/stack-configs/e700312d-18e9-4a93-b291-0108596b0a91/revisions/70e1771a-0fd3-4e85-9a17-6ea752f92d0b:deploy' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access-token}' \
--data '{
"deviceIds": [
"48b02d8861de"
]
}'

Example Response

{
"stackDeployments": [
{
"stackRevision": "70e1771a-0fd3-4e85-9a17-6ea752f92d0b",
"deploymentId": "b4833ebb-ac6c-4a77-a075-e7ad0e036790",
"taskId": "c0383dfc-e918-41f3-997e-4f5fa1ace7d8",
"stackName": "stack-name1",
"deviceId": "48b02d8861de",
"status": "deploying",
"containers": [],
"error": {},
"active": true
}
],
"totalDevices": 1,
"skippedDevices": 0,
"newlyDeployedDevices": 1,
"deviceActions": {
"48b02d8861de": "add"
}
}

2.2 Check Stack Deployments

Use the following API to view active stack deployments and verify the stack status on the edge device.

Endpoint

GET /api/v1/orgs/{orgID}/docker-settings/stack-configs/deployments

Example Request

curl --location --request GET 'https://{domain}/api/v1/orgs/3a1d40ed-4f97-aed8-c727-57704d3d5d2e/docker-settings/stack-configs/deployments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access-token}'

Example Response

{
"totalCount": 1,
"items": [
{
"stackRevision": "70e1771a-0fd3-4e85-9a17-6ea752f92d0b",
"deploymentId": "b4833ebb-ac6c-4a77-a075-e7ad0e036790",
"taskId": "c0383dfc-e918-41f3-997e-4f5fa1ace7d8",
"stackName": "stack-name1",
"deviceId": "48b02d8861de",
"status": "running(1)",
"containers": [
{
"id": "586e6eb9-5f0c-4173-9c9e-937a50c45fa7",
"name": "advantech-yolo-vision",
"state": "",
"restartCount": 0,
"created": 1761891735912,
"errors": []
}
],
"error": {},
"active": true
}
]
}

If the response shows "status": "running", the container is successfully running on the edge device.


Last updated on Mar-31, 2026 | Version 1.0.0