Create Instance (Postpaid Plan)

Last updated: 2020-06-04 18:31:42

    Note:

    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new MongoDB API 3.0 which is standardized and faster.

    1. API Description

    This API (CreateMongoDB) is used to create a replica set instance (annual or monthly plan).
    Domain for API request: mongodb.api.qcloud.com

    1. Please first use API Query Supported Instance Specifications (supporting custom availability zones and configurations) to query the supported instance specifications, and then use API Query Instance Price (Annual or Monthly Plan) to query the price of creatable instance;
    2. Supported instance types: GIO: High IO; TGIO: High IO (10 GB);
    3. Supported cloud database versions: MONGO_3_MMAP, MONGO_3_WT;
    4. Value range of validity period of instance in a single creation: [1,2,3,4,5,6,7,8,9,10,11,12,24,36] (in month).

    2. Input Parameters

    The following request parameter list only provides API request parameters. Common request parameters are also needed when the API is called. The Action field for this API is CreateMongoDB.

    Parameter Name Required Type Description
    zoneId Yes Int Availability zone ID. You can use API Query Supported Instance Specifications to obtain the supported availability zones
    typeId Yes String Name of instance type. GIO: High IO; TGIO: High IO (10 GB)
    memory Yes Int Memory size of instance. Each memory value corresponds to a selectable disk capacity range (in MB)
    diskSize Yes Int Disk capacity of instance (in GB)
    secondaryNum Yes Int Number of slave nodes of replica set instance. Only 1 and 2 are supported currently
    version Yes Int Database version number, for example: MONGO_3_MMAP, MONGO_3_WT
    goodsNum Yes Int Number of instances purchased at a time
    period Yes Int Purchased usage period (in month). Value range: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36]
    password Yes String Password for the instance. Rule: It should be a combination of 8-16 characters comprised of at least two of the following types: letters, numbers, special characters (!, @, #, %, ^, ())
    unVpcId No String VPC ID. If it is left empty, the default is basic network.
    unSubnetId No String subnetId is invalid under basic network; Under VPC, such as subnet-3lzrkspo
    projectId No Int Project ID. The value is subject to the projectId returned via User Account > User Account-related APIs

    3. Output Parameters

    Parameter Name Type Description
    code Int Common error code; 0: Succeeded; other values: Failed.
    message String Error message description. A null value indicates a success
    codeDesc String Description of error code at business side. For a successful operation, "Success" will be returned. In case of an error, a message describing the reason for the error will be returned.
    data Object Returned order ID

    Parameter data indicates the order ID, and is composed as follows:

    Parameter Name Type Description
    data.dealId String Order ID. You can use API DescribeMongodbDealDetail to query order details

    4. Error Codes

    The following error codes include the business logic error codes for this API.

    Error Code Error Message Error Description
    11050 InvalidParameter Incorrect business parameter
    11060 ServiceUnavailable The service is unavailable in the requested zone currently
    11071 UserNotInWhiteList The user is not in the whitelist
    11061 TypeIdIllegal Invalid typeId
    11062 MemSizeExceedMaxLimit The requested memory size exceeds the upper limit
    11063 MemSizeIllegal The requested memory size is not an integral multiple of 1024
    11064 MemSizeNotInRange The requested memory size is not in the supported range
    11065 RequestSizeIllegal The requested memory size or disk capacity is invalid. The memory size must be an integral multiple of 1024, and the disk capacity must be an integer
    11066 DiskSizeNotInRange The requested disk capacity is not in the supported range
    11067 PeriodNotInRange The requested period is not in the supported range. The value range is [1,2,3,4,5,6,7,8,9,10,11,12,24,36] (in month)
    11072 SecondaryNumNotInRange The number of slave nodes of replica set instance is not in the supported range. The value range is [1,2]
    11059 PasswordRuleError Incorrect password rule. The password must be a combination of 8-16 characters comprised of at least two of the following types: letters, numbers and special characters (!, @, #, %, ^, *, ())
    100207 OperationConstraints.AccountBalanceNotEnough Insufficient account balance. Please top it up
    11075 UnVpcIdNotExists unVpcId does not exist
    11076 UnSubnetIdNotExists unSubnetId does not exist

    5. Example

    Input

    https://mongodb.api.qcloud.com/v2/index.php?Action=CreateMongoDB
    &zoneId=100002
    &typeId=GIO
    &memory=4096
    &diskSize=30
    &secondaryNum=2
    &version=MONGO_3_MMAP
    &goodsNum=1
    &period=1
    &password=49A2d!e@f12e
    

    Output

    {
        "code": 0,
        "message": "",
        "codeDesc": "Success",
        "data": {
            "dealId": "3373037"
        }
    }
    

    Was this page helpful?

    Was this page helpful?

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