Rolling Back a Deployment
Function
This API is used to roll back a specified Deployment.
URI
POST /apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/rollback
Table 1 describes the parameters of this API.
Request
Request parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| apiVersion | Yes | String | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. |
| kind | Yes | String | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. |
| name | Yes | String | Required. This must match the name of a Deployment. |
| rollbackTo | No | The config of this Deployment rollback. | |
| updatedAnnotations | No | Object | The annotations to be updated to a Deployment. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| revision | No | Integer | The revision to rollback to. If set to 0, rollback to the last revision. |
Example request
{
"kind": "DeploymentRollback",
"apiVersion": "apps/v1beta1",
"name": "deployment-test",
"rollbackTo": {
"revision": 0
}
} Response
Response parameters
For the description about response parameters, see Table 2.
Example response
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Success",
"message": "rollback request for deployment \"deployment-test\" succeeded",
"code": 201
} Status Code
Table 4 describes the status code of this API.
| Status Code | Description |
|---|---|
| 201 | The request has been fulfilled, resulting in the creation of a new resource. |
For more status codes, see Status Codes.
Last Article: Creating a Deployment
Next Article: Reading a Deployment
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.