tencent cloud

Feedback

CreateCloudReadOnlyDBInstances

Last updated: 2024-11-26 16:33:01

    1. API Description

    Domain name for API request: sqlserver.intl.tencentcloudapi.com.

    This API is used to create read-only instances (cloud disk).

    A maximum of 20 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: CreateCloudReadOnlyDBInstances.
    Version Yes String Common Params. The value used for this API: 2018-03-28.
    Region Yes String Common Params. For more information, please see the list of regions supported by the product.
    InstanceId Yes String Instance ID in the format of mssql-3l3fgqn7.
    Zone Yes String Instance AZ, such as ap-guangzhou-1 (Guangzhou Zone 1). Purchasable AZs for an instance can be obtained through theDescribeZones API.
    ReadOnlyGroupType Yes Integer Read-only group types. Valid values: 1 (each read-only replica is placed in one auto-created read-only group), 2 (all read-only replicas are placed in one auto-created read-only group), 3 (all read-only replicas are placed in one existing read-only group).
    Memory Yes Integer Instance memory size in GB
    Storage Yes Integer Instance disk size in GB
    Cpu Yes Integer Number of instance cores
    MachineType Yes String The host type of purchased instance. Valid values: CLOUD_HSSD (virtual machine with enhanced SSD), CLOUD_TSSD (virtual machine with ulTra SSD), CLOUD_BSSD (virtual machine with balanced SSD).
    ReadOnlyGroupForcedUpgrade No Integer Valid values: 0 (not upgrade the primary instance by default), 1 (upgrade the primary instance to complete the RO deployment). You need to pass in 1 for this parameter and upgrade the primary instance to cluster edition.
    ReadOnlyGroupId No String Existing read-only group ID, which is required when ReadOnlyGroupType is 3.
    ReadOnlyGroupName No String New read-only group ID, which is required when ReadOnlyGroupType is 2.
    ReadOnlyGroupIsOfflineDelay No Integer Whether delayed read-only instance removal is enabled in a new read-only group, which is required when ReadOnlyGroupType is 2. Valid values: 1 (enabled), 0 (disabled). The read-only replica will be automatically removed when the delay between it and the primary instance exceeds the threshold.
    ReadOnlyGroupMaxDelayTime No Integer The delay threshold for a new read-only group, which is required when ReadOnlyGroupType is 2 and ReadOnlyGroupIsOfflineDelay is 1.
    ReadOnlyGroupMinInGroup No Integer Minimum number of reserved read-only replicas when the delayed removal is enabled for the new read-only group, which is required when ReadOnlyGroupType is 2 and ReadOnlyGroupIsOfflineDelay is 1.
    InstanceChargeType No String Billing mode. Valid values: PREPAID (monthly subscription), POSTPAID (pay-as-you-go).
    GoodsNum No Integer Number of read-only instances to be purchased this time. Default value: 2.
    SubnetId No String VPC subnet ID in the format of subnet-bdoe83fa. Both SubnetId and VpcId need to be set or unset at the same time.
    VpcId No String VPC ID in the format of vpc-dsp338hz. Both SubnetId and VpcId need to be set or unset at the same time.
    Period No Integer The purchase period of an instance. Default value: 1 (one month). Maximum value: 48.
    SecurityGroupList.N No Array of String Security group list, which contains security group IDs in the format of sg-xxx.
    AutoVoucher No Integer Whether to automatically use voucher. Valid values: 0 (no, default), 1 (yes).
    VoucherIds.N No Array of String Array of voucher IDs (currently, only one voucher can be used per order)
    ResourceTags.N No Array of ResourceTag Tags associated with the instances to be created
    Collation No String Collation of system character sets. Default value: Chinese_PRC_CI_AS
    TimeZone No String System time zone. Default value: China Standard Time

    3. Output Parameters

    Parameter Name Type Description
    DealNames Array of String Order name in array
    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 a read-only instance

    This example shows you how to create a read-only replica based on the balanced SSD.

    Input Example

    POST / HTTP/1.1Host: sqlserver.intl.tencentcloudapi.comContent-Type: application/jsonX-TC-Action: CreateCloudReadOnlyDBInstances<common request parameters>{    "ReadOnlyGroupMaxDelayTime": "10",    "VpcId": "vpc-3xq2t5al",    "GoodsNum": "1",    "Zone": "ap-guangzhou-2",    "InstanceId": "mssql-6upluvd5",    "Period": "1",    "Storage": "10",    "ReadOnlyGroupIsOfflineDelay": "1",    "ReadOnlyGroupMinInGroup": "1",    "ReadOnlyGroupName": "default_name",    "Collation": "Chinese_PRC_CI_AS",    "ReadOnlyGroupType": "2",    "InstanceChargeType": "POSTPAID",    "Memory": "2",    "SubnetId": "subnet-gdy95gfs",    "TimeZone": "China Standard Time",    "ReadOnlyGroupForcedUpgrade": "1",    "Cpu": 2,    "MachineType": "CLOUD_BSSD"}
    

    Output Example

    {
        "Response": {
            "DealNames": [
                "20200722117963"
            ],
            "RequestId": "0509b6b8-8906-479f-9489-10620ec6d4ce"
        }
    }
    

    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
    FailedOperation.CreateOrderFailed Failed to create order.
    FailedOperation.DBError Database error.
    FailedOperation.GetVpcFailed Failed to get VPC information.
    InternalError.DBError Database error
    InternalError.SystemError System error.
    InternalError.VPCError VPC error
    InvalidParameter.InputIllegal Input error.
    InvalidParameter.ParamsAssertFailed An error occurred while converting parameter assertion.
    InvalidParameter.PayOrderFailed Failed to make order payment.
    InvalidParameterValue.IllegalSpec Incorrect instance specification information.
    InvalidParameterValue.ParameterTypeError Incorrect parameter type.
    InvalidParameterValue.RoGroupNameIsIllegal Read-only group name contains invalid characters.
    InvalidParameterValue.SecurityGroupIdIsIllegal Invalid security group ID.
    ResourceNotFound.InstanceNotFound The instance does not exist.
    ResourceNotFound.VpcNotExist The VPC does not exist.
    ResourceUnavailable.InstanceStatusInvalid Invalid instance status.
    ResourceUnavailable.VpcNotExist VPC not found.
    UnauthorizedOperation.PermissionDenied CAM authentication error.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support