Skip to main content

Roll back a production deployment

Learn how to use the IS Deployments API to roll back an activity on a production planet.

All the sample requests in this guide include the following path parameters:

Parameter nameDescription
tenantIdYour tenant ID.
projectIdID of a star system (a physical project).
planetIdID of a planet on which you want to perofrm a rollback.

Prerequisites

For a rollback to be available, a planet must meet a number of conditions. For details, see Roll back a production deployment.


Check if rollback is available

To check if rollback is available for your planet and get the rollback details, send the following GET request:

curl -X 'GET' \
'{baseURL}/api/v1/tenants/{tenantId}/starsystems/{projectId}/planets/{planetId}/rollbackDetails' \
-H 'accept: application/json' \
-H 'Authorization: Bearer {access_token}'

A response contains a JSON object with the rollback details. If the response body is empty, rollback is not available for this planet.

Example response
{
"targetTime": "2023-01-26T16:52:33.396Z",
"applications": [
{
"name": "cm",
"branch": "refs/heads/master",
"buildNumber": "1",
"dockerizeNumber": "1",
"isAffected": true
},
{
"name": "pc",
"branch": "refs/heads/master",
"buildNumber": "1",
"dockerizeNumber": "2",
"isAffected": true
}
]
}

Perform a rollback

To perform a rollback, send the following POST request:

curl -X 'POST' \
'{baseURL}/api/v1/tenants/{tenantId}/starsystems/{projectId}/planets/{planetId}/rollback' \
-H 'Content-Type:application/json' \
-H 'accept: application/json' \
-H 'Authorization: Bearer {access_token}' \
-d '{body}'

Where {body} contains a copy of the rollback details that you received in the JSON object.

Request body
{
"targetTime": "2023-01-26T16:52:33.396Z",
"applications": [
{
"name": "cm",
"branch": "refs/heads/master",
"buildNumber": "1",
"dockerizeNumber": "1",
"isAffected": true
},
{
"name": "pc",
"branch": "refs/heads/master",
"buildNumber": "1",
"dockerizeNumber": "2",
"isAffected": true
}
]
}