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 instances by workspace ID. For information about how to obtain the workspace ID, see ListWorkspaces. Default value: empty. If this parameter is left empty, the default workspace of the current RAM user is used. For information about how to view the default workspace, see GetDefaultWorkspace. To query instances across all workspaces, set this parameter to ALL. |
40823 |
| InstanceName |
string |
No |
The instance name. If specified, instances are searched by name using fuzzy match and case-insensitive comparison. Default value: empty. |
training_data |
| ResourceId |
string |
No |
Filters instances by resource quota ID. For information about how to obtain the resource quota ID, see ListQuotas. Default value: empty. If this parameter is left empty, only instances in pay-as-you-go resource groups are returned. Set this parameter to ALL to return all instances. |
ALL |
| Status |
string |
No |
Filters instances by instance status. Default value: empty. If this parameter is left empty, instances in all statuses are returned. Valid values:
|
Running |
| PaymentType |
string |
No |
Filters instances by payment type (subscription or pay-as-you-go). Default value: empty. If this parameter is left empty, instances of all payment types are returned. Valid values:
|
PayAsYouGo |
| Accessibility |
string |
No |
Filters instances by workspace visibility. Default value: empty. If this parameter is left empty, instances of all visibility types are returned. Valid values:
|
PRIVATE |
| AcceleratorType |
string |
No |
Filters instances by accelerator type. Default value: empty. If this parameter is left empty, instances of all accelerator types are returned. 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 by which to sort the results. Valid values:
|
GmtCreateTime |
| Order |
string |
No |
The sort order. Valid values: DESC and ASC. Default value: DESC. Valid values:
|
DESC |
| InstanceId |
string |
No |
Filters instances by instance ID using exact match. For information about how to obtain the instance ID, see ListInstances. You can specify multiple IDs separated by commas. |
dsw-730xxxxxxxxxx |
| Labels |
object |
No |
Filters instances by labels. A maximum of four label groups are supported. Multiple label groups are combined using AND conditions. |
{ "key1": "value1", "key2": "value2", "key3": "value3" } |
| CreateUserId |
string |
No |
Filters instances by the user ID of the creator. |
12345*****67890 |
| GpuType |
string |
No |
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 this 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 this 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 this 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 this value are returned. |
8000 |
| MinMemory |
string |
No |
The minimum memory size in GB. If specified, only instances with memory greater than this value are returned. |
4 |
| MaxMemory |
string |
No |
The maximum memory size in GB. If specified, only instances with memory less than this value are returned. |
48 |
| MinGpuMemory |
string |
No |
The minimum GPU memory per card in GB. If specified, only instances with GPU memory greater than this value are returned. |
8 |
| MaxGpuMemory |
string |
No |
The maximum GPU memory per card in GB. If specified, only instances with GPU memory less than this value are returned. |
16 |
| ImageName |
string |
No |
The image name. If specified, instances are filtered by the name of the image used. |
modelscope:1.9.4-pytorch2.0.1tensorflow2.13.0-cpu-py38-ubuntu20.04 |
| Tag |
array<object> |
No |
The list of tags. If specified, instances are filtered by tags. A maximum of four tag groups are supported. 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, instances are filtered by the idle resource type actually in use. Valid values:
|
ForceQuotaOverSold |
| OversoldType |
string |
No |
The user-specified idle resource type. If specified, instances are filtered 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 |
Indicates whether the request was successful. Valid values:
|
true |
| Message |
string |
The description of the returned result. |
"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 on 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 statuses separated by commas. |
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 instance creation time. |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
The instance modification time. |
2021-01-12T14:36:01Z |
| UserId |
string |
The user ID. |
1612285282502324 |
| UserName |
string |
The username. |
Test user |
| 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 in the container. |
/mnt/data |
| MountAccess |
string |
The read/write permissions. Valid values are Valid values:
|
RW |
| Options |
string |
The mount options for 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 type of the mount configuration item. |
FastReadWrite |
| Dynamic |
boolean |
Specifies whether to enable dynamic mounting. Default value: false. |
false |
| UserVpc |
object |
The user VPC configuration. |
|
| VpcId |
string |
The 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 for network connectivity. |
["192.168.0.1/24", "192.168.1.1/24"] |
|
string |
An extended CIDR block for network connectivity. |
192.168.0.1/24 |
|
| DefaultRoute |
string |
The default route. |
eth0 | eth1 |
| ForwardInfos |
array |
A list of port forwarding rules. |
|
| ForwardInfoResponse |
A port forwarding rule. |
||
| BandwidthLimit |
BandwidthLimit |
||
| Ip |
string |
||
| InstanceShutdownTimer |
object |
The scheduled shutdown task. |
|
| InstanceId |
string |
The instance ID. |
dsw-730xxxxxxxxxx |
| GmtCreateTime |
string |
The time when the task was created. |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
The time when the task was last modified. |
2021-01-12T14:36:01Z |
| DueTime |
string |
The scheduled shutdown time. |
2021-01-12T14:36:01Z |
| RemainingTimeInMs |
integer |
The remaining time before 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 time when the snapshot was created. |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
The time when the snapshot was last modified. |
2021-01-12T14:36:01Z |
| ReasonCode |
string |
The error code for the instance snapshot. |
Internal Error |
| ReasonMessage |
string |
The error message for the instance snapshot. |
ImagePullBackOff |
| Status |
string |
The status of the instance snapshot. |
Pushing |
| AcceleratorType |
string |
The instance compute type. Valid values:
|
CPU |
| Accessibility |
string |
The workspace visibility. Valid values:
|
PRIVATE |
| EnvironmentVariables |
object |
The environment variables. |
{userName: "Chris"} |
|
string |
The user-specified environment variable. After the DSW instance starts, the specified environment variables are injected into the container. |
MAAS |
|
| ResourceId |
string |
The resource ID. Required for subscription instances. |
dsw-123456789 |
| ResourceName |
string |
The resource specification.
|
resource_group |
| Priority |
integer |
The priority. Higher-priority instances 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 size of the shared memory. |
32 |
| GPU |
string |
The number of GPUs. |
4 |
| GPUType |
string |
The GPU card type. |
NVIDIA A10 |
| Labels |
array<object> |
The user-defined labels. |
{'foo': 'bar'} |
|
object |
The user-defined label. |
||
| Key |
string |
The key of the user-defined tag. |
stsTokenOwner |
| Value |
string |
The value of the user-defined tag. |
123xxxxxxxx |
| IdleInstanceCuller |
object |
The idle shutdown rule for the instance. |
{"InstanceId":"dsw-05cefd0be2e5a278","CpuPercentThreshold":20,"GpuPercentThreshold":10,"MaxIdleTimeInMinutes":120,"IdleTimeInMinutes":30} |
| InstanceId |
string |
The instance ID. |
dsw-730xxxxxxxxxx |
| CpuPercentThreshold |
integer |
The CPU utilization threshold, in percent. Valid values: 1 to 100. If the CPU utilization is below this value, the instance is considered idle. |
20 |
| GpuPercentThreshold |
integer |
The GPU utilization threshold, in percent. Valid values: 1 to 100. This setting applies only to GPU instances. An instance is considered idle only when both its CPU and GPU utilization fall below their respective thresholds. |
10 |
| MaxIdleTimeInMinutes |
integer |
The maximum idle time threshold, in minutes. If the idle duration exceeds this value, the system automatically stops the DSW instance. |
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 time when the snapshot was created. |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
The time when the snapshot was last modified. |
2021-01-12T14:36:01Z |
| ReasonCode |
string |
The error code for the instance snapshot. |
Internal Error |
| ReasonMessage |
string |
The error message for the instance snapshot. |
ImagePullBackOff |
| Status |
string |
The status of the instance snapshot. |
Pushing |
| CloudDisks |
array<object> |
The cloud disk list of the instance. |
[] |
|
object |
|||
| Capacity |
string |
The capacity of the cloud disk. |
30Gi |
| SubType |
string |
The usage of the cloud disk. A value of |
rootfs |
| MountPath |
string |
The mount path of the cloud disk in the container. |
/mmt/workspace |
| Path |
string |
The directory to be mounted in the cloud disk. |
/workspace |
| WorkspaceSource |
string |
The storage source for the workspace. If not specified, NAS, cloud disk, or local disk is used in order. |
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. This parameter is supported only for subscription general-purpose computing instances. |
|
| Enable |
boolean |
Specifies whether to enable CPU affinity. true: Enabled. false: Disabled. |
true |
| ImageAuth |
string |
The value obtained after Base64 encoding of the account and password information for the user's private image, with the password portion masked. |
aGFyYm9yYWlAeGltYWxheWE6KioqKioq |
| Tags |
array<object> |
The tag list. |
|
|
object |
The tag information. |
||
| TagKey |
string |
Tag key. |
tag1 |
| TagValue |
string |
Tag value. |
value1 |
| DynamicMount | DynamicMount |
The dynamic mount configuration. |
|
| OversoldType |
string |
The idle resource type of the instance. |
|
| OversoldInfo |
string |
The idle resource information actually used by the instance. |
|
| ServiceConfig |
ServiceConfig |
The service configuration of the instance, including IDE and Jupyter settings. |
|
| 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": "Test user",
"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": "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.