• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. Kubernetes API
  5. Deployment
  6. Creating Rollback of a Deployment

Creating Rollback of a Deployment

Function

This API is used to create rollback of a Deployment.

URI

PATCH /apis/apps/v1/namespaces/{namespace}/deployments/{name}/rollback

POST /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameters

Mandatory

Description

name

Yes

name of the DeploymentRollback

namespace

Yes

object name and auth scope, such as for teams and projects

pretty

No

If 'true', then the output is pretty printed.

Request

Request parameters:

Table 2 Request parameters

Parameters

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

Table 3

The config of this deployment rollback.

updatedAnnotations

No

object

The annotations to be updated to a deployment

Table 3 Data structure of the rollbackTo field

Parameters

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": "extensions/v1beta1",
    "name": "deploy-ex-12130306",
    "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 \"deploy-ex-12130306\" succeeded",
    "code": 201
}

Status Code

Table 4 describes the status code of this API.

Table 4 Status code

Status Code

Description

201

The request has been fulfilled, resulting in the creation of a new resource.

For the description about status codes, see Status Codes.