全部產品
Search
文件中心

Simple Application Server:CreateInstances - 建立執行個體

更新時間:Apr 21, 2026

建立一台或多台訂用帳戶的Simple Application Server執行個體。

介面說明

  • 在調用該介面前,建議您瞭解Simple Application Server的計費資訊。更多資訊,請參見計費項目

說明

如果您的阿里雲帳號有優惠券,則預設會優先使用優惠券支付購買Simple Application Server執行個體的費用。

  • 同一個阿里雲帳號在同一個地區下,購買Simple Application Server的總數量上限為 50 台。

  • 調用該介面建立伺服器時,您需要確保賬戶預設支付方式能夠結清建立伺服器所需的費用,否則會建立失敗。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

swas-open:CreateInstances

create

*Instance

acs:swas-open:{#regionId}:{#accountId}:instance/*

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

地區 ID。您可以調用 ListRegions 查詢可用地區。

cn-hangzhou

ImageId

string

鏡像 ID。您可以調用 ListImages 查詢指定地區下可用的鏡像 ID。

e2c9c365024a44369c9b955a998a****

PlanId

string

套餐 ID。您可以調用 ListPlans 查詢指定地區下的全部套餐資訊。

swas.s1.c1m1s40b3t05

Period

integer

購買資源的時間長度。單位:月。取值範圍:{"1", "3", "6", "12", "24", "36"}

1

AutoRenew

boolean

是否開啟到期自動續約。取值範圍:

  • true:開啟

  • false:不開啟

預設值:false

false

AutoRenewPeriod

integer

自動續約的時間長度,僅當AutoRenew=true時該參數必填。單位:月。取值範圍:{"1", "3", "6", "12", "24", "36"}

3

DataDiskSize

integer

掛載的資料盤容量大小。單位:GB。取值範圍:0~16380,取值必須是 20 的整數倍。

  • 取值為 0 時,表示不掛載資料盤。

  • 如果您選擇的套餐使用的是 SSD 雲端硬碟,則掛載的資料盤容量最小值為 20 GB。

預設值:0

20

Amount

integer

建立Simple Application Server的數量。取值範圍:1~20

預設值:1

1

ChargeType

string

計費方式。取值:PrePaid,目前僅支援訂用帳戶計費方式。

預設值:PrePaid

PrePaid

ClientToken

string

保證請求等冪性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元,且不能超過 64 個字元。更多資訊,請參見如何保證等冪性

123e4567-e89b-12d3-a456-426655440000

返回參數

名稱

類型

描述

樣本值

object

RequestId

string

請求 ID。

30637AD6-D977-4833-A54C-CC89483E1FEE

InstanceIds

array

Simple Application Server的執行個體 ID。

string

Simple Application Server的執行個體 ID。

3a658ca270df4df39f22e289b338****

樣本

正常返回樣本

JSON格式

{
  "RequestId": "30637AD6-D977-4833-A54C-CC89483E1FEE",
  "InstanceIds": [
    "3a658ca270df4df39f22e289b338****"
  ]
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 ExceedAccountQuota The accumulated instance amounts including this order have exceeded the quota of the account.
400 NotEnoughStock The stock is insufficient. 庫存不足。
400 PlatformNotMatch The platform of specified ImageId and PlanId does not match. 指定的套餐和鏡像不匹配。
400 InvalidPeriod.ValueNotSupported The specified parameter Period is invalid. 指定的時間長度不合法。
400 InvalidDataDiskSize.ValueNotSupported The specified parameter DataDiskSize is invalid. 指定的資料盤大小不合法。
400 InvalidAmount.ValueNotSupported The specified parameter Amount is invalid. 指定的執行個體數不合法。
400 InvalidChargeType.ValueNotSupported The specified parameter ChargeType is invalid. 指定的執行個體計費方式不合法。
400 InvalidAutoRenewPeriod.ValueNotSupported The specified parameter AutoRenewPeriod is invalid. 指定的續約時間長度不合法。
400 InvalidPlanIdSize.ValueNotSupported The system disk size in the specified planId does not support the image. 指定的套餐包含的系統硬碟大小不支援當前鏡像。
400 InvalidPlanMemorySize.ValueNotSupported The memory size in the specified planId does not support the image. 指定的套餐記憶體大小不支援當前鏡像。
400 CSS_SYSTEM_ERROR The sales system encountered an error. 售賣系統出現錯誤。
400 SWAS_NOT_ENOUGH_ACTIVITY_STOCK The configuration you selected is sold out in the current region. Please try to select another configuration or region. 您選擇的配置在當前地區已售罄,請嘗試選擇其他配置或者地區。
500 InternalError An error occurred while processing your request. 內部錯誤,請重試。如果多次嘗試失敗,請提交工單。
500 NotEnoughUpgradeStock The upgrade stock is insufficient. 升級庫存不足。
403 PaymentFailed Payment failed. Please check your account balance. 支付失敗,請檢查您的賬戶餘額是否不足。
403 InvalidInstance.UnPaidOrder The specified Instance has an unpaid order. 您有未支付訂單,請支付該類訂單後再重新下單。
403 InvalidParam The specified parameter value is invalid. 參數非法。
404 InvalidImageId.NotFound The specified ImageId does not exist. 指定的鏡像不存在,請您檢查鏡像ID是否正確。
404 InvalidPlanId.NotFound The specified PlanId does not exist. 指定的套餐不存在,請您檢查套餐ID是否正確。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情