tencent cloud

Feedback

CreateServerlessDBInstance

Last updated: 2024-06-17 14:26:00

    1. API Description

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

    This API is used to create a PostgreSQL for Serverless instance. If the creation succeeds, the instance ID will be returned.

    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: CreateServerlessDBInstance.
    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 Availability zone ID. Only ap-shanghai-2, ap-beijing-1, and ap-guangzhou-2 are supported during the beta test.
    DBInstanceName Yes String Instance name. The value must be unique for the same account.
    DBVersion Yes String Kernel version of a PostgreSQL instance. Currently, only 10.4 is supported.
    DBCharset Yes String Database character set of a PostgreSQL instance. Currently, only UTF-8 is supported.
    ProjectId No Integer Project ID.
    VpcId No String VPC ID.
    SubnetId No String VPC subnet ID.
    TagList.N No Array of Tag Array of tags to be bound with the instance

    3. Output Parameters

    Parameter Name Type Description
    DBInstanceId String Instance ID, such as "postgres-xxxxx". The value must be globally unique.
    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 Creating PostgreSQL for Serverless instance

    This example shows you how to create a PostgreSQL for Serverless 10.4 instance named "serverlessdb-test" with the UTF-8 character set used on the server.

    Input Example

    POST / HTTP/1.1
    Host: postgres.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateServerlessDBInstance
    <Common request parameters>
    
    {
        "VpcId": "vpc-xxxx",
        "Zone": "ap-guangzhou-3",
        "DBVersion": "10.4",
        "DBInstanceName": "serverlessdb-test",
        "DBCharset": "UTF8",
        "SubnetId": "subnet-xxx"
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "08fdf411-5d39-44f2-8e1d-a58ee60b237d",
            "DBInstanceId": "postgres-xxxxx"
        }
    }
    

    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.CamSigAndAuthError Authentication failed. Please try again later. If the problem persists, please contact customer service.
    FailedOperation.CreateBasicNetworkDeniedError Classic network creation is unsupported.
    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.
    FailedOperation.GetVpcInfoError Failed to query VPC information. Please try again later. If the problem persists, please contact customer service.
    FailedOperation.QueryVpcFailed Failed to query VPC.
    FlowError Failed to create the task.
    InternalError Internal error.
    InternalError.DBError Backend database execution 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.
    InvalidParameter Parameter error.
    InvalidParameter.InstanceNameExist The instance name already exists.
    InvalidParameter.ParameterCheckError Failed to check the parameter.
    InvalidParameterValue.DataConvertError Failed to convert data format. Please contact customer service.
    InvalidParameterValue.IllegalRegion Invalid Region parameter.
    InvalidParameterValue.IllegalZone Invalid Zone parameter.
    InvalidParameterValue.InstanceNameExist The account already exists.
    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.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.RegionNotSupported The current region is not supported.
    InvalidParameterValue.StructParseFailed An error occurred while parsing parameters.
    OperationDenied.CamDeniedError This operation cannot be performed.
    OperationDenied.NotSupportZoneError Serverless is not supported in this availability zone.
    OperationDenied.VersionNotSupportError Serverless is not supported on this version of PostgreSQL.
    ResourceNotFound.InstanceNotFoundError The instance does not exist.
    ResourceUnavailable.InvalidInstanceStatus Incorrect instance status.
    UnauthorizedOperation.UserHasNoRealnameAuthentication Unverified user.