Domain name for API request: cbs.tencentcloudapi.com.
This API is used to create one or more cloud disks.
DiskId
. If a new cloud disk can be found and its state is 'UNATTACHED' or 'ATTACHED', it means that 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.
This document describes the parameters for Signature V1. It's recommended to use the V3 signature, which provides higher security. Note that for Signature V3, the common parameters need to be placed in the HTTP Header. See details.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common parameter. The value used for this API: CreateDisks. |
Version | Yes | String | Common parameter. The value used for this API: 2017-03-12. |
Region | Yes | String | Common parameter. For more information, please see the list of regions supported by the product. |
Placement | Yes | Placement | The location of the instance. The availability zone and the project that the instance belongs to can be specified using this parameter. If the project is not specified, it will be created under the default project. |
DiskChargeType | Yes | String | Cloud disk billing method. POSTPAID_BY_HOUR: pay as you go by hour For information about the pricing of each method, see the cloud disk Pricing Overview. |
DiskType | Yes | String | Cloud disk media type. Valid values: |
DiskName | No | String | The displayed name of the cloud disk. If it is left empty, the default is 'Not named'. The maximum length cannot exceed 60 bytes. |
Tags.N | No | Array of Tag | Cloud disk binding tag. |
SnapshotId | No | String | Snapshot ID. If this parameter is specified, the cloud disk is created based on the snapshot. The snapshot type must be a data disk snapshot. The snapshot can be queried in the DiskUsage field in the output parameter through the API DescribeSnapshots. |
DiskCount | No | Integer | If the number of cloud disks to be created is left empty, the default is 1. There is a limit to the maximum number of cloud disks that can be created for a single request. For more information, please see CBS Use Limits. |
ThroughputPerformance | No | Integer | Extra performance purchased for a cloud disk. This optional parameter is only valid for Tremendous SSD (CLOUD_TSSD) and Enhanced SSD (CLOUD_HSSD). |
DiskSize | No | Integer | Cloud hard disk size (in GB). SnapshotId is passed, DiskSize cannot be passed. In this case, the size of the cloud disk is the size of the snapshot. SnapshotId and DiskSize at the same time, the size of the disk must be larger than or equal to the size of the snapshot. |
Shareable | No | Boolean | The default of optional parameter is False. When True is selected, the cloud disk will be created as a shareable cloud disk. |
ClientToken | No | String | A string to ensure the idempotency of the request, which is generated by the client. Each request shall have a unique string with a maximum of 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be ensured. |
Encrypt | No | String | This parameter is used to create an encrypted cloud disk. Its value is always ENCRYPT. |
DiskChargePrepaid | No | DiskChargePrepaid | Relevant parameter settings for the prepaid mode (i.e., monthly subscription). The monthly subscription cloud disk purchase attributes such as usage period and whether or not auto-renewal is set up can be specified using this parameter. This parameter is required when creating a prepaid cloud disk. This parameter is not required when creating an hourly postpaid cloud disk. |
DeleteSnapshot | No | Integer | Whether to delete the associated non-permanent snapshots when a cloud disk is terminated. Valid values: 0 (do not delete); 1 (delete). Default value: 0 . To find out whether a snapshot is permanent, you can call the DescribeSnapshots API and check the IsPermanent field (true : permanent; false : non-permanent) in its response. |
AutoMountConfiguration | No | AutoMountConfiguration | When a cloud disk is created, automatically initialize it and attach it to the specified mount point |
Parameter Name | Type | Description |
---|---|---|
DiskIdSet | Array of String | List of created cloud disk IDs. |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
This example shows you how to purchase a 50-GB HDD cloud disk in Guangzhou Zone 2 for one month with upfront payment, assign it to the project “0”, get a notification upon expiration and enable automatic renewal for it.
https://cbs.tencentcloudapi.com/?Action=CreateDisks
&DiskType=CLOUD_HSSD
&DiskCount=1
&DiskSize=500
&Placement.Zone=ap-guangzhou-2
&Placement.ProjectId=0
&DiskChargeType=PREPAID
&DiskChargePrepaid.Period=1
&DiskChargePrepaid.RenewFlag=NOTIFY_AND_AUTO_RENEW
&ThroughputPerformance=100
&<Common request parameters>
{
"Response": {
"DiskIdSet": [
"disk-lzrg2pwi"
],
"RequestId": "6a57da9a-2049-7182-2de3-5a1f8014ccfd"
}
}
This example shows you how to create a 100-GB pay-as-you-go premium cloud disk billed on an hourly basis in Guangzhou Zone 3.
https://cbs.tencentcloudapi.com/?Action=CreateDisks
&DiskType=CLOUD_PREMIUM
&DiskCount=1
&Placement.Zone=ap-guangzhou-3
&Placement.ProjectId=0
&DiskChargeType=POSTPAID_BY_HOUR
&DiskName=postPayDisk
&DiskSize=100
&<Common request parameters>
{
"Response": {
"DiskIdSet": [
"disk-ecjc4cpw"
],
"RequestId": "fe2274fa-eaec-4009-807b-6ffc00963fec"
}
}
This example shows you how to create a cloud disk by specifying a snapshot without specifying DiskSize
. In this example, the size of the new cloud disk is the same as that of the snapshot, and the snapshot data will be copied to the new cloud disk.
https://cbs.tencentcloudapi.com/?Action=CreateDisks
&DiskType=CLOUD_BASIC
&DiskCount=1
&SnapshotId=snap-iepc4w3h
&Placement.Zone=ap-guangzhou-2
&Placement.ProjectId=0
&DiskChargeType=PREPAID
&DiskChargePrepaid.Period=1
&DiskChargePrepaid.RenewFlag=NOTIFY_AND_AUTO_RENEW
&<Common request parameters>
{
"Response": {
"DiskIdSet": [
"disk-6rz0ilvu"
],
"RequestId": "5e93a212-ca01-0fdc-eedd-5a1fce5e83e6"
}
}
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 |
InvalidParameter.DiskConfigNotSupported | Currently configured cloud disk not supported in current region. |
InvalidParameter.ProjectIdNotExist | The project ID does not exist. |
InvalidParameterValue | Invalid parameter value. |
MissingParameter | Missing parameter. |
ResourceBusy | The resource is busy. Try again later. |
ResourceInsufficient | Insufficient resources. |
TradeDealConflict | Order conflict. |
UnauthorizedOperation | Unauthorized operation. |
UnauthorizedOperation.NotCertification | The account has not completed identity verification. Payment failed. |
UnauthorizedOperation.NotHavePaymentRight | No payment permission. |
UnauthorizedOperation.RoleNotExists | The authorization role does not exist. |
本页内容是否解决了您的问题?