• Data Warehouse Service

dws
  1. Help Center
  2. Data Warehouse Service
  3. API Reference
  4. API Description
  5. Cluster Management APIs
  6. Creating a Cluster

Creating a Cluster

Function

This API is used to create clusters.

The cluster must run in the VPC. Before creating a cluster, you need to create a VPC and obtain the VPC and subnet IDs.

This API is an asynchronous API. It takes 10 to 15 minutes to create a cluster.

URI

  • URI format

    POST /v1.0/{project_id}/clusters

  • 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.

Request

  • Sample request
    POST /v1.0/89cd04f168b84af6be287f71730fdb4b/clusters
    
    {
    "cluster": {
            "node_type": "dws.m1.xlarge.ultrahigh",
            "number_of_node": 3,
            "subnet_id": "374eca02-cfc4-4de7-8ab5-dbebf7d9a720",
            "security_group_id": "dc3ec145-9029-4b39-b5a3-ace5a01f772b",
            "vpc_id": "85b20d7e-9eb7-4b2a-98f3-3c8843ea3574",
            "availability_zone": "eu-de-01",
            "port": 8000,
            "name": "dws-1",
            "user_name": "dbadmin",
            "user_pwd": "Passw0rd!",
            "public_ip": {
                "public_bind_type": "auto_assign",
                "eip_id": ""
            }
        }
    }
  • Parameter description
    Table 2 Request parameter description

    Parameter

    Mandatory

    Type

    Description

    cluster

    Yes

    Object. For details, see Table 3.

    Cluster object

    Table 3 Cluster data structure description

    Parameter

    Mandatory

    Type

    Description

    node_type

    Yes

    String

    Node type. You can call the Querying the Supported Node Types API to query the node types supported by DWS.

    number_of_node

    Yes

    Integer

    Number of nodes in a cluster. The value ranges from 3 to 32.

    subnet_id

    Yes

    String

    Subnet ID, which is used for configuring cluster network.

    vpc_id

    Yes

    String

    VPC ID, which is used for configuring cluster network.

    security_group_id

    Yes

    String

    ID of a security group. The ID is used for configuring cluster network.

    availability_zone

    No

    String

    AZ of a cluster

    For more information about AZs, see Regions and Endpoints.

    name

    Yes

    String

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

    user_name

    Yes

    String

    Administrator username for logging in to a data warehouse cluster. The administrator username must:

    • Consist of lowercase letters, digits, or underscores.
    • Start with a lowercase letter or an underscore.
    • Contain 1 to 63 characters.
    • Cannot be a keyword of the DWS database. For details about the keywords of the DWS database, download the Data Warehouse Service Database Developer Guide from the Document Download page and refer to Keyword.

    user_pwd

    Yes

    String

    Administrator password for logging in to a data warehouse cluster

    A password must conform to the following rules:

    • Contains 8 to 32 characters.
    • Cannot be the same as the username or the username written in reverse order.
    • Contains at least three types of the following:
      • Lowercase letters
      • Uppercase letters
      • Digits
      • Special characters ~!@#%^&*()-_=+|[{}];:,<.>/?
    • Cannot be a weak password (for example, Admin123!).

    port

    No

    Integer

    Service port of a cluster. The value ranges from 8000 to 10000. The default value is 8000.

    public_ip

    No

    Object

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

    public_bind_type

    No

    String

    Binding type of an elastic IP address (EIP). The value can be either of the following:

    • auto_assign
    • not_use
    • bind_existing

    The default value is not_use.

    eip_id

    No

    UUID

    EIP ID

Response

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

    Parameter

    Mandatory

    Type

    Description

    cluster

    Yes

    Object

    Cluster object

    id

    Yes

    String

    Cluster ID

Returned Value

  • Normal

    200

  • Abnormal
    Table 5 Returned value description

    Returned Value

    Description

    400 Bad Request

    Request error.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    You do not have the rights 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.