Queries a list of DSW instances.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
paidsw:ListInstances |
get |
*All Resource
|
None | None |
Request syntax
GET /api/v2/instances HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| WorkspaceId |
string |
No |
Filters by workspace ID. For information about how to obtain the workspace ID, see ListWorkspaces. |
40823 |
| InstanceName |
string |
No |
The instance name. If specified, instances are searched by name using fuzzy match with case insensitivity. Default value: empty. |
training_data |
| ResourceId |
string |
No |
Filters by resource quota ID. For information about how to obtain the resource quota ID, see ListQuotas. |
ALL |
| Status |
string |
No |
Filters by instance status. Default value: empty, which queries instances in all states. Valid values:
|
Running |
| PaymentType |
string |
No |
Filters by payment type (subscription or pay-as-you-go). Default value: empty, which queries instances of all payment types. Valid values:
|
PayAsYouGo |
| Accessibility |
string |
No |
Filters by workspace visibility of the instance. Default value: empty, which queries instances of all visibility types. Valid values: |
PRIVATE |
| AcceleratorType |
string |
No |
Filters by accelerator type of the instance. Default value: empty, which queries instances of all accelerator types. Valid values: Valid values:
|
CPU |
| PageNumber |
integer |
No |
The page number for paging query of instances. Minimum value: 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of instances returned per page in a paging query. Default value: 10. |
10 |
| SortBy |
string |
No |
The field used for sorting. Valid values:
|
GmtCreateTime |
| Order |
string |
No |
The sort order. Valid values: DESC and ASC. Default value: DESC. Valid values:
|
DESC |
| InstanceId |
string |
No |
If specified, filters instances by exact instance ID. For information about how to obtain the instance ID, see ListInstances. You can specify multiple IDs separated by commas. |
dsw-730xxxxxxxxxx |
| Labels |
object |
No |
If specified, filters instances by labels. A maximum of four label groups are supported, and multiple label groups are combined using AND conditions. |
{ "key1": "value1", "key2": "value2", "key3": "value3" } |
| CreateUserId |
string |
No |
If specified, filters instances by the creator user ID. |
12345*****67890 |
| GpuType |
string |
No |
If specified, filters instances by GPU model. |
NVIDIA A10 |
| MinCpu |
string |
No |
The minimum number of CPUs, in units of 0.001 CPU. A value of 1000 indicates 1 CPU. If specified, only instances with a CPU count greater than the specified value are returned. |
2000 |
| MaxCpu |
string |
No |
The maximum number of CPUs, in units of 0.001 CPU. A value of 1000 indicates 1 CPU. If specified, only instances with a CPU count less than the specified value are returned. |
30000 |
| MinGpu |
string |
No |
The minimum number of GPUs, in units of 0.001 GPU. A value of 1000 indicates 1 GPU. If specified, only instances with a GPU count greater than the specified value are returned. |
100 |
| MaxGpu |
string |
No |
The maximum number of GPUs, in units of 0.001 GPU. A value of 1000 indicates 1 GPU. If specified, only instances with a GPU count less than the specified value are returned. |
8000 |
| MinMemory |
string |
No |
The minimum memory size in GB. If specified, only instances with memory greater than the specified value are returned. |
4 |
| MaxMemory |
string |
No |
The maximum memory size in GB. If specified, only instances with memory less than the specified value are returned. |
48 |
| MinGpuMemory |
string |
No |
The minimum GPU memory per card in GB. If specified, only instances with GPU memory greater than the specified value are returned. |
8 |
| MaxGpuMemory |
string |
No |
The maximum GPU memory per card in GB. If specified, only instances with GPU memory less than the specified value are returned. |
16 |
| ImageName |
string |
No |
The image name. If specified, filters instances by the image name used by the instance. |
modelscope:1.9.4-pytorch2.0.1tensorflow2.13.0-cpu-py38-ubuntu20.04 |
| Tag |
array<object> |
No |
The list of tags. If specified, filters instances by tags. A maximum of four tag groups are supported, and multiple tag groups are combined using AND conditions. |
|
|
object |
No |
The tag information. |
||
| Key |
string |
No |
The tag key. |
tag1 |
| Value |
string |
No |
The tag value. |
value1 |
| OversoldInfo |
string |
No |
The idle resource type actually used by the instance. If specified, filters instances by the idle resource type actually in use. Valid values: |
ForceQuotaOverSold |
| OversoldType |
string |
No |
The idle resource type specified by the user. If specified, filters instances by the idle resource type. Valid values: |
AcceptQuotaOverSold |
| CreateTimeAfter |
string |
No |
If specified, only instances created at or after this time are returned. |
2024-01-12T14:36:01Z |
| CreateTimeBefore |
string |
No |
If specified, only instances created at or before this time are returned. |
2024-01-12T15:36:01Z |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The instance list. |
||
| RequestId |
string |
The request ID. |
E7D55162-4489-1619-AAF5-3F97D5FCA948 |
| Success |
boolean |
The success flag. Valid values: |
true |
| Message |
string |
The returned message. |
"XXX" |
| Code |
string |
The status code. Valid values: |
null |
| HttpStatusCode |
integer |
The HTTP status code. Valid values: |
null |
| TotalCount |
integer |
The total number of instances. |
35 |
| Instances |
array<object> |
The list of instances in the current page. |
|
|
array<object> |
The instance object. |
||
| WorkspaceId |
string |
The workspace ID. |
40823 |
| WorkspaceName |
string |
The workspace name. |
training_data |
| InstanceId |
string |
The instance ID. |
dsw-730xxxxxxxxxx |
| InstanceName |
string |
The instance name. |
training_data |
| EcsSpec |
string |
The ECS instance type of the instance. |
ecs.c6.large |
| Status |
string |
The instance status. You can specify multiple Status values separated by commas to filter by multiple statuses. |
Running |
| InstanceUrl |
string |
The instance 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 |
The terminal URL. |
https://dsw-gateway-cn-shanghai.aliyun.com/dsw-39772/tty/ |
| AccumulatedRunningTimeInMs |
integer |
The accumulated running time, in milliseconds. |
3600000 |
| ImageId |
string |
The image ID. |
image-05cefd0be2exxxx |
| ImageUrl |
string |
The image URL. |
registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu |
| ImageName |
string |
The image name. |
py36_cpu_tf1.12_ubuntu |
| GmtCreateTime |
string |
The time when the instance was created. |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
The time when the instance was last modified. |
2021-01-12T14:36:01Z |
| UserId |
string |
The user ID. |
1612285282502324 |
| UserName |
string |
The username. |
TestUser |
| Datasets |
array<object> |
The dataset collection. |
|
|
object |
The dataset object. |
||
| DatasetId |
string |
The dataset ID. |
d-vsqjvsjp4orp5l206u |
| DatasetVersion |
string |
The dataset version. |
v1 |
| Uri |
string |
The URI of the specified dataset. |
oss://bucket-name.oss-cn-shanghai-internal.aliyuncs.com/data/path/ |
| MountPath |
string |
The mount path inside the container. |
/mnt/data |
| MountAccess |
string |
The read and write permission. RW: read/write. RO: read-only. Valid values:
|
RW |
| Options |
string |
The mount properties of the dataset. |
{ "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 |
The mount configuration type. |
FastReadWrite |
| Dynamic |
boolean |
Specifies whether dynamic mounting is enabled. Default value: false. |
false |
| RoleArn |
string |
||
| UserVpc |
object |
The user VPC configuration. |
|
| VpcId |
string |
VPC ID。 |
vpc-xxxxx |
| VSwitchId |
string |
The vSwitch ID. |
vsw-xxxxx |
| SecurityGroupId |
string |
The security group ID. |
sg-xxxxxx |
| ExtendedCIDRs |
array |
The list of extended CIDR blocks. |
["192.168.0.1/24", "192.168.1.1/24"] |
|
string |
The extended CIDR block. |
192.168.0.1/24 |
|
| DefaultRoute |
string |
Default Route |
eth0 | eth1 |
| ForwardInfos |
array |
The port forwarding information. |
|
| ForwardInfoResponse |
The list of port forwarding information. |
||
| BandwidthLimit |
BandwidthLimit |
||
| Ip |
string |
||
| InstanceShutdownTimer |
object |
The scheduled shutdown task. |
|
| InstanceId |
string |
The instance ID. |
dsw-730xxxxxxxxxx |
| GmtCreateTime |
string |
The creation time. |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
The modification time. |
2021-01-12T14:36:01Z |
| DueTime |
string |
The scheduled shutdown time. |
2021-01-12T14:36:01Z |
| RemainingTimeInMs |
integer |
The remaining time until shutdown, in milliseconds. |
3600000 |
| ReasonCode |
string |
The instance error code. |
Internal Error |
| ReasonMessage |
string |
The instance error reason. |
ImagePullBackOff |
| PaymentType |
string |
The payment type. Valid values: |
PayAsYouGo |
| LatestSnapshot |
object |
The latest saved user image. |
|
| ImageId |
string |
The image ID. |
image-05cefd0be2exxxx |
| ImageName |
string |
The image name. |
py36_cpu_tf1.12_ubuntu |
| ImageUrl |
string |
The image URL. |
registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu |
| RepositoryUrl |
string |
The image repository URL. |
https://cr.console.alibabacloud.com/repository/cn-hangzhou/zouxu/kf/images |
| GmtCreateTime |
string |
The snapshot creation time. |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
The snapshot modification time. |
2021-01-12T14:36:01Z |
| ReasonCode |
string |
The snapshot error code. |
Internal Error |
| ReasonMessage |
string |
The snapshot error message. |
ImagePullBackOff |
| Status |
string |
The snapshot status. |
Pushing |
| AcceleratorType |
string |
The instance compute type. Valid values: |
CPU |
| Accessibility |
string |
Indicates whether the instance is visible to others in the workspace. Valid values: |
PRIVATE |
| EnvironmentVariables |
object |
The environment variables. |
{userName: "Chris"} |
|
string |
The user-specified environment variable. After the DSW instance starts, the specified environment variable is injected into the container. |
MAAS |
|
| ResourceId |
string |
The resource ID. This parameter is required for subscription instances. |
dsw-123456789 |
| ResourceName |
string |
The resource specification. |
resource_group |
| Priority |
integer |
The priority for resource allocation. Instances with higher priority are allocated resources first. |
1 |
| RequestedResource |
object |
The resource configuration. |
{"CPU":"4","Memory":"8Gi","SharedMemory":"4Gi","GPU":"1","GPUType":"Tesla-V100-16G"} |
| CPU |
string |
The number of CPU cores. |
32 |
| Memory |
string |
The memory size. |
32 |
| SharedMemory |
string |
The shared memory size. |
32 |
| GPU |
string |
The number of GPUs. |
4 |
| GPUType |
string |
The GPU type. |
NVIDIA A10 |
| Labels |
array<object> |
The user-defined labels. |
{'foo': 'bar'} |
|
object |
The user-defined label. |
||
| Key |
string |
The user-defined label key. |
stsTokenOwner |
| Value |
string |
The user-defined label value. |
123xxxxxxxx |
| IdleInstanceCuller |
object |
The idle instance shutdown rule. |
{"InstanceId":"dsw-05cefd0be2e5a278","CpuPercentThreshold":20,"GpuPercentThreshold":10,"MaxIdleTimeInMinutes":120,"IdleTimeInMinutes":30} |
| InstanceId |
string |
The instance ID. |
dsw-730xxxxxxxxxx |
| CpuPercentThreshold |
integer |
The CPU usage threshold as a percentage. Valid values: 1 to 100. The instance is considered idle if the CPU usage falls below this value. |
20 |
| GpuPercentThreshold |
integer |
The GPU usage threshold as a percentage. Valid values: 1 to 100. This parameter takes effect only for GPU instances. The instance is considered idle when both CPU and GPU usage fall below their respective thresholds. |
10 |
| MaxIdleTimeInMinutes |
integer |
The maximum idle time threshold, in minutes. If the idle duration exceeds this value, the DSW instance is automatically stopped. |
60 |
| IdleTimeInMinutes |
integer |
The current idle duration of the instance, in minutes. |
30 |
| InstanceSnapshotList |
array<object> |
The instance snapshot list. |
[] |
|
object |
The instance snapshot. |
||
| ImageId |
string |
The image ID. |
image-05cefd0be2exxxx |
| ImageName |
string |
The image name. |
py36_cpu_tf1.12_ubuntu |
| ImageUrl |
string |
The image URL. |
registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu |
| RepositoryUrl |
string |
The image repository URL. |
https://cr.console.alibabacloud.com/repository/cn-hangzhou/zouxu/kf/images |
| GmtCreateTime |
string |
The snapshot creation time. |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
The snapshot modification time. |
2021-01-12T14:36:01Z |
| ReasonCode |
string |
The snapshot error code. |
Internal Error |
| ReasonMessage |
string |
The snapshot error message. |
ImagePullBackOff |
| Status |
string |
The snapshot status. |
Pushing |
| CloudDisks |
array<object> |
The list of cloud disks attached to the instance. |
[] |
|
object |
|||
| Capacity |
string |
The cloud disk capacity. |
30Gi |
| SubType |
string |
The cloud disk usage type. rootfs indicates the cloud disk is mounted as rootfs. |
rootfs |
| MountPath |
string |
The cloud disk mount path inside the container. |
/mmt/workspace |
| Path |
string |
The directory path on the cloud disk that is mounted. |
/workspace |
| WorkspaceSource |
string |
The storage that the workspace points to. If not specified, NAS, CloudDisk, or local disk is used in sequence. |
d-123456789 |
| Driver |
string |
The NVIDIA driver configuration. |
535.54.03 |
| CredentialConfig | CredentialConfig |
The credential injection configuration. |
|
| Affinity |
object |
The affinity configuration. |
|
| CPU |
object |
The CPU affinity configuration. Only supported for general-purpose subscription instances. |
|
| Enable |
boolean |
Specifies whether CPU affinity is enabled. true: Enabled. false: Disabled. |
true |
| ImageAuth |
string |
The value obtained after Base64 encoding the account and password information for the private image. The password portion is hidden. |
aGFyYm9yYWlAeGltYWxheWE6KioqKioq |
| Tags |
array<object> |
The list of tags. |
|
|
object |
The tag information. |
||
| TagKey |
string |
The tag key. |
tag1 |
| TagValue |
string |
The tag value. |
value1 |
| DynamicMount | DynamicMount |
The dynamic mount configuration. |
|
| OversoldType |
string |
The type of idle-time resources for the instance. |
|
| OversoldInfo |
string |
The information about idle-time resources actually used by the instance. |
|
| ServiceConfig |
ServiceConfig |
The service configuration of the instance, including IDE, Jupyter, and other services. |
|
| TenantId |
string |
||
| UserMetricsEndpoints |
array |
||
| UserMetricsEndpoint | |||
| MigrationOptions |
object |
The instance migration options. |
Examples
Success response
JSON format
{
"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,
"RoleArn": ""
}
],
"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": "ssh-rsa AAAAB3****************************\n",
"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"
],
"NlbGatewayId": ""
}
],
"BandwidthLimit": {
"EgressWhitelists": [
""
],
"IngressRate": "",
"EgressRate": "",
"IngressWhitelists": [
""
]
},
"Ip": ""
},
"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": "S",
"AccessKeyId": "LT********",
"SecurityToken": "********"
}
}
]
}
]
},
"Affinity": {
"CPU": {
"Enable": true
}
},
"ImageAuth": "aGFyYm9yYWlAeGltYWxheWE6KioqKioq",
"Tags": [
{
"TagKey": "tag1",
"TagValue": "value1"
}
],
"DynamicMount": {
"Enable": true,
"MountPoints": [
{
"RootPath": "/mnt/dynamic/",
"Options": "{}"
}
]
},
"OversoldType": "",
"OversoldInfo": "",
"ServiceConfig": {
"JupyterServerPassword": "",
"JupyterServerAuth": "",
"CodeServerPassword": "",
"CodeServerAuth": ""
},
"TenantId": "",
"UserMetricsEndpoints": [
{
"Port": 0,
"Path": ""
}
]
}
],
"MigrationOptions": {
"test": "test",
"test2": 1
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.