Creates a data center for a cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateDataCenter

The operation that you want to perform. Set the value to CreateDataCenter.

ClientToken String Yes ETnLKlblzczshOTUbOC***ioIUBoiB

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token is case-sensitive and can contain only ASCII characters. It cannot exceed 64 ASCII characters in length.

ClusterId String Yes cds-bp113rmn****2uy9

The ID of the cluster.

DiskSize Integer Yes 160

The size of the disk per node. Unit: GB.

DiskType String Yes cloud_ssd

The storage type of the disk. Examples of valid values:

  • cloud_ssd: SSD
  • cloud_essd: enhanced SSD (ESSD)
  • cloud_efficiency: ultra disk
  • local_ssd_pro: local SSD
InstanceType String Yes cassandra.c.large

The cluster instance type. Some examples of valid values:

  • cassandra.c.large: 2 cores, 4 GB
  • Gcassandra.c.xlarge: 4 cores, 8 GB
  • cassandra.c.2xlarge: 8 cores, 16 GB
NodeCount Integer Yes 2

The number of nodes.

PayType String Yes Subscription

The billing method of the cluster. Valid values:

  • Subscription
  • PayAsYouGo
Note Pay-as-you-go instances never expire.
RegionId String Yes cn-hangzhou

The region ID. You can call the DescribeRegions operation to query available region IDs.

VpcId String Yes vpc-bp1oxxxxxxxxxxgzv26cf

The ID of the virtual private cloud (VPC) network.

VswitchId String Yes vsw-oqscxxxxxxxxxxxxx5e8c

The ID of the vSwitch.

ZoneId String Yes cn-hangzhou-h

The zone ID of the instance that you want to create. You can call the DescribeRegions operation to query zones.

PeriodUnit String No Year

The unit of the subscription period. Valid values:

  • Year
  • Month
Note You must specify this parameter if the billing method is Subscription.
Period Integer No 12

The subscription period. You must specify this parameter if the value of the PayType parameter is Subscription. Unit: months. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36.

Note This parameter is invalid if the billing method is PayAsYouGo.
AutoRenew Boolean No true

Specifies whether to enable auto-renewal. Valid values:

  • true
  • false

Default value: false.

AutoRenewPeriod Integer No 12

The period of the auto-renewal. Unit: months. Valid values:

  • 1
  • 2
  • 3
  • 6
  • 12
Note This parameter is required when the AutoRenew parameter is set to true.
DataCenterName String No apitest

The name of the data center.

Response parameters

Parameter Type Example Description
DataCenterId String cn-hangzhou-g

The ID of the data center in the cluster.

RequestId String 3E19E345-101D-4014-946C-A2055AEE1F26

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/? Action=CreateDataCenter
&ClientToken=ETnLKlblzczshOTUbOC***ioIUBoiB
&ClusterId=cds-bp113rmn****2uy9
&DiskSize=160
&DiskType=cloud_ssd
&InstanceType=cassandra.c.large
&NodeCount=2
&PayType=Subscription
&RegionId=cn-hangzhou
&VpcId=vpc-bp1oxxxxxxxxxxgzv26cf
&VswitchId=vsw-oqscxxxxxxxxxxxxx5e8c
&ZoneId=cn-hangzhou-h
&<Common request parameters>

Sample success responses

XML format

<CreateDataCenterResponse>
  <DataCenterId>cn-hangzhou-g</DataCenterId>
  <RequestId>728C7EAF-4844-4D42-9BBE-DFFFBB77CF33</RequestId>
</CreateDataCenterResponse>

JSON format

{
    "DataCenterId":"cn-hangzhou-g",
    "RequestId":"728C7EAF-4844-4D42-9BBE-DFFFBB77CF33"
}

Error codes

For a list of error codes, visit the API Error Center.