Updated on 2025-08-28 GMT+08:00

Restarting a Cluster

Function

This API is used to restart a cluster.

Calling Method

For details, see Calling APIs.

URI

POST /v1.1/{project_id}/clusters/{cluster_id}/action

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain it, see Project ID and Account ID.

cluster_id

Yes

String

Cluster ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

restart

Yes

restart object

Cluster restart. For details about how to define the cluster to restart, see the descriptions of restart parameters.

Table 4 restart

Parameter

Mandatory

Type

Description

restartDelayTime

No

Integer

Restart delay, in seconds

restartMode

No

String

Restart mode.

  • IMMEDIATELY: immediate restart

  • FORCELY: forcible restart

  • SOFTLY: normal restart

The default value is IMMEDIATELY. Forcibly restarting service processes will interrupt services and restart VMs in the cluster.

restartLevel

No

String

Restart level. The options are as follows:

  • SERVICE: service restart

  • VM: VM restart

The default value is SERVICE.

type

Yes

String

Type of the cluster node. The value can only be cdm.

instance

No

String

This parameter is reserved. When restartLevel is set to SERVICE, this parameter is mandatory. Set it to an empty string.

group

No

String

This parameter is reserved. When restartLevel is set to SERVICE, this parameter is mandatory. Set it to an empty string.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

jobId

String

Job ID

Example Requests

Restart a cluster.

POST /v1.1/1551c7f6c808414d8e9f3c514a170f2e/clusters/bae65496-643e-47ca-84af-948672de7eeb/action

{
  "restart" : {
    "instance" : "",
    "type" : "cdm",
    "group" : ""
  }
}

Example Responses

Status code: 200

Request succeeded.

{
  "jobId" : "ff8080815e59d92d015e5b27ccb0004d"
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Request error.

401

Authentication failed.

403

No operation permissions.

404

No resources found.

500

Internal service error. For details about the returned error code, see Error Codes.

503

Service unavailable.

Error Codes

See Error Codes.