Domain name for API request: postgres.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 | No | String | Common Params. This parameter is not required for this API. |
Zone | Yes | String | Primary AZ of the instance in the format of ap-guangzhou-3 . To support multiple AZs, add information of the primary and standby AZs in the DBNodeSet.N field.The information of AZ can be obtained from the Zone field in the return value of the DescribeZones API. |
SpecCode | Yes | String | Purchasable code, which can be obtained from the SpecCode field in the return value of the DescribeClasses API. |
Storage | Yes | Integer | Instance storage capacity in GB |
InstanceCount | Yes | Integer | The number of instances to be purchased at a time. Value range: 1-10. To purchase more than 10 instances each time, you can make multiple calls. |
Period | Yes | Integer | Purchase duration, in months.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, with the following specifications: |
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 "/". It must include the following four types of characters: |
DBMajorVersion | No | String | The major version number of PostgreSQL (this parameter is currently required), and the version information can be obtained from DescribeDBVersions. Currently major versions 10 , 11 , 12 , 13 , 14 , and 15 are supported. For details, see Kernel Version Overview.When this parameter is entered, an instance running the latest kernel version of the latest minor version will be created based on this major version number. |
DBVersion | No | String | PostgreSQL community major version + minor version number. It's generally not recommended to pass in this parameter. If needed, only the latest minor version number under the current major version can be passed. |
DBKernelVersion | No | String | PostgreSQL kernel version number. It's generally not recommended to pass in this parameter. If needed, only the latest kernel version number under the current major version can be passed. |
InstanceChargeType | No | String | Instance billing type, which currently supports: Default value: PREPAID |
VpcId | No | String | VPC ID, in the format of vpc-xxxxxxxx (this parameter is currently required). A valid VpcId can be obtained by logging into the console; it can also be obtained from the unVpcId field in the return value of calling of the DescribeVpcEx API. |
SubnetId | No | String | VPC subnet ID, in the format of subnet-xxxxxxxx (this parameter is currently required). A valid VPC subnet ID can be obtained by logging into the console; it can also be obtained from the unSubnetId field in the return value of calling of the DescribeSubnets API. |
DBNodeSet.N | No | Array of DBNode | Deployment information of the instance node, which will display the information of each AZ when the instance node is deployed across multiple AZs. The information of AZ can be obtained from the Zone field in the return value of the DescribeZones API. |
AutoRenewFlag | No | Integer | Renewal Flag:0 : manual renewal1 : auto-renewalDefault value: 0 |
AutoVoucher | No | Integer | Whether to automatically use coupons:0 : no1 : yesDefault value: 0 |
VoucherIds.N | No | Array of String | Voucher ID list. Currently, you can specify only one voucher. |
ProjectId | No | Integer | Project ID |
ActivityId | No | Integer | Campaign ID |
Name | No | String | Instance name, which can contain up to 60 letters, digits, hyphens, and symbols (_-). If this parameter is not specified, "Unnamed" will be displayed by default. |
TagList.N | No | Array of Tag | The information of tags to be bound with the instance, which is left empty by default. This parameter can be obtained from the Tags field in the return value of the DescribeTags API. |
SecurityGroupIds.N | No | Array of String | Security group of the instance, which can be obtained from the sgld field in the return value of the DescribeSecurityGroups API. If this parameter is not specified, the default security group will be bound. |
NeedSupportTDE | No | Integer | Whether data transparent encryption is required:0 : no1 : yesDefault value: 0See Overview of Data Transparent Encryption. |
KMSKeyId | No | String | KeyId of custom key, which is required if you select custom key encryption. It is also the unique CMK identifier. For more information on creating KeyId , see Enabling TDE. |
KMSRegion | No | String | The region where the KMS service is enabled. When KMSRegion is left empty, the current region will be selected by default. If the current region does not support KMS, you must select another region that does.For more information on KMSRegion , see Enabling TDE. |
DBEngine | No | String | Database engine, which supports:postgresql : TencentDB for PostgreSQLmssql_compatible : MSSQL compatible - TencentDB for PostgreSQLDefault value: postgresql |
DBEngineConfig | No | String | Configuration information for the database engine, and the configuration format is as follows: {"$key1":"$value1", "$key2":"$value2"} Supported engines include: mssql_compatible engine: "af_ZA", "sq_AL", "ar_DZ", "ar_BH", "ar_EG", "ar_IQ", "ar_JO", "ar_KW", "ar_LB", "ar_LY", "ar_MA", "ar_OM", "ar_QA", "ar_SA", "ar_SY", "ar_TN", "ar_AE", "ar_YE", "hy_AM", "az_Cyrl_AZ", "az_Latn_AZ", "eu_ES", "be_BY", "bg_BG", "ca_ES", "zh_HK", "zh_MO", "zh_CN", "zh_SG", "zh_TW", "hr_HR", "cs_CZ", "da_DK", "nl_BE", "nl_NL", "en_AU", "en_BZ", "en_CA", "en_IE", "en_JM", "en_NZ", "en_PH", "en_ZA", "en_TT", "en_GB", "en_US", "en_ZW", "et_EE", "fo_FO", "fa_IR", "fi_FI", "fr_BE", "fr_CA", "fr_FR", "fr_LU", "fr_MC", "fr_CH", "mk_MK", "ka_GE", "de_AT", "de_DE", "de_LI", "de_LU", "de_CH", "el_GR", "gu_IN", "he_IL", "hi_IN", "hu_HU", "is_IS", "id_ID", "it_IT", "it_CH", "ja_JP", "kn_IN", "kok_IN", "ko_KR", "ky_KG", "lv_LV", "lt_LT", "ms_BN", "ms_MY", "mr_IN", "mn_MN", "nb_NO", "nn_NO", "pl_PL", "pt_BR", "pt_PT", "pa_IN", "ro_RO", "ru_RU", "sa_IN", "sr_Cyrl_RS", "sr_Latn_RS", "sk_SK", "sl_SI", "es_AR", "es_BO", "es_CL", "es_CO", "es_CR", "es_DO", "es_EC", "es_SV", "es_GT", "es_HN", "es_MX", "es_NI", "es_PA", "es_PY","es_PE", "es_PR", "es_ES", "es_TRADITIONAL", "es_UY", "es_VE", "sw_KE", "sv_FI", "sv_SE", "tt_RU", "te_IN", "th_TH", "tr_TR", "uk_UA", "ur_IN", "ur_PK", "uz_Cyrl_UZ", "uz_Latn_UZ", and "vi_VN". |
SyncMode | No | String | Primary-standby sync mode, which supports: Default value for the primary instance: Semi-sync Default value for the read-only instance: Async |
NeedSupportIpv6 | No | Integer | Whether support to IPv6 is required:0 : no1 : yesDefault value: 0 |
Parameter Name | Type | Description |
---|---|---|
DealNames | Array of String | Order number list. Each instance corresponds to an order number. |
BillId | String | Bill ID of frozen fees |
DBInstanceIdSet | Array of String | ID set of instances which have been created successfully. The parameter value will be returned only when the pay-as-you-go billing mode is used. |
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 create an instance running the latest kernel of PostgreSQL 12.4.
POST / HTTP/1.1
Host: postgres.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": "123"
}
}
This example shows you how to create a PostgreSQL instance running kernel v12.4_r1.0.
POST / HTTP/1.1
Host: postgres.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": "123"
}
}
This example shows you how to create a multi-AZ deployed instance running the latest kernel of PostgreSQL 12.
POST / HTTP/1.1
Host: postgres.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": "123"
}
}
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.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.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.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 (()`~!@#$%^&*-+=_|{}[]:;'<>,.?/), and cannot start with a slash (/). |
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.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. |
本页内容是否解决了您的问题?