• Data Warehouse Service

dws
  1. Help Center
  2. Data Warehouse Service
  3. API Reference
  4. API Description
  5. Cluster Management APIs
  6. Querying the Cluster List

Querying the Cluster List

Function

This API is used to query and display the cluster list.

URI

  • URI format

    GET /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

GET /v1.0/89cd04f168b84af6be287f71730fdb4b/clusters

Response

  • Sample response
    {
            "clusters": [
            {
            "id": "7d85f602-a948-4a30-afd4-e84f47471c15",
            "status": "AVAILABLE",
            "sub_status": "READONLY",            
            "task_status": "SNAPSHOTTING",
            "action_progress": {"SNAPSHOTTING": "20%"},
            "node_type": "dws.m1.xlarge.ultrahigh",
            "subnet_id": "374eca02-cfc4-4de7-8ab5-dbebf7d9a720",
            "security_group_id": "dc3ec145-9029-4b39-b5a3-ace5a01f772b",
            "number_of_node": 3,
            "availability_zone": "eu-de-01",
            "port": 8000,
            "name": "dws-1",
            "version": "1.2.0",
            "vpc_id": "85b20d7e-9eb7-4b2a-98f3-3c8843ea3574",
            "user_name": "dbadmin",
            "public_ip": {
                "public_bind_type": "auto_assign",
                "eip_id": "85b20d7e-9eb7-4b2a-98f3-3c8843ea3574"
             },
            "public_endpoints": [
                {
                    "public_connect_info": "10.0.0.8:8000",
                    "jdbc_url": "jdbc:postgresql://10.0.0.8:8000/<YOUR_DATABASE_NAME>"
                }
             ],
            "endpoints": [
                {
                    "connect_info": "192.168.0.12:8000",
                    "jdbc_url": "jdbc:postgresql://192.168.0.12:8000/<YOUR_DATABASE_NAME>"
                },
                {
                    "connect_info": "192.168.0.12:8000",
                    "jdbc_url": "jdbc:postgresql://192.168.0.12:8000/<YOUR_DATABASE_NAME>"
                }
             ] , 
            "updated": "2016-02-10T14:28:14Z",
            "created": "2016-02-10T14:26:14Z"
    
            }
        ]
    }
  • Parameter description
    Table 2 Response parameter description

    Parameter

    Mandatory

    Type

    Description

    clusters

    Yes

    Array

    List of cluster objects

    id

    Yes

    String

    Cluster ID

    status

    Yes

    String

    Cluster status, which can be one of the following:

    • CREATING
    • AVAILABLE
    • UNAVAILABLE
    • CREATION FAILED

    sub_status

    Yes

    String

    Sub-status of clusters in the AVAILABLE state. The value can be one of the following:

    • NORMAL
    • READONLY
    • REDISTRIBUTING
    • REDISTRIBUTION-FAILURE
    • UNBALANCED
    • UNBALANCED | READONLY
    • DEGRADED
    • DEGRADED | READONLY
    • DEGRADED | UNBALANCED
    • UNBALANCED | REDISTRIBUTING
    • UNBALANCED | REDISTRIBUTION-FAILURE
    • READONLY | REDISTRIBUTION-FAILURE
    • UNBALANCED | READONLY | REDISTRIBUTION-FAILURE
    • DEGRADED | REDISTRIBUTION-FAILURE
    • DEGRADED | UNBALANCED | REDISTRIBUTION-FAILURE
    • DEGRADED | UNBALANCED | READONLY | REDISTRIBUTION-FAILURE
    • DEGRADED | UNBALANCED | READONLY

    task_status

    Yes

    String

    Cluster management task. The value can be one of the following:

    • RESTORING
    • SNAPSHOTTING
    • GROWING
    • REBOOTING
    • SETTING_CONFIGURATION
    • CONFIGURING_EXT_DATASOURCE
    • DELETING_EXT_DATASOURCE
    • REBOOT_FAILURE
    • RESIZE_FAILURE

    action_progress

    Yes

    Map

    The key indicates the ongoing task, and the value indicates the progress of the ongoing task.

    Valid key values include:

    • GROWING
    • RESTORING
    • SNAPSHOTTING
    • REPAIRING
    • GREATING

    node_type

    Yes

    UUID

    Node type

    subnet_id

    Yes

    UUID

    Subnet ID

    security_group_id

    Yes

    UUID

    ID of a security group

    number_of_node

    Yes

    Integer

    Number of nodes

    availability_zone

    Yes

    String

    AZ

    port

    Yes

    Integer

    Service port of a cluster (8000 to 10000). The default value is 8000.

    name

    Yes

    String

    Cluster name

    version

    Yes

    String

    Data warehouse version

    vpc_id

    Yes

    UUID

    VPC ID

    user_name

    Yes

    String

    Username of the administrator

    public_ip

    Yes

    Object. For details, see Table 3.

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

    public_endpoints

    Yes

    Array. For details, see Table 4.

    Public network connection information about the cluster. If the value is not specified, the public network connection information is not used by default.

    endpoints

    Yes

    Array. For details, see Table 5.

    Private network connection information about the cluster

    updated

    Yes

    Time

    Last modification time of a cluster. The format is ISO8601:YYYY-MM-DDThh:mm:ssZ.

    created

    Yes

    Time

    Cluster creation time. The format is ISO8601:YYYY-MM-DDThh:mm:ssZ.

    failed_reasons

    No

    Object. For details, see Table 6.

    Cause of failure. If the value is empty, the cluster is in the normal state.

    Table 3 public_ip field data structure description

    Parameter

    Mandatory

    Type

    Description

    public_bind_type

    Yes

    String

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

    • auto_assign
    • not_use
    • bind_existing

    eip_id

    No

    UUID

    EIP ID

    status

    No

    String

    EIP binding status. An optional value is FAIL (binding fails).

    error_message

    No

    String

    Cause of an EIP binding failure

    Table 4 public_endpoints field data structure description

    Parameter

    Mandatory

    Type

    Description

    public_connect_info

    No

    String

    Public network connection information

    jdbc_url

    No

    String

    JDBC URL on the public network. The following is the default format:

    jdbc:postgresql://< public_connect_info>/<YOUR_DATABASE_NAME>

    Table 5 endpoints field data structure description

    Parameter

    Mandatory

    Type

    Description

    connect_info

    Yes

    String

    Private network connection information

    jdbc_url

    Yes

    String

    JDBC URL on the private network. The following is the default format:

    jdbc:postgresql://< connect_info>/<YOUR_DATABASE_NAME>

    Table 6 failed_reasons field data structure description

    Parameter

    Mandatory

    Type

    Description

    error_code

    No

    String

    Error code. Possible values can be:

    • DWS.6000: indicates that cluster creation fails.
    • DWS.6001: indicates that cluster scale-out fails.
    • DWS.6002: indicates that cluster restart fails.
    • DWS.6003: indicates that cluster restoration fails.

    error_msg

    No

    String

    Error message

Returned Value

  • Normal

    200

  • Abnormal
    Table 7 Returned value description

    Returned Value

    Description

    400 Bad Request

    Request error. For details about the returned error code, see Exception Response.

    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.