Redepoly API
Container Redeploy API
Container redeployment can be automated through the platform API, Cloud Scripting, or the command-line interface.
Redeploy with API
Container redeployment is performed with the environment.Control.RedeployContainers method.
| Parameter | Description |
|---|---|
envName | Name of the environment that contains the container or layer to redeploy. |
session | User session or token used for authentication. |
nodeGroup | Identifier of the environment layer to update. Optional when nodeId is supplied. |
nodeId | ID of a specific container to redeploy. Optional when nodeGroup is supplied. |
tag | Image version to deploy. |
useExistingVolumes | Set to true to preserve data in mounted volumes during the update. |
login and password | Credentials used to access a private image registry. |
manageDNSState | Temporarily excludes the node being redeployed from DNS while the operation runs. |
Target requirement: Provide either
nodeGroup or nodeId. When both are provided, nodeId takes priority and nodeGroup is ignored. The request fails when neither parameter is supplied.
When nodeGroup is used, containers are redeployed sequentially without a custom delay. Use the RedeployContainersByGroup method when a custom delay is required.
DNS behaviour:
manageDNSState works only for sequential redeployment. Enabling it adds delay because DNS records cannot be disabled immediately due to TTL. Disabling it may cause some requests to be lost while a node is being updated.
API Request Example
curl --location 'https://{{platformDomain}}/1.0/environment/control/rest/redeploycontainers' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'envName=tomcat-cluster' \
--data-urlencode 'session={{session}}' \
--data-urlencode 'nodeGroup=cp' \
--data-urlencode 'tag=11.0.2-openjdk-23.0.1-almalinux-9' \
--data-urlencode 'useExistingVolumes=true' \
--data-urlencode 'manageDNSState=false'
Redeploy with Cloud Scripting
Cloud Scripting can call the same platform method from an automation script.
Redeploy a Complete Layer
api: environment.control.RedeployContainers
nodeGroup: {nodeGroup}
tag: {myImage}:{newTag}
{nodeGroup}— environment layer whose containers should be updated.{myImage}— name of the image to deploy.{newTag}— required version of that image.
Redeploy a Specific Container
api: environment.control.RedeployContainers
nodeId: {nodeId}
tag: {myImage}:{newTag}
Replace {nodeId} with the ID of the required container. The image placeholders are used in the same way as in the layer example.
Redeploy with CLI
The same redeployment workflow is available through the platform command-line interface. Use the dedicated container-redeployment CLI command when automation is being performed from a terminal or deployment script.
