Data Warehouse Service
| Details
  • Cluster Management APIs
    • ChangeSecurityGroup
    • CreateCluster
    • DeleteCluster
    • DeleteDwsCluster
    • ListClusterDetails
    • ListClusters
    • ListNodeTypes
    • ResetPassword
    • ResizeCluster
    • RestartCluster
    • ShowClusterFlavor
    • ShowClusters
  • Snapshot Management APIs
    • CreateSnapshot
    • DeleteSnapshot
    • ListSnapshotDetails
    • ListSnapshots
    • RestoreCluster
  • Audit logs
    • DisableLtsLogs
    • EnableLtsLogs
    • ListLtsLogs
  • Cluster Management
    • ListConfigurationsAuditRecords
    • SaveClusterDescriptionInfo
    • ShowClusterRedistribution
    • ShowInstance
  • Host Monitoring
    • ListQueries
    • ListTablesStatistic
    • ShowQueryDetail
  • Resource Management
    • DeleteWorkloadPlan
    • ShowWorkloadPlan
    • StartWorkloadPlan
    • StopWorkloadPlan
  • Snapshot Management
    • AddSnapshotCrossRegionPolicy
    • DeleteSnapshotCrossRegionPolicy
    • ListSnapshotCrossRegion
    • ListSnapshotCrossRegionPolicy
    • RestoreTable
  • Upgrade Management
    • ExecuteClusterUpgradeAction
    • ListUpdatableVersion
    • ListUpdateRecord

CreateCluster

POST
https://dws.af-north-1.myhuaweicloud.com/v1.0/{project_id}/clusters
Advanced
Required parameters only
Default
Encrypt sensitive parameters
*
Region
Parameters
*
project_id
Body
*{
*
cluster
: {
*
node_type
:
*
number_of_node
:
*
subnet_id
:
*
security_group_id
:
*
vpc_id
:
*
availability_zone
:
*
port
:
*
name
:
*
user_name
:
*
user_pwd
:
*
public_ip
: {
*
public_bind_type
:
*
eip_id
:
*}
*
number_of_cn
:
*
enterprise_project_id
:
*
tags
: {
*
key
:
*
value
:
*}
*}
}
API Description

This API is used to create clusters. The cluster must run in a 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.

URL
POST  https://dws.af-north-1.myhuaweicloud.com/v1.0/{project_id}/clusters
Request Parameters
NameTypeINMandatoryDescription
project_id
stringpath Yes

Project ID

Body Parameters
NameTypeMandatoryDescription
cluster
CreateClusterInfo object Yes

Cluster object

Parameter:
cluster
NameTypeMandatoryDescription
node_type
string Yes

Node type

number_of_node
integer Yes

Number of cluster nodes. For a cluster, the value ranges from 3 to 256. For a hybrid data warehouse (standalone), the value is 1.

subnet_id
string Yes

Subnet ID, which is used for configuring cluster network.

security_group_id
string Yes

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

vpc_id
string Yes

VPC ID, which is used for configuring cluster network.

availability_zone
string No

AZ of a cluster

port
integer No

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

name
string Yes

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.

user_name
string Yes

Administrator username for logging in to a GaussDB(DWS) 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 GaussDB(DWS) database.
user_pwd
string Yes

Administrator password for logging in to a GaussDB(DWS) cluster

public_ip
PublicIp object No

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

number_of_cn
integer No

Number of deployed CNs.The value ranges from 2 to the number of cluster nodes. The maximum value is 20 and the default value is 3.

enterprise_project_id
string No

Enterprise project. The default enterprise project ID is 0.

tags
Tags object No

Tags

Parameter:
cluster.public_ip
NameTypeMandatoryDescription
public_bind_type
string No

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

  • auto_assign
  • not_use
  • bind_existing
eip_id
string No

EIP ID

Parameter:
cluster.tags
NameTypeMandatoryDescription
key
string Yes

Key. A key can contain a maximum of 128 Unicode characters, which cannot be null.The first and last characters cannot be spaces. It cannot contain the following characters: =*<>\,|/ Only letters, digits, hyphens (-), and underscores (_) are allowed.

value
string Yes

Value. A value can contain a maximum of 256 Unicode characters, which can be null.The first and last characters cannot be spaces. It cannot contain the following characters: =*<>\,|/ Only letters, digits, hyphens (-), and underscores (_) are allowed.

Response Parameters
Status code: 200

Normal

NameTypeDescription
cluster
Cluster object

Cluster object

200 cluster
NameTypeDescription
id
string

Cluster ID

Status code: 400

Request error.

Status code: 401

Authorization failed.

Status code: 403

No operation permission.

Status code: 500

Internal service error.

Status code: 503

The service is unavailable.

Example Request
Example 1
"POST https://{Endpoint}/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": "az1.dc1", "port": 8000, "name": "dws-1", "user_name": "dbadmin", "user_pwd": "Passw0rd!", "public_ip": { "public_bind_type": "auto_assign", "eip_id": "" }, "enterprise_project_id": "aca4e50a-266f-4786-827c-f8d6cc3fbada" } }
Example Response
Status code: 200

Normal

Example 1
{
"cluster": {
"id": "7d85f602-a948-4a30-afd4-e84f47471c15"
}
}
SDK
Click Data Warehouse Service (DWS) SDK to download the SDK in your programming language or view the SDK documentation. To learn how to install an SDK and perform authentication, read Usage.
Error Code
Change History
May 26, 2023
Creating a Cluster
POST
   CreateCluster
Modify
Modified Parameters

Outline

API Description
URL
Request Parameters
Response Parameters
Example Request
Example Response
SDK
Error Code
Change History