All Products
Search
Document Center

ApsaraDB for MongoDB:CreateDBInstance

Last Updated:Nov 06, 2023

CreateDBInstance

Operation Description

Creates or clones an ApsaraDB for MongoDB replica set instance.

debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

debugging

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dds:CreateDBInstanceWRITE
  • dbinstance
    acs:dds:{#regionId}:{#accountId}:dbinstance/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The database engine of the instance. The value is fixed as MongoDB.

cn-hangzhou
ClientTokenstringNo

The version of the database engine. Valid values:

  • 6.0
  • 5.0
  • 4.4
  • 4.2
  • 4.0
Note When you call this operation to clone an instance or restore an instance from the recycle bin, set the value of this parameter to the engine version of the source instance.
ETnLKlblzczshOTUbOCz****
ZoneIdstringNo

The instance type. You can also call the DescribeAvailableResource operation to query the instance type.

cn-hangzhou-g
EnginestringYes

The storage capacity of the instance. Unit: GB.

The values that can be specified for this parameter vary based on the instance types. For more information, see Replica set instance types.

Enumeration Value:
  • MongoDB
MongoDB
EngineVersionstringYes

The name of the instance. The name of the instance must meet the following requirements:

  • The name must start with a letter.
  • The name can contain digits, letters, underscores (_), and hyphens (-).
  • The name must be 2 to 256 characters in length.
Enumeration Value:
  • 4.0
  • 5.0
  • 4.2
  • 6.0
  • 4.4
4.4
DBInstanceClassstringYes

The IP addresses in an IP address whitelist. Multiple IP addresses are separated by commas (,), and each IP address in the IP address whitelist must be unique. The following types of values are supported:

  • 0.0.0.0/0
  • IP addresses, such as 10.23.12.24.
  • Classless Inter-Domain Routing (CIDR) blocks, such as 10.23.12.0/24. In this case, /24 indicates that the prefix of each IP address is 24-bit long. You can replace 24 with a value within the range of 1 to 32.
Note
  • A maximum of 1,000 IP addresses or CIDR blocks can be configured for each instance.
  • If you enter 0.0.0.0/0, all IP addresses can access the instance. This may introduce security risks to the instance. Proceed with caution.
  • dds.mongo.standard
    DBInstanceStorageintegerYes

    The password of the root account. The password must meet the following requirements:

    • The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Special characters include ! # $ % ^ & * ( ) _ + - =
    • The password of the account must be 8 to 32 characters in length.
    10
    DBInstanceDescriptionstringNo

    The billing method of the instance. Valid values:

    • PostPaid: pay-as-you-go. This is the default value.
    • PrePaid: subscription.
    Note If you set this parameter to PrePaid, you must also specify the Period parameter.
    test
    SecurityIPListstringNo

    The subscription period of the instance. Unit: months.

    Valid values: 1 to 9, 12, 24, 36, and 60.

    Note When you set the ChargeType parameter to PrePaid, this parameter is valid and required.
    192.168.xx.xx,192.168.xx.xx
    AccountPasswordstringNo

    The network type of the instance. Set the value to VPC.

    123456Aa
    ChargeTypestringNo

    The ID of the VPC.

    Enumeration Value:
    • PrePaid
    • PostPaid
    PrePaid
    PeriodintegerNo

    The ID of the vSwitch to which the instance is connected.

    1
    NetworkTypestringNo

    The ID of the source instance.

    Note When you call this operation to clone an instance, this parameter is required. The BackupId or RestoreTime parameter is also required. When you call this operation to restore an instance from the recycle bin, this parameter is required. The BackupId or RestoreTime parameter is not required.
    Enumeration Value:
    • Classic
    • VPC
    VPC
    VpcIdstringYes

    The ID of the backup set. You can call the DescribeBackups operation to query the backup set ID.

    Note When you call this operation to clone an instance based on the backup set, this parameter is required. The SrcDBInstanceId parameter is also required.
    vpc-bp175iuvg8nxqraf2****
    VSwitchIdstringYes

    The point in time to which the instance is restored, which must be within seven days. The time is displayed in the yyyy-MM-ddTHH:mm:ssZ format (UTC time).

    Note When you call this operation to restore an instance to the specified time, this parameter is required. The SrcDBInstanceId parameter is also required.
    vsw-bp1gzt31twhlo0sa5****
    SrcDBInstanceIdstringNo

    The business information. This is an additional parameter.

    dds-bp1ee12ad351****
    BackupIdstringNo

    Specifies whether to enable auto-renewal for the instance. Default value: false. Valid values:

    • true: The instance is automatically renewed.
    • false: The instance is manually renewed.
    Note This parameter is valid and optional when the ChargeType parameter is set to PrePaid.
    32994****
    RestoreTimestringNo

    The name of the database.

    Note When you call this operation to clone an instance, you can set this parameter to specify the database to clone. Otherwise, all databases of the instance are cloned.
    2022-03-13T12:11:14Z
    BusinessInfostringNo

    The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.

    {“ActivityId":"000000000"}
    AutoRenewstringNo

    The storage engine of the instance. Default value: WiredTiger. Valid values:

    • WiredTiger
    • RocksDB
    • TerarkDB
    Note
  • When you call this operation to clone an instance or restore an instance from the recycle bin, set the value of this parameter to the storage engine of the source instance.
  • For more information about the limits on database versions and storage engines, see MongoDB versions and storage engines.
  • true
    DatabaseNamesstringNo

    The number of nodes in the replica set instance. Default value: 3. Valid values:

    • 3
    • 5
    • 7
    mongodbtest
    CouponNostringNo

    The number of read-only nodes in the replica set instance. Default value: 0. Valid values: 0 to 5.

    youhuiquan_promotion_option_id_for_blank
    StorageEnginestringNo

    The ID of the resource group to which the instance belongs.

    Enumeration Value:
    • WiredTiger
    • RocksDB
    WiredTiger
    ReplicationFactorstringNo

    The ID of the dedicated cluster to which the instance belongs.

    3
    ReadonlyReplicasstringNo

    The storage type of the instance. Valid values:

    • cloud_essd1 :ESSD PL1.
    • cloud_essd2: ESSD PL2.
    • cloud_essd3: ESSD PL3.
    • local_ssd: local SSD.
    0
    ResourceGroupIdstringNo

    The zone where the secondary node resides for multi-zone deployment. Valid values:

    • cn-hangzhou-g: Hangzhou Zone G.
    • cn-hangzhou-h: Hangzhou Zone H.
    • cn-hangzhou-i: Hangzhou Zone I.
    • cn-hongkong-b: Hongkong Zone B.
    • cn-hongkong-c: Hongkong Zone C.
    • cn-hongkong-d: Hongkong Zone D.
    • cn-wulanchabu-a: Ulanqab Zone A.
    • cn-wulanchabu-b: Ulanqab Zone B.
    • cn-wulanchabu-c: Ulanqab Zone C.
    • ap-southeast-1a: Singapore Zone A.
    • ap-southeast-1b: Singapore Zone B.
    • ap-southeast-1c: Singapore Zone C.
    • ap-southeast-5a: Jakarta Zone A.
    • ap-southeast-5b: Jakarta Zone B.
    • ap-southeast-5c: Jakarta Zone C.
    • eu-central-1a: Frankfurt Zone A.
    • eu-central-1b: Frankfurt Zone B.
    • eu-central-1c: Frankfurt Zone C.
    Note
  • This parameter is valid and required when the EngineVersion parameter is set to 4.4 or 5.0.
  • The value of this parameter cannot be the same as the value of the ZoneId or HiddenZoneId parameter.
  • rg-acfmyiu4ekp****
    ClusterIdstringNo

    cn

    dhg-2x78****
    StorageTypestringNo

    The zone where the hidden node resides for multi-zone deployment. Valid values:

    • cn-hangzhou-g: Hangzhou Zone G.
    • cn-hangzhou-h: Hangzhou Zone H.
    • cn-hangzhou-i: Hangzhou Zone I.
    • cn-hongkong-b: Hongkong Zone B.
    • cn-hongkong-c: Hongkong Zone C.
    • cn-hongkong-d: Hongkong Zone D.
    • cn-wulanchabu-a: Ulanqab Zone A.
    • cn-wulanchabu-b: Ulanqab Zone B.
    • cn-wulanchabu-c: Ulanqab Zone C.
    • ap-southeast-1a: Singapore Zone A.
    • ap-southeast-1b: Singapore Zone B.
    • ap-southeast-1c: Singapore Zone C.
    • ap-southeast-5a: Jakarta Zone A.
    • ap-southeast-5b: Jakarta Zone B.
    • ap-southeast-5c: Jakarta Zone C.
    • eu-central-1a: Frankfurt Zone A.
    • eu-central-1b: Frankfurt Zone B.
    • eu-central-1c: Frankfurt Zone C.
    Note
  • This parameter is valid and required when the EngineVersion parameter is set to 4.4 or 5.0.
  • The value of this parameter cannot be the same as the value of the ZoneId or SecondaryZoneId parameter.
  • cloud_essd1
    SecondaryZoneIdstringNo

    cn

    cn-hangzhou-h
    HiddenZoneIdstringNo

    Template for global IP whitelist of the instance, multiple IP whitelist templates should be separated by a comma (,) in English and cannot be repeated. (In function gray scale).

    cn-hangzhou-i
    GlobalSecurityGroupIdsstringNo

    The ID of the request.

    g-qxieqf40xjst1ngpr3jz

    Response parameters

    ParameterTypeDescriptionExample
    object
    RequestIdstring

    The ID of the instance.

    D8F1D721-6439-4257-A89C-F1E8E9C9****
    DBInstanceIdstring

    data.dbInstanceId

    dds-bp144a7f2db8****
    OrderIdstring

    The ID of the order.

    21077576248****

    Examples

    Sample success responses

    JSONformat

    {
      "RequestId": "D8F1D721-6439-4257-A89C-F1E8E9C9****",
      "DBInstanceId": "dds-bp144a7f2db8****",
      "OrderId": "21077576248****"
    }

    Error codes

    HTTP status codeError codeError messageDescription
    400SecurityRisk.AuthVerificationwe have detected a risk with your default payment method. An email and notification has been sent to you. Please re-submit your order before after verificaiton.-
    400MissingParameterPeriod is mandatory for this action.-
    400ORDER.ACCOUNT_INFORMATION_INCOMPLETEYour information is incomplete. Complete your information before ordering.-
    400InvalidClientToken.MalformedSpecified parameter ClientToken is not valid.-
    400InvalidDBInstanceDescription.MalformedSpecified parameter DBInstanceDescription is not valid.Invalid node name.
    400InvalidSecurityIPListLength.MalformedThe quota of security ip exceeds.-
    400InsufficientBalanceYour account does not have enough balance.The payment failed. Please add another payment method. You can also top up or add funds to your account.
    400QuotaExceed.AfterpayInstanceLiving afterpay instances quota exceeded.-
    400InvalidCapacity.NotFoundThe Capacity provided does not exist in our records.The specified storage capacity is invalid. Specify a storage capacity within a valid range. Unit: MB.
    400ResourceNotAvailableResource you requested is not available for finance user.-
    400IdempotentParameterMismatchRequest uses a client token in a previous request but is not identical to that request.The specified ClientToken parameter is already in use. Specify a client token that has not been used. The ClientToken value is generated by the client and must be unique among different requests. The value can be up to 64 ASCII characters in length and cannot contain non-ASCII characters.
    400InvalidSecurityIPList.MalformedThe specified parameter "SecurityIPList" is not valid.-
    400InvalidSecurityIPList.DuplicateThe Security IP address is not in the available range or occupied.-
    400InvalidSecurityIPListLength.MalformedThe quota of security ip exceeds.-
    400InvalidDBInstanceStorage.ValueNotSupportedThe specified parameter DBInstanceStorage is not valid.-
    400InvalidAccountPassword.MalformedSpecified parameter AccountPassword is not valid.-
    400TokenServiceErrorDuplicate ClientToken request.-
    400Zone.ClosedThe specified zone is closed.-
    400PRICE.ORIGIN_PRICE_ERRORThe origin price error.-
    400NO_AVAILABLE_PAYMENT_METHODNo payment method is specified for your account. We recommend that you add a payment method.-
    400InvalidEcsImage.NotFoundSpecified ecs image does not exist.-
    400SaleValidateNoSpecificCodeFailedSpecified Storage or Version or InstanceClass is invalid.-
    400Trade_Not_Support_Async_PayTrade not support async pay.-
    403RealNameAuthenticationErrorYour account has not passed the real-name authentication yet.Real-name verification has not been completed for the Alibaba Cloud account. Complete real-name verification and try again.
    403RegionUnauthorizedThere is no authority to create instance in the specified region.-
    403OperationDeniedThe resource is out of usage.-
    403InvalidEngineVersionInRegion.NotAvailableThe EngineVersion in the Region is not available.-
    403InvalidBackupLogStatusCurrent backup log enable status does not support this operation.-
    403IncorrectBackupSetStateCurrent backup set state does not support operations.The latest backup set is not ready. Please try again later.
    404InvalidBackup.NotFoundThe available backup does not exist in recovery time.-

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    2023-11-03The error codes of the API operation change.see changesets
    Change itemChange content
    Error CodesThe error codes of the API operation change.
      delete Error Codes: 400
      delete Error Codes: 403
      delete Error Codes: 404
    2023-08-24The error codes of the API operation change.,The input parameters of the API operation change.see changesets
    Change itemChange content
    Error CodesThe error codes of the API operation change.
      delete Error Codes: 400
      delete Error Codes: 403
      delete Error Codes: 404
    Input ParametersThe input parameters of the API operation change.
      Added Input Parameters: ProvisionedIops
    2023-08-01The error codes of the API operation change.,The input parameters of the API operation change.see changesets
    Change itemChange content
    Error CodesThe error codes of the API operation change.
      delete Error Codes: 400
      delete Error Codes: 403
      delete Error Codes: 404
    Input ParametersThe input parameters of the API operation change.
      Added Input Parameters: Tag
    2023-06-05The error codes of the API operation change.,The input parameters of the API operation change.see changesets
    Change itemChange content
    Error CodesThe error codes of the API operation change.
      delete Error Codes: 400
      delete Error Codes: 403
      delete Error Codes: 404
    Input ParametersThe input parameters of the API operation change.
      Added Input Parameters: Encrypted
      Added Input Parameters: EncryptionKey