InitDBInstances

Last updated: 2020-12-01 20:30:25

1. API Description

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

This API is used to initialize a TencentDB for PostgreSQL instance.

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

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: postgres.ap-shanghai-fsi.tencentcloudapi.com

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 parameter. The value used for this API: InitDBInstances.
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.
DBInstanceIdSet.N Yes Array of String Instance ID set.
AdminName Yes String Instance admin account username.
AdminPassword Yes String Password corresponding to instance root account username.
Charset Yes String Instance character set. Valid values: UTF8, LATIN1.

3. Output Parameters

Parameter Name Type Description
DBInstanceIdSet Array of String Instance ID set.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Initializing one instance

This example shows you how to initialize the instance whose ID is "postgres-6fego161".

Input Example

https://postgres.tencentcloudapi.com/?Action=InitDBInstances
&DBInstanceIdSet.0=postgres-6fego161
&AdminName=testuser
&AdminPassword=testuser%40123
&Charset=UTF8
&<Common request parameters>

Output Example

{
  "Response": {
    "RequestId": "98fe67de-f7a7-4285-b1f2-40c2a2a3495e",
    "DBInstanceIdSet": [
      "postgres-6fego161"
    ]
  }
}

Example2 Initializing multiple instances

This example shows you how to simultaneously initialize two instances whose IDs are "postgres-6fego161" and "postgres-lnp6j617" respectively.

Input Example

https://postgres.tencentcloudapi.com/?Action=InitDBInstances
&Version=2017-03-12
&Region=ap-guangzhou
&DBInstanceIdSet.0=postgres-6fego161
&DBInstanceIdSet.1=postgres-lnp6j617
&AdminName=testuser
&AdminPassword=testuser%40123
&Charset=UTF8
&<Common request parameters>

Output Example

{
  "Response": {
    "RequestId": "5b895b34-5448-4c55-9ad1-a61427c15837",
    "DBInstanceIdSet": [
      "postgres-6fego161",
      "postgres-lnp6j617"
    ]
  }
}

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.
InternalError.DBError Backend database execution error.
InternalError.FlowError Failed to create the flow.
InternalError.SystemError System error. When this error occurs, please contact customer service for assistance.
InvalidParameter Parameter error.
InvalidParameterValue.InstanceNotExist The current instance does not exist.
InvalidParameterValue.InvalidAccountFormat Incorrect account format.
InvalidParameterValue.InvalidCharset Incorrect database character set. Currently, only UTF8 and LATIN1 are supported.
InvalidParameterValue.InvalidPasswordFormat Incorrect password format.
ResourceUnavailable.InvalidInstanceStatus Incorrect instance status.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help