全部產品
Search
文件中心

Platform For AI:ListInstances - 查詢執行個體列表

更新時間:Mar 25, 2026

查詢DSW執行個體列表。

調試

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

調試

授權資訊

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

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

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

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

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

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

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

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

操作

存取層級

資源類型

條件關鍵字

關聯操作

paidsw:ListInstances

get

*全部資源

*

請求文法

GET /api/v2/instances HTTP/1.1

請求參數

名稱

類型

必填

描述

樣本值

WorkspaceId

string

按工作空間 ID 過濾。如何擷取工作空間 ID,請參見 ListWorkspaces 。如果需要查詢所有工作空間的執行個體,請填寫 ALL。如果不填寫工作空間 ID,預設使用當前子帳號的“預設工作空間”,如何查看預設工作空間,請參見 GetDefaultWorkspace

40823

InstanceName

string

按執行個體名稱過濾。

training_data

ResourceId

string

按資源群組 ID 過濾,假如為空白,只過濾後付費資源群組的執行個體,填 ALL 會過濾出所有的執行個體。

ALL

Status

string

根據執行個體狀態過濾。

枚舉值:

  • Creating :

    建立中

  • SaveFailed :

    鏡像儲存失敗

  • Stopped :

    已停止

  • Failed :

    失敗

  • ResourceAllocating :

    資源分派中

  • Stopping :

    停止中

  • Updating :

    更新中

  • Saving :

    鏡像儲存中

  • Queuing :

    排隊中

  • Recovering :

    恢複中

  • Starting :

    啟動中

  • Running :

    運行中

  • Saved :

    鏡像儲存成功

  • Deleting :

    刪除中

  • EnvPreparing :

    環境準備中

Running

PaymentType

string

付費類型。

枚舉值:

  • PayAsYouGo :

    後付費(後付費/隨用隨付)

  • Subscription :

    預付費(預付費/訂用帳戶)

PayAsYouGo

Accessibility

string

工作空間可見度。取值如下:

  • PRIVATE(預設值):表示工作空間內自己以及管理員可見。

  • PUBLIC:為工作空間所有使用者可見。

PRIVATE

AcceleratorType

string

加速器類型。

  • CPU:無計算加速,只使用 CPU 計算。

  • GPU:使用 GPU 進行計算加速。

枚舉值:

  • CPU :

    CPU

  • GPU :

    GPU

CPU

PageNumber

integer

執行個體列表的頁碼。起始值為 1,預設為 1。

1

PageSize

integer

分頁查詢時設定的每頁顯示的執行個體數量。

10

SortBy

string

排序欄位。

枚舉值:

  • Priority :

    優先順序

  • GmtCreateTime :

    建立時間

  • GmtModifiedTime :

    修改時間

GmtCreateTime

Order

string

排列順序。

枚舉值:

  • ASC :

    升序

  • DESC :

    降序

DESC

InstanceId

string

按執行個體 ID 過濾。如何擷取執行個體 ID,請參見 ListInstances 。支援以逗號分隔的方式傳入多個 ID 實現多選。

dsw-730xxxxxxxxxx

Labels

object

用於過濾的執行個體標籤,最多支援 4 組標籤。

{ "key1": "value1", "key2": "value2", "key3": "value3" }

CreateUserId

string

建立人的 UserId

12345*****67890

GpuType

string

GPU 型號。

NVIDIA A10

MinCpu

string

最小的 Cpu 數量,單位是 0.001 Cpu,1000 表示 1 個 Cpu。

2000

MaxCpu

string

最大的 Cpu 數量,單位是 0.001 Cpu,1000 表示 1 個 Cpu。

30000

MinGpu

string

最小的 Gpu 數量,單位是 0.001 Gpu,1000 表示 1 個 Gpu。

100

MaxGpu

string

最大的 Gpu 數量,單位是 0.001 Gpu,1000 表示 1 個 Gpu。

8000

MinMemory

string

最小的機器記憶體數,單位是 G。

4

MaxMemory

string

最大的機器記憶體數,單位是 G。

48

MinGpuMemory

string

最小單卡 Gpu 記憶體大小,單位是 G。

8

MaxGpuMemory

string

最大單卡 Gpu 記憶體大小,單位是 G。

16

ImageName

string

鏡像名

modelscope:1.9.4-pytorch2.0.1tensorflow2.13.0-cpu-py38-ubuntu20.04

Tag

array<object>

標籤列表。

object

標籤資訊。

Key

string

標籤 Key。

tag1

Value

string

標籤的值。

value1

OversoldInfo

string

執行個體實際使用的閑時資源類型:

  • ForbiddenQuotaOverSold:使用保障資源

  • ForceQuotaOverSold:使用閑時資源

  • PendingQuotaOverSold:待分配

ForceQuotaOverSold

OversoldType

string

使用者指定的閑時資源類型:

  • ForceQuotaOverSold:只使用閑時資源

  • AcceptQuotaOverSold:可接受閑時資源

  • ForbiddenQuotaOverSold:使用保障資源

AcceptQuotaOverSold

CreateTimeAfter

string

篩選出建立時間晚於(或等於)該時間的執行個體

2024-01-12T14:36:01Z

CreateTimeBefore

string

篩選出建立時間早於(或等於)該時間的執行個體

2024-01-12T15:36:01Z

返回參數

名稱

類型

描述

樣本值

object

執行個體列表。

RequestId

string

請求 ID。

E7D55162-4489-1619-AAF5-3F97D5FCA948

Success

boolean

成功標誌,可能值:

  • true

  • false

true

Message

string

返回結果說明。

"XXX"

Code

string

狀態代碼,可能值:

  • InternalError:內部錯誤(除了參數驗證錯誤外的其他錯誤,目前都歸類到內部錯誤)。

  • ValidationError:參數驗證錯誤。

null

HttpStatusCode

integer

HTTP 狀態代碼,可能值:

  • 400

  • 404

null

TotalCount

integer

執行個體總數。

35

Instances

array<object>

本分頁中請求的執行個體列表。

array<object>

執行個體對象。

WorkspaceId

string

工作空間 ID。

40823

WorkspaceName

string

工作空間名稱。

training_data

InstanceId

string

執行個體 ID。

dsw-730xxxxxxxxxx

InstanceName

string

執行個體名稱。

training_data

EcsSpec

string

執行個體對應的 ECS 規格。

ecs.c6.large

Status

string

執行個體狀態。支援以逗號分隔的方式傳入多個 Status 實現多選。

Running

InstanceUrl

string

執行個體 Url。

https://dsw-cn-shanghai.data.aliyun.com/notebook.htm?instance=39772#/

JupyterlabUrl

string

Jupyterlab Url。

https://dsw-gateway-cn-shanghai.aliyun.com/dsw-39772/lab/

WebIDEUrl

string

Web IDE url。

https://dsw-gateway-cn-shanghai.aliyun.com/dsw-39772/ide/

TerminalUrl

string

終端 url。

https://dsw-gateway-cn-shanghai.aliyun.com/dsw-39772/tty/

AccumulatedRunningTimeInMs

integer

累計已耗用時間,單位為毫秒。

3600000

ImageId

string

鏡像 ID。

image-05cefd0be2exxxx

ImageUrl

string

鏡像地址。

registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu

ImageName

string

鏡像名稱。

py36_cpu_tf1.12_ubuntu

GmtCreateTime

string

執行個體建立時間。

2021-01-12T14:36:01Z

GmtModifiedTime

string

執行個體修改時間。

2021-01-12T14:36:01Z

UserId

string

使用者識別碼。

1612285282502324

UserName

string

使用者名稱稱。

測試使用者

Datasets

array<object>

資料集集合。

object

資料集對象

DatasetId

string

資料集 ID。

d-vsqjvsjp4orp5l206u

DatasetVersion

string

資料集版本。

v1

Uri

string

指定的資料集的 Uri。

oss://bucket-name.oss-cn-shanghai-internal.aliyuncs.com/data/path/

MountPath

string

容器內掛載路徑。

/mnt/data

MountAccess

string

讀寫權限,RW:讀寫,RO:唯讀。

枚舉值:

  • RW :

    讀寫

  • RO :

    唯讀

RW

Options

string

資料集的掛載屬性。

{ "fs.oss.download.thread.concurrency": "10", "fs.oss.upload.thread.concurrency": "10", "fs.jindo.args": "-oattr_timeout=3 -oentry_timeout=0 -onegative_timeout=0 -oauto_cache -ono_symlink" }

OptionType

string

掛載配置項類型

FastReadWrite

Dynamic

boolean

是否開啟動態掛載,預設為 false。

false

UserVpc

object

User VPC 配置。

VpcId

string

VPC ID。

vpc-xxxxx

VSwitchId

string

交換器 ID。

vsw-xxxxx

SecurityGroupId

string

安全性群組 ID。

sg-xxxxxx

ExtendedCIDRs

array

擴充網路打通網段列表

["192.168.0.1/24", "192.168.1.1/24"]

string

擴充網路打通網段

192.168.0.1/24

DefaultRoute

string

Default Route

eth0 | eth1

ForwardInfos

array

連接埠透出資訊。

ForwardInfoResponse

連接埠透出資訊列表。

BandwidthLimit

BandwidthLimit

Ip

string

InstanceShutdownTimer

object

定時關機任務。

InstanceId

string

執行個體 ID。

dsw-730xxxxxxxxxx

GmtCreateTime

string

建立時間。

2021-01-12T14:36:01Z

GmtModifiedTime

string

修改時間。

2021-01-12T14:36:01Z

DueTime

string

設定關機時間。

2021-01-12T14:36:01Z

RemainingTimeInMs

integer

剩餘關機時間,單位為毫秒。

3600000

ReasonCode

string

執行個體錯誤碼。

Internal Error

ReasonMessage

string

執行個體錯誤原因。

ImagePullBackOff

PaymentType

string

支付類型,可能值:

  • PayAsYouGo:後付費(後付費/隨用隨付)。

  • Subscription:預付費(預付費/訂用帳戶)。

PayAsYouGo

LatestSnapshot

object

最新儲存的使用者鏡像。

ImageId

string

鏡像 ID。

image-05cefd0be2exxxx

ImageName

string

鏡像名稱。

py36_cpu_tf1.12_ubuntu

ImageUrl

string

鏡像 Url。

registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu

RepositoryUrl

string

鏡像倉庫 Url。

https://cr.console.alibabacloud.com/repository/cn-hangzhou/zouxu/kf/images

GmtCreateTime

string

快照建立時間。

2021-01-12T14:36:01Z

GmtModifiedTime

string

快照修改時間。

2021-01-12T14:36:01Z

ReasonCode

string

執行個體快照錯誤碼。

Internal Error

ReasonMessage

string

執行個體快照錯誤訊息。

ImagePullBackOff

Status

string

執行個體快照狀態。

Pushing

AcceleratorType

string

執行個體計算類型。可能值:

  • CPU

  • GPU

CPU

Accessibility

string

工作空間內是否他人可見。可能值:

  • PRIVATE(預設值):表示工作空間內自己以及管理員可見。

  • PUBLIC:為工作空間所有使用者可見。

PRIVATE

EnvironmentVariables

object

環境變數。

{userName: "Chris"}

string

使用者指定環境變數。DSW 執行個體啟動後,指定環境變數會被注入到容器中。

MAAS

ResourceId

string

資源 ID,預付費時填寫。

dsw-123456789

ResourceName

string

資源規格。

  • 後付費情境,資源規格為購買的 ECS 規格。

  • 預付費情境,資源規格為請求的 CPU 核心數與記憶體大小。

resource_group

Priority

integer

優先順序,在分配資源給執行個體時,優先順序越高的執行個體越優先。

1

RequestedResource

object

資源配置。

{"CPU":"4","Memory":"8Gi","SharedMemory":"4Gi","GPU":"1","GPUType":"Tesla-V100-16G"}

CPU

string

CPU 核心數。

32

Memory

string

記憶體大小。

32

SharedMemory

string

共用記憶體大小。

32

GPU

string

GPU 數量。

4

GPUType

string

GPU 顯卡類型。

NVIDIA A10

Labels

array<object>

使用者自訂標籤。

{'foo': 'bar'}

object

使用者定義標籤。

Key

string

使用者定義標籤索引值。

stsTokenOwner

Value

string

使用者定義標籤值。

123xxxxxxxx

IdleInstanceCuller

object

執行個體閑置關機規則。

{"InstanceId":"dsw-05cefd0be2e5a278","CpuPercentThreshold":20,"GpuPercentThreshold":10,"MaxIdleTimeInMinutes":120,"IdleTimeInMinutes":30}

InstanceId

string

執行個體 ID。

dsw-730xxxxxxxxxx

CpuPercentThreshold

integer

CPU 使用率閾值,單位是百分比,取值 1~100,低於此值則認為執行個體當前處於閑置。

20

GpuPercentThreshold

integer

GPU 使用率閾值,單位是百分比,取值 1~100。如果執行個體為 GPU 類型,則此參數生效。CPU 和 GPU 同時低於閾值則認為指定執行個體處於閑置。

10

MaxIdleTimeInMinutes

integer

閑置等待時間閾值,單位是分鐘。如果閑置時間長度超過此值,將自動停止 DSW 執行個體。

60

IdleTimeInMinutes

integer

執行個體當前閑置時間長度,單位是分鐘。

30

InstanceSnapshotList

array<object>

執行個體快照列表。

[]

object

執行個體快照。

ImageId

string

鏡像 ID。

image-05cefd0be2exxxx

ImageName

string

鏡像名稱。

py36_cpu_tf1.12_ubuntu

ImageUrl

string

鏡像 Url。

registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu

RepositoryUrl

string

鏡像倉庫 Url。

https://cr.console.alibabacloud.com/repository/cn-hangzhou/zouxu/kf/images

GmtCreateTime

string

快照建立時間。

2021-01-12T14:36:01Z

GmtModifiedTime

string

快照修改時間。

2021-01-12T14:36:01Z

ReasonCode

string

執行個體快照錯誤碼。

Internal Error

ReasonMessage

string

執行個體快照錯誤訊息。

ImagePullBackOff

Status

string

執行個體快照狀態。

Pushing

CloudDisks

array<object>

執行個體的雲端硬碟列表

[]

object

Capacity

string

雲端硬碟容量

30Gi

SubType

string

雲端硬碟使用方式, rootfs 掛載為 rootfs

rootfs

MountPath

string

容器內掛載雲端硬碟路徑

/mmt/workspace

Path

string

雲端硬碟內被掛載目錄路徑

/workspace

WorkspaceSource

string

工作空間指向的儲存,如果不指定,則依次使用 NAS,CloudDisk 或者本地磁碟

d-123456789

Driver

string

NVIDIA 驅動配置

535.54.03

CredentialConfig CredentialConfig

Credential 注入配置。

Affinity

object

親和性配置。

CPU

object

CPU 親和性配置。僅支援通用計算預付費執行個體。

Enable

boolean

是否開啟 CPU 親和性。

true:開啟。 false:不開啟。

true

ImageAuth

string

使用者私人鏡像的帳號密碼資訊 base64 編碼後的值,密碼部分會被隱藏。

aGFyYm9yYWlAeGltYWxheWE6KioqKioq

Tags

array<object>

標籤列表。

object

標籤資訊。

TagKey

string

標籤 Key。

tag1

TagValue

string

標籤值。

value1

DynamicMount DynamicMount

動態掛載配置。

OversoldType

string

執行個體閑時資源的類型。

OversoldInfo

string

執行個體實際使用的閑時資源資訊。

ServiceConfig

ServiceConfig

執行個體的服務(包括 ide、jupyter 等)配置資訊。

MigrationOptions

object

執行個體遷移選項

樣本

正常返回樣本

JSON格式

{
  "RequestId": "E7D55162-4489-1619-AAF5-3F97D5FCA948",
  "Success": true,
  "Message": "\"XXX\"",
  "Code": "null",
  "HttpStatusCode": 0,
  "TotalCount": 35,
  "Instances": [
    {
      "WorkspaceId": "40823",
      "WorkspaceName": "training_data",
      "InstanceId": "dsw-730xxxxxxxxxx",
      "InstanceName": "training_data",
      "EcsSpec": "ecs.c6.large",
      "Status": "Running",
      "InstanceUrl": "https://dsw-cn-shanghai.data.aliyun.com/notebook.htm?instance=39772#/",
      "JupyterlabUrl": "https://dsw-gateway-cn-shanghai.aliyun.com/dsw-39772/lab/",
      "WebIDEUrl": "https://dsw-gateway-cn-shanghai.aliyun.com/dsw-39772/ide/",
      "TerminalUrl": "https://dsw-gateway-cn-shanghai.aliyun.com/dsw-39772/tty/",
      "AccumulatedRunningTimeInMs": 3600000,
      "ImageId": "image-05cefd0be2exxxx",
      "ImageUrl": "registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu",
      "ImageName": "py36_cpu_tf1.12_ubuntu",
      "GmtCreateTime": "2021-01-12T14:36:01Z",
      "GmtModifiedTime": "2021-01-12T14:36:01Z",
      "UserId": "1612285282502324",
      "UserName": "測試使用者",
      "Datasets": [
        {
          "DatasetId": "d-vsqjvsjp4orp5l206u",
          "DatasetVersion": "v1",
          "Uri": "oss://bucket-name.oss-cn-shanghai-internal.aliyuncs.com/data/path/",
          "MountPath": "/mnt/data",
          "MountAccess": "RW",
          "Options": "{\n  \"fs.oss.download.thread.concurrency\": \"10\",\n  \"fs.oss.upload.thread.concurrency\": \"10\",\n  \"fs.jindo.args\": \"-oattr_timeout=3 -oentry_timeout=0 -onegative_timeout=0 -oauto_cache -ono_symlink\"\n}",
          "OptionType": "FastReadWrite",
          "Dynamic": false
        }
      ],
      "UserVpc": {
        "VpcId": "vpc-xxxxx",
        "VSwitchId": "vsw-xxxxx",
        "SecurityGroupId": "sg-xxxxxx",
        "ExtendedCIDRs": [
          "192.168.0.1/24"
        ],
        "DefaultRoute": "eth0 | eth1",
        "ForwardInfos": [
          {
            "Enable": true,
            "ContainerName": "dsw-notebook",
            "ForwardPort": "22",
            "NatGatewayId": "ngw-bp1uewa15k4iy5770****",
            "EipAllocationId": "eip-25877c70gddh****",
            "SSHPublicKey": "",
            "ConnectInfo": {
              "Phase": "Ready",
              "Message": "DNAT and privateZone are both ready.",
              "Intranet": {
                "Endpoint": "dsw-notebook-22-urz3u6cnu0uts7ej9r.dsw-5cc6083084818f60.dsw.pai.alibaba.com",
                "Port": "22"
              },
              "Internet": {
                "Endpoint": "47.111.119.114",
                "Port": "22"
              }
            },
            "Name": "ssh",
            "ExternalPort": "1024",
            "AccessType": [
              "intranet"
            ]
          }
        ],
        "BandwidthLimit": {
          "EgressWhitelists": [
            ""
          ],
          "IngressRate": "",
          "EgressRate": "",
          "IngressWhitelists": [
            ""
          ]
        }
      },
      "InstanceShutdownTimer": {
        "InstanceId": "dsw-730xxxxxxxxxx",
        "GmtCreateTime": "2021-01-12T14:36:01Z",
        "GmtModifiedTime": "2021-01-12T14:36:01Z",
        "DueTime": "2021-01-12T14:36:01Z",
        "RemainingTimeInMs": 3600000
      },
      "ReasonCode": "Internal Error",
      "ReasonMessage": "ImagePullBackOff",
      "PaymentType": "PayAsYouGo",
      "LatestSnapshot": {
        "ImageId": "image-05cefd0be2exxxx",
        "ImageName": "py36_cpu_tf1.12_ubuntu",
        "ImageUrl": "registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu",
        "RepositoryUrl": "https://cr.console.alibabacloud.com/repository/cn-hangzhou/zouxu/kf/images",
        "GmtCreateTime": "2021-01-12T14:36:01Z",
        "GmtModifiedTime": "2021-01-12T14:36:01Z",
        "ReasonCode": "Internal Error",
        "ReasonMessage": "ImagePullBackOff",
        "Status": "Pushing"
      },
      "AcceleratorType": "CPU",
      "Accessibility": "PRIVATE",
      "EnvironmentVariables": {
        "key": "MAAS"
      },
      "ResourceId": "dsw-123456789",
      "ResourceName": "resource_group",
      "Priority": 1,
      "RequestedResource": {
        "CPU": "32",
        "Memory": "32",
        "SharedMemory": "32",
        "GPU": "4",
        "GPUType": "NVIDIA A10"
      },
      "Labels": [
        {
          "Key": "stsTokenOwner",
          "Value": "123xxxxxxxx"
        }
      ],
      "IdleInstanceCuller": {
        "InstanceId": "dsw-730xxxxxxxxxx",
        "CpuPercentThreshold": 20,
        "GpuPercentThreshold": 10,
        "MaxIdleTimeInMinutes": 60,
        "IdleTimeInMinutes": 30
      },
      "InstanceSnapshotList": [
        {
          "ImageId": "image-05cefd0be2exxxx",
          "ImageName": "py36_cpu_tf1.12_ubuntu",
          "ImageUrl": "registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu",
          "RepositoryUrl": "https://cr.console.alibabacloud.com/repository/cn-hangzhou/zouxu/kf/images",
          "GmtCreateTime": "2021-01-12T14:36:01Z",
          "GmtModifiedTime": "2021-01-12T14:36:01Z",
          "ReasonCode": "Internal Error",
          "ReasonMessage": "ImagePullBackOff",
          "Status": "Pushing"
        }
      ],
      "CloudDisks": [
        {
          "Capacity": "30Gi",
          "SubType": "rootfs",
          "MountPath": "/mmt/workspace",
          "Path": "/workspace"
        }
      ],
      "WorkspaceSource": "d-123456789",
      "Driver": "535.54.03",
      "CredentialConfig": {
        "Enable": true,
        "AliyunEnvRoleKey": "0",
        "Configs": [
          {
            "Key": "0",
            "Type": "Role",
            "Roles": [
              {
                "RoleArn": "acs:ram::123******:role/****",
                "RoleType": "service",
                "AssumeRoleFor": "123******",
                "Policy": "{}",
                "UserInfo": {
                  "Id": "456******",
                  "Type": "sub",
                  "AccessKeyId": "LT********",
                  "SecurityToken": "********"
                }
              }
            ]
          }
        ]
      },
      "Affinity": {
        "CPU": {
          "Enable": true
        }
      },
      "ImageAuth": "aGFyYm9yYWlAeGltYWxheWE6KioqKioq",
      "Tags": [
        {
          "TagKey": "tag1",
          "TagValue": "value1"
        }
      ],
      "DynamicMount": {
        "Enable": true,
        "MountPoints": [
          {
            "RootPath": "",
            "Options": ""
          }
        ]
      },
      "OversoldType": "",
      "OversoldInfo": ""
    }
  ]
}

錯誤碼

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

變更歷史

更多資訊,參考變更詳情