tencent cloud

Feedback

CloneDBInstance

Last updated: 2022-07-08 10:18:53

1. API Description

Domain name for API request: postgres.tencentcloudapi.com.

This API is used to clone an instance by specifying a backup set or a point in time.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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: CloneDBInstance.
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.
DBInstanceId Yes String ID of the original instance to be cloned.
SpecCode Yes String Purchasable specification ID, which can be obtained through the SpecCode field in the returned value of the DescribeProductConfig API.
Storage Yes Integer Instance storage capacity in GB.
Period Yes Integer Valid period in months of the purchased instance. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36. This parameter is set to 1 when the pay-as-you-go billing mode is used.
AutoRenewFlag Yes Integer Renewal flag. Valid values: 0 (manual renewal), 1 (auto-renewal). Default value: 0.
VpcId Yes String VPC ID.
SubnetId Yes String ID of a subnet in the VPC specified by VpcId.
Name No String Name of the purchased instance.
InstanceChargeType No String Instance billing mode. Valid values: PREPAID (monthly subscription), POSTPAID_BY_HOUR (pay-as-you-go).
SecurityGroupIds.N No Array of String Security group ID.
ProjectId No Integer Project ID.
TagList.N No Array of Tag The information of tags to be bound with the purchased instance. This parameter is left empty by default.
DBNodeSet.N No Array of DBNode This parameter is required if you purchase a multi-AZ deployed instance.
AutoVoucher No Integer Whether to automatically use vouchers. Valid values: 1 (yes), 0 (no). Default value: 0.
VoucherIds No String Voucher ID list.
ActivityId No Integer Campaign ID.
BackupSetId No String Basic backup set ID.
RecoveryTargetTime No String Restoration point in time.

3. Output Parameters

Parameter Name Type Description
DealName String Order ID.
Note: this field may return null, indicating that no valid values can be obtained.
BillId String Bill ID.
Note: this field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Cloning instance

Input Example

POST / HTTP/1.1
Host: postgres.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CloneDBInstance
<Common request parameters>

{
    "VpcId": "vpc-2ot3acw1",
    "AutoRenewFlag": "1",
    "DBInstanceId": "postgres-abcd1234",
    "RecoveryTargetTime": "2021-12-25 01:27:35",
    "Storage": "10",
    "Period": "1",
    "AutoVoucher": "0",
    "InstanceChargeType": "prepaid",
    "SpecCode": "cdb.pg.z1.2g",
    "SubnetId": "subnet-ppv9iw34",
    "DBNodeSet": [
        {
            "Role": "Standby",
            "Zone": "ap-guangzhou-3"
        },
        {
            "Role": "Primary",
            "Zone": "ap-guangzhou-3"
        }
    ]
}

Output Example

{
  "Response": {
    "RequestId": "6ace8140-6b9e-4e81-a8ad-ef3f92b2aa90",
    "DealName": "20211225711000768276461",
    "BillId": "20211225711000768276471"
  }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure.UnauthorizedOperation Authentication failed.
FailedOperation.AllocateQuotasError Failed to request a quota for resource tags.
FailedOperation.CamAuthFailed CAM authentication failed.
FailedOperation.CamSigAndAuthError Authentication failed. Please try again later. If the problem persists, please contact customer service.
FailedOperation.CdbCgwConnectError Failed to get project information. Please try again later. If the problem persists, please contact customer service.
FailedOperation.DatabaseAccessError Failed to access database management service. Please try again later. If the problem persists, please contact customer service.
FailedOperation.FailedOperationError Operation failed. Please try again later.
FailedOperation.GetSubnetError Failed to query VPC subnets.
FailedOperation.GetVpcInfoError Failed to query VPC information. Please try again later. If the problem persists, please contact customer service.
FailedOperation.QuerySpecError Failed to query specifications. Please try again later. If the problem persists, please contact customer service.
FailedOperation.QueryVpcFailed Failed to query VPC.
FailedOperation.QueryVpcFalied Failed to get VPC details.
InternalError.InternalHttpServerError An exception occurred while executing the request.
InvalidParameterValue.IllegalProjectId Invalid ProjectId.
InvalidParameterValue.IllegalRegion Invalid Region parameter.
InvalidParameterValue.IllegalZone Invalid Zone parameter.
InvalidParameterValue.InvalidParameterValueError Incorrect parameter value
InvalidParameterValue.InvalidZoneIdError Invalid availability zone.
OperationDenied.CamDeniedError This operation cannot be performed.
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support