All Products
Search
Document Center

BSS OpenAPI:CreateInstance

更新時間:Mar 01, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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
bssapi:CreateInstanceWrite
  • 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"}
Parameterobject []No

The details of 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

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
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
2023-08-22The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 500
    Added Error Codes: 200