Restarting a Cluster

Function

This API is used to restart a CDM cluster. Restarting a CDM cluster is an asynchronous operation. You can query the restart result by periodically calling the API in Querying Cluster Details.

URI

  • URI format
    POST /v1.1/{project_id}/clusters/{cluster_id}/action
  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain the project ID, see Obtaining the Project ID, Account Name, and AK/SK.

    cluster_id

    Yes

    String

    Cluster ID. Obtain the value from the response for Creating a Cluster.

Request

  • Sample request
    POST /v1.1/1551c7f6c808414d8e9f3c514a170f2e/clusters/bae65496-643e-47ca-84af-948672de7eeb/action
    {
      "restart": {
        "type": "cdm",
        "instance": "",
        "group": ""
      }
    }
  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    restart

    Yes

    Dictionary

    Cluster restart. For details about how to define cluster restart, see Description of the restart parameter.

  • Description of the restart parameter

    Parameter

    Mandatory

    Type

    Description

    type

    Yes

    String

    Type of the cluster to be restarted. The parameter can be set to cdm only.

    restartMode

    No

    Enumeration

    Restart mode. The options are as follows:

    • IMMEDIATELY: Immediate restart
    • GRACEFULL: Graceful restart
    • FORCELY: Forcible restart
    • SOFTLY: Normal restart

    The default value is IMMEDIATELY.

    restartLevel

    No

    Enumeration

    Restart level. The options are as follows:

    • SERVICE: Service restart
    • VM: VM restart

    The default value is SERVICE.

    NOTE:
    • If restartLevel is SERVICE, enter an empty string in the instance and group fields.
    • If restartLevel is VM, restartMode can only be FORCELY or SOFTLY.

    restartDelayTime

    No

    Integer

    Restart delay, in seconds

Response

  • Sample response
    {
      "jobId": "ff8080815e59d92d015e5b27ccb0004d"
    }
  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    jobId

    No

    String

    Job ID

Return Value

  • Normal

    200

  • Abnormal

    Return Value

    Description

    400 Bad Request

    Request error. For details about the returned error code, see Error Code.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    No operation permission.

    404 Not Found

    The requested resource is not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    Service unavailable.