CreateInstance - 实例创建服务
创建一个实例资源,会创建一个新购实例资源的订单,并自动支付。不支持ECS和RDS系列产品的创建。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
bss:ModifyInstance |
create |
*全部资源
|
|
无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ProductCode |
string |
是 |
产品代码。可通过接口 QueryProductList 查询产品代码 |
Cdn |
| ProductType |
string |
否 |
产品类型。 |
Cdn |
| SubscriptionType |
string |
是 |
付费类型,取值:
|
Subscription |
| Period |
integer |
否 |
预付费周期。单位为月,按年付费产品请输入 12 的整数倍。 |
12 |
| RenewalStatus |
string |
否 |
自动续费状态,取值:
默认 ManualRenewal。 |
ManualRenewal |
| RenewPeriod |
integer |
否 |
自动续费周期, 单位为月。 说明
当设置 RenewalStatus 为 AutoRenewal 时,必须设置。 |
12 |
| ClientToken |
string |
否 |
客户端幂等参数,服务端会查询是否有相同 ClientToken 的请求,如果有,直接返回上次调用结果。 |
JASIOFKVNVIXXXXXX |
| Logistics |
string |
否 |
本次订单的物流信息地址,一般对实物类订单有效 |
{"cityCode":"330100","cityName":"杭州","contactName":"测试","countryCode":"","districtName":"浦沿街道","email":"**@example.com","mobilePhone":"153564848844","phone":"1234567","provCode":"330000","provName":"浙江省","streetCode":"33010610","streetName":"转塘","zipCode":"0000"} |
| Parameter |
array<object> |
否 |
模块列表 |
|
|
object |
否 |
模块信息 |
||
| Value |
string |
是 |
第 n 个模块属性 value 配置,n 的取值范围为(1~100)。 |
disk |
| Code |
string |
是 |
第 n 个模块属性 code 配置,n 的取值范围为(1~100),如有多个模块属性参数,按照 n=1,2,3…n 的形式拼接多个参数。 |
InstanceType |
| PricingCycle |
integer |
否 |
预付费周期的周期类型
默认值:PricingCycle=2 仅限于部分产品类型使用(ProductType 为 ddos_originpre_public_cn、ddosDip、ddoscoo、ddos_originpre_public_intl、ddosDip_intl、ddoscoo_intl) |
2 |
假设想要通过本 API 创建音视频通信产品应用,完整参数示例如下:
ProductCode=rtc&SubscriptionType=PayAsYouGo&ProductType=&Parameter.1.Code=ServiceType&Parameter.1.Value=universal&Parameter.2.Code=BillType&Parameter.2.Value=PayByCR&Parameter.3.Code=ServiceAreaCn&Parameter.3.Value=true&Parameter.4.Code=ServiceAreaUs&Parameter.4.Value=false
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| Code |
string |
状态码。 |
Success |
| Message |
string |
错误信息。 |
Successful! |
| RequestId |
string |
请求 ID。 |
C880B065-A781-4F19-B6DD-3E0E3B715C64 |
| Success |
boolean |
是否成功。 |
true |
| Data |
object |
返回信息。 |
|
| OrderId |
string |
创建成功的订单 ID。 |
20240xxxx21 |
| InstanceId |
string |
订单对应的实例 ID。 |
OSSBAG-cn-v1hxxxxx23 |
示例
正常返回示例
JSON格式
{
"Code": "Success",
"Message": "Successful!",
"RequestId": "C880B065-A781-4F19-B6DD-3E0E3B715C64",
"Success": true,
"Data": {
"OrderId": "20240xxxx21",
"InstanceId": "OSSBAG-cn-v1hxxxxx23"
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 200 | INSUFFICIENT.AVAILABLE.QUOTA | The account balance is negative. Add funds to the account and try again. | 您的账户可用额度小于0,请先充值后再尝试购买 |
| 400 | InvalidOwner | The specified owner doesn't belong to caller. | 用户身份错误 |
| 400 | ORDER.ACCOUNT_STATUS_ILLEGAL | Please complete your basic personal information first. | |
| 400 | 400 | Failure to check order before create instance. | |
| 400 | ORDER.ACCOUNT_INFORMATION_INCOMPLETE | Your information is incomplete. Complete your information before ordering | |
| 500 | InternalError | The request processing has failed due to some unknown error. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。