Release Notes
Product Announcements
Domain name for API request: postgres.intl.tencentcloudapi.com.
This API is used to create one or more PostgreSQL instances. Instances created through this interface do not need to be initialized and can be used directly.
A maximum of 100 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: CreateInstances. |
| 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. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-nanjing, ap-seoul, ap-shanghai, ap-shanghai-fsi, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley, sa-saopaulo. |
| Zone | Yes | String | The primary availability zone of the instance, for example: ap-guangzhou-3. If needed to support multiple AZs, add primary and secondary AZ information in the DBNodeSet.N field. |
| SpecCode | Yes | String | Purchasable specification code. Obtain this parameter by calling the |
| Storage | Yes | Integer | Instance disk capacity size, unit: GB. The step length for parameter settings is 10. |
| InstanceCount | Yes | Integer | Number of instances to purchase, value ranges from 1 to 10. Single transaction supports a maximum quantity of 10. If exceeding this quantity, multiple calls can be performed to purchase. |
| Period | Yes | Integer | Purchase duration, unit: month. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, and 36.1. |
| Charset | Yes | String | Instance character set, which currently supports only: |
| AdminName | Yes | String | Username of the instance root account. Specific specifications are as follows: |
| AdminPassword | Yes | String | Password for the instance root account username, with a length of 8-32 characters. It is recommended to use a password of more than 12 characters and it cannot start with "/". |
| DBMajorVersion | No | String | PostgreSQL major version number (this parameter is currently required). Version information can be obtained from DescribeDBVersions. Currently supports major versions 10, 11, 12, 13, 14, and 15. For details, see kernel version overview. |
| DBVersion | No | String | PostgreSQL community major version + minor version number. |
| DBKernelVersion | No | String | PostgreSQL kernel version number. |
| InstanceChargeType | No | String | Instance billing type. Currently supports: |
| VpcId | No | String | VPC ID, such as vpc-xxxxxxxx (this parameter is currently required). A valid VPC ID can be obtained by logging in to the console to query or by calling the API DescribeVpcEx and acquiring the unVpcId field in the API return. |
| SubnetId | No | String | VPC subnet ID, such as subnet-xxxxxxxx (this parameter is currently required). Effective VPC subnet IDs can be queried by logging in to the console or by calling the API DescribeSubnets and acquiring the unSubnetId field in the API return. |
| DBNodeSet.N | No | Array of DBNode | Instance node deployment information. When multi-availability zone deployment is supported, it requires specifying the AZ information for each node. |
| AutoRenewFlag | No | Integer | Auto-renewal flag: |
| AutoVoucher | No | Integer | Whether to automatically use a voucher: |
| VoucherIds.N | No | Array of String | Voucher ID list. Currently only support specifying one voucher. |
| ProjectId | No | Integer | Project ID. The default value is 0, which means it belongs to the default project. |
| ActivityId | No | Integer | Activity ID. |
| Name | No | String | Instance name only supports Chinese/English/number/"_"/"-" with length less than 60. If no instance name is specified, "unnamed" is displayed by default. |
| TagList.N | No | Array of Tag | Tag information that should be bound to the instance is empty by default. You can get it by calling DescribeTags and checking the Tags field in the return value. |
| SecurityGroupIds.N | No | Array of String | Security group to which an instance belongs. Obtain this parameter by calling the sgId field in the returned value of DescribeSecurityGroups. If not specified, the default security group is bound. |
| NeedSupportTDE | No | Integer | Whether data transparent encryption is required: |
| KMSKeyId | No | String | The KeyId of the custom key. If you select custom key encryption, you need to input the KeyId of the custom key. KeyId is the unique identifier of CMK. |
| KMSRegion | No | String | For regions using the KMS service, KMSRegion is empty by default and the local region KMS is used. If the local region is not supported, select another KMS supported region. |
| KMSClusterId | No | String | Designate the service cluster for KMS. If KMSClusterId is empty, use the KMS of the Default Cluster. To select the specified KMS cluster, require the input of KMSClusterId. For details about KMSClusterId, see enable transparent data encryption. |
| DBEngine | No | String | Database engine, support: postgresql: TencentDB for PostgreSQLmssql_compatible: MSSQL compatible - TencentDB for PostgreSQL |
| DBEngineConfig | No | String | Configuration information for the database engine. The configuration format is as follows: |
| SyncMode | No | String | Primary-standby sync mode, supports: |
| NeedSupportIpv6 | No | Integer | Whether required to support Ipv6: |
| DeletionProtection | No | Boolean | Whether to enable deletion protection for the instance: true-enable deletion protection; false-disable deletion protection. |
| StorageType | No | String | Instance storage type. Available values: PHYSICAL_LOCAL_SSD: LOCAL SSD hard disk of PHYSICAL machine; CLOUD_PREMIUM: high-performance CLOUD block storage; CLOUD_SSD: SSD CLOUD disk; CLOUD_HSSD: enhanced SSD CLOUD disk. |
| Parameter Name | Type | Description |
|---|---|---|
| DealNames | Array of String | Order number list. Each instance corresponds to an order number. |
| BillId | String | Frozen transaction ID. |
| DBInstanceIdSet | Array of String | ID set of successfully created instances. Return value is available only in pay scenarios. |
| 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. |
Create a PostgreSQL instance with the new kernel in version 12.4
POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateInstances
<Common request parameters>
{
"InstanceCount": 1,
"AutoRenewFlag": 1,
"AdminName": "test2313",
"Zone": "ap-guangzhou-2",
"AdminPassword": " xxxxxxx",
"DBVersion": "12.4",
"DBEngine": "postgresql",
"Storage": 10,
"Period": 1,
"SpecCode": "cdb.pg.z1.2g",
"InstanceChargeType": "prepaid",
"AutoVoucher": 0,
"Charset": "UTF8"
}
{
"Response": {
"RequestId": "6ace8140-6b9e-4e81-a8ad-ef3f92b2aa90",
"DealNames": [
"20180119110001"
],
"DBInstanceIdSet": [
"postgres-xxxxx"
],
"BillId": "20181225711000768276471"
}
}
Create a PostgreSQL instance with the latest kernel version in version 12 (cross-availability zone).
POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateInstances
<Common request parameters>
{
"InstanceCount": 1,
"AutoRenewFlag": 1,
"DBMajorVersion": "12",
"Zone": "ap-guangzhou-2",
"AdminPassword": " xxxxxxx",
"Charset": "UTF8",
"Storage": 10,
"Period": 1,
"SpecCode": "cdb.pg.z1.2g",
"InstanceChargeType": "prepaid",
"AutoVoucher": 0,
"DBNodeSet": [
{
"Role": "Standby",
"Zone": "ap-guangzhou-3"
},
{
"Role": "Primary",
"Zone": "ap-guangzhou-2"
}
],
"AdminName": "test2313"
}
{
"Response": {
"RequestId": "6ace8140-6b9e-4e81-a8ad-ef3f92b2aa90",
"DealNames": [
"20180119110001"
],
"DBInstanceIdSet": [
"postgres-xxxxx"
],
"BillId": "20181225711000768276479"
}
}
Create a PostgreSQL instance with kernel version number v12.4_r1.0
POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateInstances
<Common request parameters>
{
"InstanceCount": 1,
"AutoRenewFlag": 1,
"AdminName": "test2313",
"Zone": "ap-guangzhou-2",
"AdminPassword": " xxxxxxx",
"Charset": "UTF8",
"Storage": 10,
"Period": 1,
"SpecCode": "cdb.pg.z1.2g",
"DBKernelVersion": "v12.4_r1.0",
"DBEngine": "postgresql",
"InstanceChargeType": "prepaid",
"AutoVoucher": 0
}
{
"Response": {
"RequestId": "6ace8140-6b9e-4e81-a8ad-ef3f92b2aa90",
"DealNames": [
"20180119110001"
],
"DBInstanceIdSet": [
"postgres-xxxxx"
],
"BillId": "20181225711000768276476"
}
}
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 |
|---|---|
| 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.CreateBasicNetworkDeniedError | Classic network creation is unsupported. |
| FailedOperation.CreateOrderFailed | Failed to create the renewal order. |
| FailedOperation.DatabaseAccessError | Failed to access database management service. Please try again later. If the problem persists, please contact customer service. |
| FailedOperation.DatabaseAffectedError | Data operation failed. Please contact customer service. |
| FailedOperation.FailedOperationError | Operation failed. Please try again later. |
| FailedOperation.FlowCreateError | Failed to create a task. Please try again later. If the problem persists, please contact customer service. |
| 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.InvalidTradeOperate | Billing error. Corresponding purchase/renewal/configuration change operations are not allowed for the current instance. |
| FailedOperation.PayOrderFailed | Failed to make order payment. |
| FailedOperation.QueryPriceFailed | Failed to query the price. |
| 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. |
| FailedOperation.ServiceAccessError | Failed to access internal service. Please try again later. If the problem persists, please contact customer service. |
| FailedOperation.StorageMemoryCheckError | The memory and storage capacity to which an instance is upgraded should be higher than its original memory and storage capacity. |
| FailedOperation.TradeCreateError | Failed to request the billing platform to create an order. |
| FailedOperation.TradePayOrdersError | Failed to request to pay for the order. |
| FailedOperation.WhitelistConnectError | Failed to query the allowlist. Try again later. If the problem persists, contact customer service. |
| InternalError.CgwError | CGW error. |
| InternalError.CnsError | Basic network error. |
| InternalError.DBError | Backend database execution error. |
| InternalError.DfwError | DFW error. |
| InternalError.FlowError | Failed to create the flow. |
| InternalError.InternalHttpServerError | An exception occurred while executing the request. |
| InternalError.JsonParseError | Json data parsing failed. contact our customer service for assistance. |
| InternalError.SystemError | System error. When this error occurs, please contact customer service for assistance. |
| InternalError.UnknownError | Unknown error. When this error occurs, please contact customer service for assistance. |
| InternalError.VpcError | VPC error. |
| InvalidParameter | Parameter error. |
| InvalidParameter.ParameterCheckError | Failed to check the parameter. |
| InvalidParameter.TradeAccessDeniedError | Incorrect PID |
| InvalidParameter.VpcNotFoundError | Failed to query VPC information. |
| InvalidParameterValue.AccountExist | The current account already exists. |
| InvalidParameterValue.BadSpec | The instance specification to upgrade to is not purchasable. |
| InvalidParameterValue.CharsetNotFoundError | Incorrect database character set |
| InvalidParameterValue.DataConvertError | Failed to convert data format. Please contact customer service. |
| InvalidParameterValue.DecryptPasswordFailed | Decrypting the password failed. confirm whether the password encryption is correct. |
| InvalidParameterValue.IllegalInstanceChargeType | Incorrect billing mode. |
| InvalidParameterValue.IllegalProjectId | Invalid ProjectId. |
| InvalidParameterValue.IllegalRegion | Invalid Region parameter. |
| InvalidParameterValue.IllegalZone | Invalid Zone parameter. |
| InvalidParameterValue.InterfaceNameNotFound | Incorrect ACTION. |
| InvalidParameterValue.InvalidAccountError | Invalid account. The account name is case-insensitive, must contain 1-16 characters comprised of letters, digits, underscores, and should neither be "postgres" nor start with a digit or "pg_". |
| InvalidParameterValue.InvalidAccountFormat | Incorrect account format. |
| InvalidParameterValue.InvalidAccountName | The current account name cannot be a reserved character. |
| InvalidParameterValue.InvalidAccountNameError | The account setting is invalid. please follow the account naming rules: the account name must be 1-16 characters, can only consist of letters, digits, or underscores; cannot be postgres; cannot start with a digit, pg_, or tencentdb_; all rules are case-insensitive. |
| InvalidParameterValue.InvalidAccountNameFormatError | The account is invalid. follow the account naming rules: it must consist of letters (a-z, a-z), digits (0-9), and underscores (_), start with a letter or underscore (_), and be no more than 63 characters. system reserved keywords cannot be used, 'postgres' is not allowed, and it cannot start with 'pg_' or 'tencentdb_'. |
| InvalidParameterValue.InvalidCharset | Incorrect database character set. Currently, only UTF8 and LATIN1 are supported. |
| InvalidParameterValue.InvalidInstanceNum | The number of purchased instances exceeds the limit. |
| InvalidParameterValue.InvalidOrderNum | Billing error. Invalid order type ID. |
| InvalidParameterValue.InvalidParameterValueError | Incorrect parameter value |
| InvalidParameterValue.InvalidPasswordFormat | Incorrect password format. |
| InvalidParameterValue.InvalidPasswordLengthError | Invalid password. The password length does not meet the requirements. |
| InvalidParameterValue.InvalidPasswordValueError | Invalid password. The password must contain uppercase letters, lowercase letters, digits, and symbols (()`~!@#$%^&*-+=_ |
| InvalidParameterValue.InvalidPid | Incorrect PID parameter. |
| InvalidParameterValue.InvalidZoneIdError | Invalid availability zone. |
| InvalidParameterValue.ParameterCharacterError | Invalid parameter. The parameter can contain only letters, digits, underscores, and hyphens. |
| InvalidParameterValue.ParameterHandleError | Failed to process the parameter. Please check if the parameter value is valid. |
| InvalidParameterValue.ParameterLengthLimitError | The length of parameter exceeds the limit. |
| InvalidParameterValue.ParameterOutRangeError | Invalid parameter values. |
| InvalidParameterValue.RegionNotSupported | The current region is not supported. |
| InvalidParameterValue.SpecNotRecognizedError | Failed to identify the specification ({{1}}). |
| InvalidParameterValue.StructParseFailed | An error occurred while parsing parameters. |
| InvalidPid | Incorrect PID parameter. |
| OperationDenied.CamDeniedError | This operation cannot be performed. |
| OperationDenied.InstanceStatusLimitOpError | This operation cannot be performed on an instance in this status. |
| OperationDenied.InsufficientBalanceError | Insufficient account balance. |
| OperationDenied.TradePermissionError | No payment permission. activation failed. |
| OperationDenied.UserNotAuthenticatedError | You need to verify your identity to make a purchase. |
| OperationDenied.VpcDeniedError | You do not have the permission to operate the VPC. |
| ResourceInsufficient.ResourceNotEnough | There are not enough resources to purchase instances of this specification in the current region. |
| ResourceUnavailable.InvalidInstanceStatus | Incorrect instance status. |
| ResourceUnavailable.ResourceNoPermission | No permission for the VPC. |
| ResourceUnavailable.VpcResourceNotFound | Failed to get the information of the VPC where the instance resides. |
| UnauthorizedOperation.UserHasNoRealnameAuthentication | Unverified user. |
| UnknownError | Unknown error. When this error occurs, please contact customer service for assistance. |
피드백