全部產品
Search
文件中心

:ListInstances - 擷取執行個體列表

更新時間:Jul 28, 2025

查詢指定地區下,一個或多個執行個體的詳細資料。

介面說明

通過此介面可查看指定地區下一個或多個執行個體的詳細資料,包括伺服器名稱、公網 IP 位址,內網 IP 位址,伺服器建立時間、伺服器到期時間等資訊。

調試

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

調試

授權資訊

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

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

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

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

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

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

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

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

操作

存取層級

資源類型

條件關鍵字

關聯操作

swas-open:ListInstances

get

Instance

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

*Instance

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

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

Simple Application Server所屬的地區 ID。

cn-hangzhou

InstanceIds

string

Simple Application Server的執行個體 ID。取值可以由多個執行個體 ID 組成一個 JSON 數組,最多支援 100 個 ID,ID 之間用半形逗號(,)隔開。

說明

同時指定InstanceIdsPublicIpAddresses參數時,必須保證對應的執行個體 ID 和公網 IP 屬於同一台Simple Application Server,否則傳回值為空白。

["2ad1ae67295445f598017499dc****", "2ad1ae67295445f598017123dc****"]

ChargeType

string

執行個體的計費方式。取值:PrePaid,目前僅支援訂用帳戶。

預設值:PrePaid

PrePaid

PublicIpAddresses

string

Simple Application Server的公網 IP。取值可以由多個公網 ID 組成一個 JSON 數組,最多支援 100 個 ID,ID 之間用半形逗號(,)隔開。

說明

同時指定InstanceIdsPublicIpAddresses參數時,必須保證對應的執行個體 ID 和公網 IP 屬於同一台Simple Application Server,否則傳回值為空白。

["42.1.**.**", "42.2.**.**"]

PageNumber

integer

Simple Application Server列表的頁碼。

預設值:1

1

PageSize

integer

分頁查詢時設定的每頁行數。最大值:100

預設值:10

10

Status

string

執行個體狀態,可能值:

  • Pending:準備中。

  • Starting:啟動中。

  • Running:運行中。

  • Stopping:停止中。

  • Stopped:停止。

  • Resetting:重設中。

  • Upgrading:升級中。

  • Disabled:不可用。

Running

Tag

array<object>

執行個體的標籤列表。

object

標籤。

Key

string

執行個體的標籤鍵。標籤鍵長度的取值範圍:1~64。N 的取值範圍:1~20。

TestKey

Value

string

執行個體的標籤值。標籤值長度的取值範圍:1~64。N 的取值範圍:1~20。

TestValue

ResourceGroupId

string

Simple Application Server所屬的資源群組 ID。

rg-aek2bti7cf7****

InstanceName

string

Simple Application Server執行個體名稱,支援使用萬用字元*進行模糊搜尋。

*test,test*,*test*

PlanType

string

套餐類型,可能值:

  • NORMAL:通用型。

  • CAPACITY:容量型。

  • PREVIOUS:上一代。

  • MULTI_IP:多公網 IP 型。

  • INTERNATIONAL:國際型。

說明

更多資訊,請參見執行個體規格類型系列

NORMAL

返回參數

名稱

類型

描述

樣本值

object

執行個體資訊。

Instances

array<object>

Simple Application Server資訊組成的數組。

object

Simple Application Server資訊組成的數組。

Status

string

執行個體狀態,可能值:

  • Pending:準備中。

  • Starting:啟動中。

  • Running:運行中。

  • Stopping:停止中。

  • Stopped:停止。

  • Resetting:重設中。

  • Upgrading:升級中。

  • Disabled:不可用。

Running

CreationTime

string

建立時間。按照ISO 8601標準表示,並使用 UTC+0 時間,格式為 yyyy-MM-ddTHH:mm:ssZ。

2021-03-08T05:31:06Z

InnerIpAddress

string

內網 IP 位址。

172.26.XX.XX

ChargeType

string

計費方式。

PrePaid

InstanceId

string

執行個體 ID。

2ad1ae67295445f598017499dc****

PlanId

string

套餐 ID。

swas.s2.c2m2s50b4t08

PublicIpAddress

string

公網 IP 位址。

42.1.XX.XX

RegionId

string

地區 ID。

cn-hangzhou

ExpiredTime

string

到期時間。按照ISO 8601標準表示,並使用 UTC+0 時間,格式為 yyyy-MM-ddTHH:mm:ssZ。

2021-05-08T16:00:00Z

InstanceName

string

伺服器名稱。

test-InstanceName

BusinessStatus

string

伺服器狀態。可能值:

  • Normal:正常。

  • Expired:到期。

  • Overdue:欠費。

Normal

DdosStatus

string

DDos 狀態。可能值:

  • Normal:正常。

  • BlackHole:黑洞中。

  • Defense:清洗中。

Normal

ImageId

string

鏡像 ID。

fe9c66133a9d4688872869726b52****

DisableReason

string

資源被禁用的原因。取值範圍:

  • FINANCIAL:因欠費被鎖定。

  • SECURITY:因安全原因被鎖定。

  • EXPIRED:執行個體到期。

EXPIRED

Combination

boolean

是否為組合套餐。

false

CombinationInstanceId

string

組合套餐執行個體 ID。

com-f6c9a22****45b5b8de68ad608af1ba

Uuid

string

執行個體的 UUID。

41f30524-5df7-49c9-9c6e-32****489001

ResourceSpec

object

資源規格。

DiskCategory

string

磁碟類型,可能值:

  • ESSD:ESSD 雲端硬碟,效能層級 PL0。

  • SSD:SSD 雲端硬碟。

  • CLOUD_EFFICIENCY:高效雲端硬碟。

ESSD

Cpu

integer

vCPU 核心數。

2

Bandwidth

integer

頻寬大小,單位:Mbps。

200

DiskSize

integer

磁碟大小,單位:GiB。

60

Memory

number

記憶體大小,單位:GiB。

2

Flow

number

流量大小。

  • 流量為 0 代錶帶寬型主機。

  • 非 0 代表流量包型主機。

818

Image

object

鏡像的說明資訊。

OsType

string

作業系統類型。

windows

ImageName

string

鏡像名稱。

test-custom-1686536882356

ImageVersion

string

鏡像版本。

V3.5

ImageType

string

鏡像類型。取值範圍:

  • system:系統鏡像。

  • app:應用鏡像。

  • custom:自訂鏡像。

system

ImageIconUrl

string

鏡像表徵圖 URL。

https://img.alicdn.com/imgextra/i3/O****1vdh9651ReKqWNMI2I_!!6000000002136****-24-24.svg

ImageContact

string

鏡像供應商。

https://selfs****e.console.aliyun.com/ticket/createIndex

Tags

array<object>

執行個體的標籤列表。

object

標籤。

Key

string

執行個體的標籤鍵。

TestKey

Value

string

執行個體的標籤值。

TestValue

Disks

array<object>

輕量對應磁碟資訊的數組。

object

磁碟資訊。

CreationTime

string

執行個體建立時間。按照ISO 8601標準表示,並使用 UTC+0 時間,格式為 yyyy-MM-ddTHH:mm:ssZ。

2023-02-24T02:20:10Z

Status

string

磁碟狀態。可能值:

  • ReIniting:初始化中。

  • Creating:建立中。

  • In_use:使用中。

  • Available:待掛載。

  • Attaching:掛載中。

  • Detaching:卸載中。

In_use

Device

string

磁碟掛載伺服器中的裝置名稱。

/dev/xvda

Size

integer

磁碟大小。單位:GiB。

50

DiskName

string

磁碟名稱。

SystemDisk

DiskChargeType

string

磁碟的計費方式。

PrePaid

DiskType

string

磁碟類型。可能值:

  • system:系統硬碟。

  • data:資料盤。

system

Category

string

磁碟類型,可能值:

  • ESSD:ESSD 雲端硬碟,效能層級 PL0。

  • SSD:SSD 雲端硬碟。

  • CLOUD_EFFICIENCY:高效雲端硬碟。

ESSD

DiskId

string

磁碟 ID。

d-bp14wq0149cpp2x****

RegionId

string

地區 ID。

cn-hangzhou

Remark

string

磁碟備忘。

remark

DiskTags

array<object>

磁碟的標籤資訊。

object

標籤資訊。

Key

string

標籤鍵。

TestKey

Value

string

標籤值。

TestValue

ResourceGroupId

string

磁碟所屬的資源群組 ID。

rg-aek2bti7cf7****

ResourceGroupId

string

執行個體所屬的資源群組 ID。

rg-aekz7jmhg5s****

NetworkAttributes

array<object>

網路返回資訊。

object

網路返回資訊。

PublicIpAddress

string

公網 IP 位址。

116.62.XX.XX

PrivateIpAddress

string

私網 IP 位址。

72.25.XX.XX

PeakBandwidth

integer

公網峰值頻寬。單位為 Mbps。

200

PublicIpDdosStatus

string

公網 IP 的 DDos 狀態。

normal

PlanType

string

套餐類型,可能值:

  • NORMAL:通用型。

  • CAPACITY:容量型。

  • PREVIOUS:上一代。

  • MULTI_IP:多公網 IP 型。

  • INTERNATIONAL:國際型。

說明

更多資訊,請參見執行個體規格類型系列

NORMAL

TotalCount

integer

查詢到的執行個體總數。

1

RequestId

string

請求 ID。

20758A-585D-4A41-A9B2-28DA8F4F****

PageSize

integer

分頁查詢時設定的每頁行數。

10

PageNumber

integer

Simple Application Server列表的頁碼。

1

樣本

正常返回樣本

JSON格式

{
  "Instances": [
    {
      "Status": "Running",
      "CreationTime": "2021-03-08T05:31:06Z",
      "InnerIpAddress": "172.26.XX.XX",
      "ChargeType": "PrePaid",
      "InstanceId": "2ad1ae67295445f598017499dc****",
      "PlanId": "swas.s2.c2m2s50b4t08",
      "PublicIpAddress": "42.1.XX.XX",
      "RegionId": "cn-hangzhou",
      "ExpiredTime": "2021-05-08T16:00:00Z",
      "InstanceName": "test-InstanceName",
      "BusinessStatus": "Normal",
      "DdosStatus": "Normal",
      "ImageId": "fe9c66133a9d4688872869726b52****",
      "DisableReason": "EXPIRED",
      "Combination": false,
      "CombinationInstanceId": "com-f6c9a22****45b5b8de68ad608af1ba",
      "Uuid": "41f30524-5df7-49c9-9c6e-32****489001",
      "ResourceSpec": {
        "DiskCategory": "ESSD",
        "Cpu": 2,
        "Bandwidth": 200,
        "DiskSize": 60,
        "Memory": 2,
        "Flow": 818
      },
      "Image": {
        "OsType": "windows",
        "ImageName": "test-custom-1686536882356",
        "ImageVersion": "V3.5",
        "ImageType": "system",
        "ImageIconUrl": "https://img.alicdn.com/imgextra/i3/O****1vdh9651ReKqWNMI2I_!!6000000002136****-24-24.svg",
        "ImageContact": "https://selfs****e.console.aliyun.com/ticket/createIndex"
      },
      "Tags": [
        {
          "Key": "TestKey",
          "Value": "TestValue"
        }
      ],
      "Disks": [
        {
          "CreationTime": "2023-02-24T02:20:10Z",
          "Status": "In_use",
          "Device": "/dev/xvda",
          "Size": 50,
          "DiskName": "SystemDisk",
          "DiskChargeType": "PrePaid",
          "DiskType": "system",
          "Category": "ESSD",
          "DiskId": "d-bp14wq0149cpp2x****",
          "RegionId": "cn-hangzhou",
          "Remark": "remark",
          "DiskTags": [
            {
              "Key": "TestKey",
              "Value": "TestValue"
            }
          ],
          "ResourceGroupId": "rg-aek2bti7cf7****\n"
        }
      ],
      "ResourceGroupId": "rg-aekz7jmhg5s****",
      "NetworkAttributes": [
        {
          "PublicIpAddress": "116.62.XX.XX",
          "PrivateIpAddress": "72.25.XX.XX",
          "PeakBandwidth": 200,
          "PublicIpDdosStatus": "normal"
        }
      ],
      "PlanType": "NORMAL"
    }
  ],
  "TotalCount": 1,
  "RequestId": "20758A-585D-4A41-A9B2-28DA8F4F****",
  "PageSize": 10,
  "PageNumber": 1
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidChargeType.ValueNotSupported The specified parameter ChargeType is invalid. 指定的執行個體計費方式不合法。
400 InvalidPublicIpAddresses.ValueNotSupported The specified parameter PublicIpAddresses is invalid. 指定的公網IP不合法。
500 InternalError An error occurred while processing your request. 內部錯誤,請重試。如果多次嘗試失敗,請提交工單。
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. 指定的執行個體不存在,請您檢查執行個體ID是否正確。

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

變更歷史

更多資訊,參考變更詳情