Restoring a Cluster

Function

This API is used to restore clusters using the snapshot.

URI

  • URI format
    POST /v1.0/{project_id}/snapshots/{snapshot_id}/actions
  • Parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

    snapshot_id

    Yes

    String

    ID of the snapshot to be restored

Request Message

  • Sample request
    POST /v1.0/89cd04f168b84af6be287f71730fdb4b/snapshots/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba90/actions
    {"restore": {
            "name": "dws-1",
            "subnet_id": "374eca02-cfc4-4de7-8ab5-dbebf7d9a720",
            "security_group_id": "dc3ec145-9029-4b39-b5a3-ace5a01f772b",
            "vpc_id": "85b20d7e-9eb7-4b2a-98f3-3c8843ea3574",
            "availability_zone": "cn-north-4b"cn-north-4,
            "port": 8000,
            "public_ip": {
                "public_bind_type": "auto_assign",
                "eip_id": ""
            }, 
            "enterprise_project_id":"aca4e50a-266f-4786-827c-f8d6cc3fbada"
        }
    }
  • Parameter description
    Table 2 Request parameter description

    Parameter

    Mandatory

    Type

    Description

    restore

    Yes

    Restore object

    Object to be restored

    Table 3 Restore

    Parameter

    Mandatory

    Type

    Description

    availability_zone

    No

    String

    AZ of a cluster. The default value is the same as that of the original cluster.

    enterprise_project_id

    No

    String

    Enterprise project ID. If no enterprise project is specified for a cluster, the default enterprise project ID 0 is used.

    public_ip

    No

    PublicIp object

    Public IP address. If the parameter is not specified, public connection is not used by default.

    port

    No

    Integer

    Service port of a cluster. The value ranges from 8000 to 30000.

    vpc_id

    No

    String

    VPC ID, which is used for configuring cluster network. The default value is the same as that of the original cluster.

    name

    Yes

    String

    Cluster name, which must be unique. The cluster name must contain 4 to 64 characters, which must start with a letter. Only letters, digits, hyphens (-), and underscores (_) are allowed.

    security_group_id

    No

    String

    Security group ID, which is used for configuring cluster network. The default value is the same as that of the original cluster.

    subnet_id

    No

    String

    Subnet ID, which is used for configuring cluster network. The default value is the same as that of the original cluster.

    Table 4 PublicIp

    Parameter

    Mandatory

    Type

    Description

    public_bind_type

    Yes

    String

    Binding type of an EIP. The value can be one of the following:

    • auto_assign
    • not_use
    • bind_existing

    eip_id

    No

    String

    EIP ID

Response Message

  • Sample response
    {
        "cluster": {
            "id": "7d85f602-a948-4a30-afd4-e84f47471c15"
         }
    }
  • Parameter description
    Table 5 Response parameter description

    Parameter

    Type

    Description

    cluster

    Cluster object

    Cluster object

    Table 6 Cluster

    Parameter

    Type

    Description

    id

    String

    Cluster ID

Status Code

  • Normal

    200

  • Abnormal
    Table 7 Returned value description

    Returned Value

    Description

    400 Bad Request

    Request error.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    You do not have the permission to perform the operation.

    404 Not Found

    The requested resource was not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    The service is unavailable.