Domain name for API request: cbs.intl.tencentcloudapi.com.
This API is used to create cloud disks.
DiskId. If a new cloud disk can be found and its status is UNATTACHED or ATTACHED, the cloud disk has been created successfully.A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: CreateDisks. |
| Version | Yes | String | Common Params. The value used for this API: 2017-03-12. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| Placement | Yes | Placement | Location of the instance. You can use this parameter to specify the attributes of the instance, such as its availability zone and project. If no project is specified, the default project will be used. |
| DiskChargeType | Yes | String | Cloud disk billing mode. POSTPAID_BY_HOUR: Pay-as-you-go by hour For more information on the pricing in each mode, see Pricing Overview. |
| DiskType | Yes | String | Hard disk media type. valid values: |
| DiskName | No | String | Cloud disk name. If it is not specified, "Unnamed" will be used by default. The maximum length is 60 bytes. |
| Tags.N | No | Array of Tag | Tags bound to the cloud disk. |
| SnapshotId | No | String | Snapshot ID. If this parameter is specified, the cloud disk will be created based on the snapshot. The snapshot must be a data disk snapshot. To query the type of a snapshot, call the DescribeSnapshots API and see the DiskUsage field in the response. |
| DiskCount | No | Integer | Number of cloud disks to be created. If it is not specified, 1 will be used by default. There is an upper limit on the maximum number of cloud disks that can be created in a single request. For more information, see Use Limits. |
| ThroughputPerformance | No | Integer | Use this parameter to purchase additional performance for CLOUD disk in MB/s. currently, only extreme CBS (CLOUD_TSSD) and enhanced SSD CLOUD disk (CLOUD_HSSD) are supported. |
| KmsKeyId | No | String | Custom key for purchasing encrypted disks. when this parameter is input, the Encrypt parameter cannot be empty. |
| DiskSize | No | Integer | Cloud disk size in GiB. SnapshotId is input, DiskSize can be omitted. at this point, the new cloud disk size will be the snapshot size.SnapshotId and DiskSize are input, the cloud disk size must be greater than or equal to the snapshot size. |
| Shareable | No | Boolean | When True is entered, the cloud disk will be created as a shared cloud disk. default is False. since shared cloud disk does not support encryption, this parameter cannot be imported simultaneously with the Encrypt parameter. |
| ClientToken | No | String | A unique string supplied by the client to ensure that the request is idempotent. Its maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed. |
| Encrypt | No | String | This parameter is used to create an encrypted cloud disk, with the value fixed as ENCRYPT. since shared cloud disk does not support encryption, this parameter cannot be imported simultaneously with the Shareable parameter. |
| DiskChargePrepaid | No | DiskChargePrepaid | Prepaid mode, that is, the settings for the monthly subscription-related parameters. through this parameter, you can specify the purchase duration of the monthly subscribed cloud disk, whether to enable auto-renewal, and other attributes. this parameter is required for creating a prepaid cloud disk, but no need to specify it when creating an hourly postpaid cloud disk. |
| DeleteSnapshot | No | Integer | Delete associated non-permanently retained snapshots when destroying the cloud disk. 0 means non-permanent snapshots are not deleted with cloud disk destruction, 1 means non-permanent snapshots are deleted with cloud disk destruction. default value is 0. whether a snapshot is permanently retained can be determined through the IsPermanent field in the snapshot description returned by the DescribeSnapshots api. True represents a permanent snapshot, False represents a non-permanent snapshot. |
| AutoMountConfiguration | No | AutoMountConfiguration | Specifies auto mount and initialization of the data disk when creating a cloud disk. this parameter cannot be imported simultaneously with the Encrypt parameter because encrypted disks do not support auto mount or initialization. |
| DiskBackupQuota | No | Integer | Specifies the cloud disk backup point quota. |
| BurstPerformance | No | Boolean | Specifies whether to enable burst performance when creating a CLOUD disk. currently only supports extreme cbs (CLOUD_TSSD) and enhanced SSD CLOUD disk (CLOUD_HSSD) with CLOUD disk size greater than or equal to 460GiB. |
| EncryptType | No | String | Specifies the CBS encryption type. valid values are ENCRYPT_V1 and ENCRYPT_V2, representing first generation and second generation encryption technology respectively. the two encryption technologies are incompatible. it is recommended to prioritize using second generation encryption technology ENCRYPT_V2. first generation encryption is only supported on some outdated models. this parameter is valid only when creating an encrypted cloud disk. |
| Parameter Name | Type | Description |
|---|---|---|
| DiskIdSet | Array of String | ID list of the created cloud disks. Note: This field may return null, indicating that no valid values can be obtained. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to purchase a cloud disk with the following configuration: location is Guangzhou Zone 3, cloud disk size is 50GiB, type of cloud disk is ordinary cloud disk, project ID is 0, payment mode is prepaid, purchase duration is 1 month, notify and auto-renew on expiration.
POST / HTTP/1.1
Host: cbs.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateDisks
<Common request parameters>
{
"Placement": {
"ProjectId": 0,
"Zone": "ap-guangzhou-2"
},
"DiskChargeType": "PREPAID",
"DiskCount": 1,
"DiskType": "CLOUD_HSSD",
"ThroughputPerformance": 100,
"DiskSize": 500,
"DiskChargePrepaid": {
"RenewFlag": "NOTIFY_AND_AUTO_RENEW",
"Period": 1
}
}
{
"Response": {
"DiskIdSet": [
"disk-lzrg2pwi"
],
"RequestId": "6a57da9a-2049-7182-2de3-5a1f8014ccfd"
}
}
This example shows you how to create a cloud disk by importing a snapshot without specifying the DiskSize parameter. At this point, the newly purchased cloud disk size equals the snapshot size, and the cloud disk copies the snapshot data.
POST / HTTP/1.1
Host: cbs.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateDisks
<Common request parameters>
{
"Placement": {
"ProjectId": 0,
"Zone": "ap-guangzhou-2"
},
"DiskChargeType": "PREPAID",
"DiskCount": 1,
"DiskType": "CLOUD_HSSD",
"DiskChargePrepaid": {
"RenewFlag": "NOTIFY_AND_AUTO_RENEW",
"Period": 1
},
"SnapshotId": "snap-iepc4w3h"
}
{
"Response": {
"DiskIdSet": [
"disk-6rz0ilvu"
],
"RequestId": "5e93a212-ca01-0fdc-eedd-5a1fce5e83e6"
}
}
This example shows you how to create a cloud disk in Guangzhou Zone 3 with the following configuration: high-performance cloud block storage, 100GiB size, and hourly postpaid payment type.
POST / HTTP/1.1
Host: cbs.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateDisks
<Common request parameters>
{
"DiskName": "postPayDisk",
"Placement": {
"ProjectId": 0,
"Zone": "ap-guangzhou-3"
},
"DiskChargeType": "POSTPAID_BY_HOUR",
"DiskCount": 1,
"DiskType": "CLOUD_PREMIUM",
"DiskSize": 100
}
{
"Response": {
"DiskIdSet": [
"disk-ecjc4cpw"
],
"RequestId": "fe2274fa-eaec-4009-807b-6ffc00963fec"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InternalError.ComponentError | Dependent component request failed. Please contact customer service. |
| InvalidAccount.InsufficientBalance | Insufficient account balance |
| InvalidInstanceId.NotFound | The ‘InstanceId’ entered does not exist. |
| InvalidParameter.DiskConfigNotSupported | Currently configured cloud disk not supported in current region. |
| InvalidParameter.InvalidClientToken | ClientToken is unavailable. |
| InvalidParameter.ProjectIdNotExist | The project ID does not exist. |
| InvalidParameterValue | Invalid parameter value. |
| InvalidParameterValue.LimitExceeded | Number of parameter values exceeds the limit. |
| InvalidSnapshotId.NotFound | The ‘SnapshotId’ entered does not exist. |
| LimitExceeded.InstanceAttachedDisk | Number of instances mounted to cloud disk exceeds the limit. |
| LimitExceeded.TagQuotaLimitExceeded | HTTP calls to the Tag service exceed the frequency limit. |
| MissingParameter | Missing parameter. |
| ResourceBusy | The resource is busy. Try again later. |
| ResourceInsufficient | Insufficient resources. |
| TradeDealConflict | Order conflict. |
| UnauthorizedOperation | The operation is unauthorized. |
| UnauthorizedOperation.NotCertification | Payment failed as the account has not completed identity verification. |
| UnauthorizedOperation.NotHavePaymentRight | No payment permission. |
| UnauthorizedOperation.RoleNotExists | The authorization role does not exist. |
피드백