查询DSW实例列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求语法
GET /api/v2/instances
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
WorkspaceId | string | 否 | 按工作空间ID过滤。如何获取工作空间ID,请参见ListWorkspaces。 | 40823 |
InstanceName | string | 否 | 按实例名称过滤。 | training_data |
ResourceId | string | 否 | 按资源组ID过滤。 | 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 |
返回参数
示例
正常返回示例
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"
}
],
"UserVpc": {
"VpcId": "vpc-xxxxx",
"VSwitchId": "vsw-xxxxx",
"SecurityGroupId": "sg-xxxxxx",
"ExtendedCIDRs": [
""
]
},
"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"
}
]
}
]
}
错误码
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 | ||
---|---|---|---|---|
2023-05-06 | OpenAPI 返回结构发生变更 | |||
| ||||
2022-01-20 | OpenAPI 返回结构发生变更 | |||
| ||||
2022-01-20 | OpenAPI 返回结构发生变更 | |||
|