跳至主要内容

Create Deployment

POST 

/api/v1/orgs/{orgId}/ai-models/{modelId}/editions/{edition}:deploy

Deploys a specific model edition to one or more edge devices.

• Each target group can specify ACL rules and pre/post lifecycle commands.

• PreCmd.action meanings: NOOP (skip), CHECK_DISK_USAGE (validate capacity).

• ValidateCmd.action meanings: NOOP (skip), CHECKSUM_VERIFY (hash check).

• ApplyCmd.action meanings: NOOP (skip), ATOMIC_SWAP_AND_RESTART_CONTAINER (replace then restart runtime).

• PostCmd.action meanings: NOOP (skip).

• The model file is delivered via Secured Volume and NATS file delivery.

• Returns 202 with per-device deployment IDs and initial state "SENT".

Deployment collision behaviour — when a target device already holds a model file, the outcome is decided by the deployment path (modelName + edition + fileName) and the file hash. modelId is not part of the key.

• Same path, same hash → 409; device unchanged.

• Same path, different hash → the new file replaces the old one in place; 202.

• Any difference in the path → a new deployment is created; both files coexist on the device.

Request

Responses

Accepted. The deployment record has been created and delivery to the edge devices has been dispatched; it has not completed yet. The body carries the aggregate deployment (modelDeploymentId, modelId, edition, aggregate status IN_PROGRESS, audit fields) and one entry per target device with its deviceDeploymentId and initial state "SENT". Per-device delivery then proceeds asynchronously through SERVERFILEPATH_OBTAINED, EDGERECEIVED, MODEL_STORAGE_CHECKED, CAPACITY_CHECKED, DOWNLOADED and VALIDATED to the terminal state DEPLOYED, or to REJECTED if a device declines the file. Poll GET /devices/{deviceId}/ai-models or GET /orgs/{orgId}/ai-models/{modelId}/editions/{edition}/deployments to observe progress — a 202 alone does not mean the model is running on any device. This status is also returned when the call replaces an existing file at the same deployment path.