All Products
Search
Document Center

Expenses and Costs:CreateInstance

更新時間:Feb 08, 2025
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Creates an instance. If you call this operation, an order for a new instance is created and the order is automatically paid for. You cannot create Elastic Compute Service (ECS) instances or ApsaraDB RDS instances by calling the operation.

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.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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
bss:ModifyInstancecreate
*All Resources
*
  • bssapi:ProductCode
  • bssapi:ProductType
none

Request parameters

ParameterTypeRequiredDescriptionExample
ProductCodestringYes

The code of the service to which the instance belongs. You can query the service code by calling the QueryProductList operation or viewing Codes of Alibaba Cloud Services.

rds
ProductTypestringNo

The type of the service.

rds
SubscriptionTypestringYes

The billing method. Valid values:

  • Subscription: the subscription billing method.
  • PayAsYouGo: the pay-as-you-go billing method.
Subscription
PeriodintegerNo

The subscription duration. Unit: month. The value must be an integral multiple of 12.

Note This parameter is required if you create a subscription instance.
12
RenewalStatusstringNo

The renewal method. Valid values:

  • AutoRenewal: The instance is automatically renewed.
  • ManualRenewal: The instance is manually renewed.

Default value: ManualRenewal.

ManualRenewal
RenewPeriodintegerNo

The auto-renewal period. Unit: month.

Note This parameter is required if the RenewalStatus parameter is set to AutoRenewal.
12
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. The server checks whether a request that uses the same client token has been received. If a request that uses the same client token has been received, the server returns the same request result as the previous request.

JASIOFKVNVIXXXXXX
LogisticsstringNo

The logistics address of this order. This parameter is generally valid for physical orders.

{"cityCode":"330100","cityName":"Hangzhou","contactName":"Test","countryCode":"","districtName":"Puyan Street","email":"\*\*@example.com","mobilePhone":"153564848844","phone":"1234567","provCode":"330000","provName":"Zhejiang","streetCode":"33010610","streetName":"Zhuantang","zipCode":"0000"}
Parameterarray<object>No

The details of the modules.

objectNo

The modules.

ValuestringYes

The value property of the Nth module. Value of N: 1 to 100.

disk
CodestringYes

The code property of the Nth module. Value of N: 1 to 100. If multiple module property parameters are involved, concatenate multiple parameters based on the value of N in sequence.

InstanceType
PricingCyclelongNo

The cycle type of the prepaid period

  • PricingCycle=1 indicates that the unit of the prepaid period is in years;
  • PricingCycle=2 indicates that the unit of the prepaid period is in months;
  • PricingCycle=3 indicates that the unit of the prepaid period is in days;
  • Default value: PricingCycle=2

Applicable only to certain product types (ProductType being ddos_originpre_public_cn, ddosDip, ddoscoo, ddos_originpre_public_intl, ddosDip_intl, ddoscoo_intl)

2

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The status code.

Success
Messagestring

The error message returned.

Successful!
RequestIdstring

The ID of the request.

C880B065-A781-4F19-B6DD-3E0E3B715C64
Successboolean

Indicates whether the request was successful.

true
Dataobject

The data returned.

OrderIdstring

The ID of the order that was created.

20240xxxx21
InstanceIdstring

The ID of the instance for which the order was created.

OSSBAG-cn-v1hxxxxx23

Examples

Sample success responses

JSONformat

{
  "Code": "Success",
  "Message": "Successful!",
  "RequestId": "C880B065-A781-4F19-B6DD-3E0E3B715C64",
  "Success": true,
  "Data": {
    "OrderId": "20240xxxx21",
    "InstanceId": "OSSBAG-cn-v1hxxxxx23"
  }
}

Error codes

HTTP status codeError codeError messageDescription
200INSUFFICIENT.AVAILABLE.QUOTAThe account balance is negative. Add funds to the account and try again.Your account balance drops below 0. Top up your account and try again.
400InvalidOwnerThe specified owner doesn't belong to caller.Invalid user identity.
400ORDER.ACCOUNT_STATUS_ILLEGALPlease complete your basic personal information first.-
400400Failure to check order before create instance.-
400ORDER.ACCOUNT_INFORMATION_INCOMPLETEYour information is incomplete. Complete your information before ordering-
500InternalErrorThe request processing has failed due to some unknown error.-

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

Change history

Change timeSummary of changesOperation
2024-12-03The Error code has changed. The request parameters of the API has changedView Change Details
2023-08-22The Error code has changedView Change Details

After the creation is successful, you can use the instance query service to query the created instances.