tencent cloud

文档反馈

InitDBInstances

最后更新时间:2024-06-17 14:26:23

    1. API Description

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

    This API is used to initialize a TencentDB for PostgreSQL instance. This API is disused and replaced by the CreateInstances API.

    A maximum of 100 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: InitDBInstances.
    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.
    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, 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.

    4. Example

    Example1 Initializing one instance

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

    Input Example

    POST / HTTP/1.1
    Host: postgres.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: InitDBInstances
    <Common request parameters>
    
    {
        "AdminPassword": "testuser%40123",
        "Charset": "UTF8",
        "AdminName": "testuser",
        "DBInstanceIdSet": [
            "postgres-6fego161"
        ]
    }
    

    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 with IDs "postgres-6fego161" and "postgres-lnp6j617" respectively.

    Input Example

    POST / HTTP/1.1
    Host: postgres.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: InitDBInstances
    <Common request parameters>
    
    {
        "AdminPassword": "testuser%40123",
        "Charset": "UTF8",
        "AdminName": "testuser",
        "DBInstanceIdSet": [
            "postgres-lnp6j617",
            "postgres-6fego161"
        ]
    }
    

    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.
    FailedOperation.CamSigAndAuthError Authentication failed. 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.FlowCreateError Failed to create a task. Please try again later. If the problem persists, please contact customer service.
    InternalError.DBError Backend database execution error.
    InternalError.InternalHttpServerError An exception occurred while executing the request.
    InternalError.SystemError System error. When this error occurs, please contact customer service for assistance.
    InvalidParameter Parameter error.
    InvalidParameter.ParameterCheckError Failed to check the parameter.
    InvalidParameterValue.CharsetNotFoundError Incorrect database character set
    InvalidParameterValue.InstanceNotExist The current instance does not exist.
    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.InvalidCharset Incorrect database character set. Currently, only UTF8 and LATIN1 are supported.
    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.ParameterCharacterLimitError The parameter is invalid. Please modify it and try again.
    InvalidParameterValue.ParameterCharacterPreLimitError The parameter prefix is invalid. Please modify it and try again.
    InvalidParameterValue.ParameterHandleError Failed to process the parameter. Please check if the parameter value is valid.
    OperationDenied.CamDeniedError This operation cannot be performed.
    OperationDenied.InstanceAccessDeniedError You do not have the permission to operate this resource.
    OperationDenied.InstanceStatusLimitOpError This operation cannot be performed on an instance in this status.
    ResourceNotFound.InstanceNotFoundError The instance does not exist.
    ResourceUnavailable.InvalidInstanceStatus Incorrect instance status.