CreateDrdsInstance - 创建一个实例

更新时间:
复制 MD 格式

创建新实例。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

drds:CreateDrdsInstance

create

*全部资源

*

无 无

请求参数

名称

类型

必填

描述

示例值

Description

string

是

实例描述,需满足如下要求:

  • 不能以 http://或 https://开头。

  • 必须以字母或中文开头,可包含大小写字母、中文、数字、下划线(_)或短划线(-)。

  • 长度为 2~256 个字符。

test

RegionId

string

是

地域 ID。

cn-hangzhou

ZoneId

string

是

可用区 ID。

cn-hangzhou-e

Type

string

是

实例类型,仅支持 PRIVATE,即专享实例。

说明

您也可以传入 1 表示专享实例。

PRIVATE

Quantity

integer

是

创建实例的数量,仅支持传入 1,即一次只能创建一个实例。

1

InstanceSeries

string

是

实例系列参数,取值范围如下:

  • drds.sn2.4c16g:入门版

  • drds.sn2.8c32g:标准版

  • drds.sn2.16c64g:企业版

drds.sn2.4c16g

Specification

string

是

实例规格码,取值由实例系列加具体实例规格组成,例如 drds.sn2.4c16g.8c32g。

drds.sn2.4c16g.8C32g

ClientToken

string

是

用于保证请求的幂等性,防止重复提交请求。由客户端生成该参数值,要保证在不同请求间唯一,最大值不超过 64 个 ASCII 字符,且该参数值中不能包含非 ASCII 字符。

c1dd299c-10c6-11ea-bbbb-************

PayType

string

是

付费类型,取值范围如下:

  • drdsPre:包年包月(也称预付费)。

  • drdsPost:按量付费(也称后付费)。

  • drdsRo:创建只读实例时,默认按量付费模式。

drdsPost

VpcId

string

否

专有网络 ID。

vpc-**********

VswitchId

string

否

虚拟交换机 ID。

vsw-**********

isHa

boolean

否

是否为高可用实例。

true

PricingCycle

string

否

指定预付费实例为包年或包月类型,取值范围如下:

  • year:年

  • month:月

说明

若付费类型为 drdsPre,该参数为必传参数。

month

Duration

integer

否

包年或包月实例的购买时长。

  • 当 PricingCycle 为 year 时,取值范围为 1~3。

  • 当 PricingCycle 为 month 时,取值范围为 1~9。

说明

仅当付费类型是 drdsPre 时该参数生效。

1

IsAutoRenew

boolean

否

是否自动续费,取值范围如下:

  • true:如果按月购买则自动续费一个月,如果按年购买则自动续费一年。

  • false:不自动续费。

说明

仅当付费类型为 drdsPre 时该参数生效。

true

MasterInstId

string

否

主实例 ID,仅在创建只读实例时填写。

drds***********

MySQLVersion

integer

否

实例支持的 MySQL 版本,取值范围如下:

  • 5:与 MySQL 5.x 完全兼容(默认)

  • 8:与 MySQL 8.0 完全兼容

说明

仅当创建主实例时该参数生效,只读实例的 MySQL 版本默认与主实例相同。

5

ResourceGroupId

string

否

资源组 ID。

rg-************

返回参数

名称

类型

描述

示例值

object

Success

boolean

请求是否成功。

true

RequestId

string

请求 ID。

D99D4644-A70D-49A3-B8B4-767ACC50SE2R

Data

object

结果详情。

OrderId

integer

订单 ID。

111111111111111

DrdsInstanceIdList

object

drdsInstanceIdList

array

实例信息。

string

实例 ID。

drds************

示例

正常返回示例

JSON格式

{
  "Success": true,
  "RequestId": "D99D4644-A70D-49A3-B8B4-767ACC50SE2R",
  "Data": {
    "OrderId": 111111111111111,
    "DrdsInstanceIdList": {
      "drdsInstanceIdList": [
        "drds************"
      ]
    }
  }
}

错误码

HTTP status code

错误码

错误信息

描述

400 ParameterError Parameter error
400 ActionUnauthorized The specified action is not available for you
400 ServiceUnable The service is not available now, please try again later
400 OperationDenied drds service is not enable for you
400 QuotaExceeded.DRDSInstance The quota of create instance exceeds.
400 InvalidRegionId.NotFound The RegionId provided does not exist in our records.
400 InvalidDescription.MalFormed The specified parameter description is not valid.
400 CommunicateWithManager.Error Internal Error. Communicate with drds manager error
400 InvalidVSwitchId Invalid vswitchId
400 InvalidVpcId Invalid vpcId, or the region of vpc does not match
400 InvalidZoneId.Mismatch zone is illegal in this order
400 LowInventory.ServerError low inventory error
400 publicInstanceAlreadExist.Error a public Drds instance is exist
400 CreateDRDSInstanceId.Error create Drds instance id error
400 ResourceInsufficient resource is Insufficient
400 AnotherOrderExist.Error there is another order
400 InstanceExceedLimit.Error instance number has exceeded
400 InvalidParameter.Quantity Invalid parameter of quantity
400 InvalidParameter.RegionId Invalid parameter of region id
400 InvalidParameter.ZoneId Invalid parameter of zone id
400 InvalidParameter.PayType Invalid parameter of pay type
400 InvalidParameter.Spection Invalid parameter of specification
400 InvalidParameter.Series Invalid parameter of series
400 InvalidParameter.duration_pricingCycle when payType=drdsPre, duration and pricingCycle is required
400 InvalidParameter.year.duration when pricingCycle=year, duration must between 1 to 3
400 InvalidParameter.month.duration when pricingCycle=month, duration must between 1 to 9
400 InvalidDRDSInstanceType.Error Invalid parameter of Type, public is not supported
400 QueryVSwitchFailed.InvalidVpcIdOrServerError Query VSwitch failed, please check vpcId
400 RegionNotSupportVPC.Error This region does not support vpc instance
400 UserAccountVerify.Failed User account verify failed. Please verify first
500 InternalError The request processing has failed due to some unknown error.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。