查询DSW实例列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求语法
GET /api/v2/instances HTTP/1.1
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
WorkspaceId | string | 否 | 按工作空间 ID 过滤。如何获取工作空间 ID,请参见 ListWorkspaces 。 | 40823 |
InstanceName | string | 否 | 按实例名称过滤。 | training_data |
ResourceId | string | 否 | 按资源组 ID 过滤,假如为空,只过滤后付费资源组的实例,填 ALL 会过滤出所有的实例。 | rg-123456789 |
Status | string | 否 | 根据实例状态过滤,取值如下:
| Running |
PaymentType | string | 否 | 付费类型,取值如下:
| PayAsYouGo |
Accessibility | string | 否 | 工作空间可见度。取值如下:
| PRIVATE |
AcceleratorType | string | 否 | 加速器类型。 CPU:无计算加速,只使用 CPU 计算。 GPU:使用 GPU 进行计算加速。 | CPU |
PageNumber | long | 否 | 实例列表的页码。起始值为 1,默认为 1。 | 1 |
PageSize | long | 否 | 分页查询时设置的每页显示的实例数量。 | 10 |
SortBy | string | 否 | 按字段 gmtCreate 排序。 | gmtCreate |
Order | string | 否 | 排列顺序。取值如下:
| DESC |
InstanceId | string | 否 | 按实例 ID 过滤。如何获取实例 ID,请参见 ListInstances 。 | dsw-730xxxxxxxxxx |
Labels | object | 否 | 用于过滤的实例标签,最多支持 4 组标签。 | { "key1": "value1", "key2": "value2", "key3": "value3" } |
CreateUserId | string | 否 | 创建人的 UserId | |
GpuType | string | 否 | Gpu 类型 | |
ImageName | string | 否 | 镜像名 |
返回参数
示例
正常返回示例
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",
"MountPath": "/mnt/data",
"Uri": "oss://bucket-name.oss-cn-shanghai-internal.aliyuncs.com/data/path/",
"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"
}
],
"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",
"Port": "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"
}
}
}
]
},
"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.aliyun.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": "v100"
},
"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.aliyun.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": ""
}
]
}
错误码
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2024-09-10 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2024-08-14 | OpenAPI 入参发生变更 | 查看变更详情 |
2024-07-25 | OpenAPI 入参发生变更 | 查看变更详情 |
2024-07-09 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2024-06-24 | API 内部配置变更,不影响调用 | 查看变更详情 |
2024-06-04 | OpenAPI 入参发生变更、OpenAPI 返回结构发生变更 | 查看变更详情 |
2023-12-27 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2023-11-14 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2023-08-08 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2023-07-25 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2023-06-09 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2023-05-06 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2022-01-20 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2022-01-20 | OpenAPI 返回结构发生变更 | 查看变更详情 |