首页 机器学习PAI API参考 PAI-DSW API API目录 实例 GetInstance - 查询实例详情

GetInstance - 查询实例详情

查询实例详情。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
InstanceIdstring

实例Id。

dsw-730xxxxxxxxxx

返回参数

名称类型描述示例值
object

实例详情。

RequestIdstring

请求Id。

E7D55162-4489-1619-AAF5-3F97D5FCA948
Successboolean

成功标志,取值如下:

  • true
  • false
true
Messagestring

说明。

"XXX"
Codestring

状态码,取值如下:

  • InternalError:内部错误(除了参数验证错误外的其他错误,目前都归类到内部错误)。
  • ValidationError:参数验证错误。
null
HttpStatusCodeinteger

http状态码,取值如下:

  • 400
  • 404
null
WorkspaceIdstring

工作空间Id。

40823
WorkspaceNamestring

工作空间名称。

training_data
InstanceIdstring

实例Id。

dsw-730xxxxxxxxxx
InstanceNamestring

实例名称。

training_data
EcsSpecstring

实例对应的ECS规格。

ecs.c6.large
Statusstring

实例状态。

Running
InstanceUrlstring

实例Url。

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

Jupyterlab Url。

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

Web IDE url。

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

终端url。

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

累计运行时间(ms)。

3600000
ImageIdstring

镜像Id。

image-05cefd0be2exxxx
ImageUrlstring

镜像地址。

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

镜像名称。

py36_cpu_tf1.12_ubuntu
GmtCreateTimestring

实例创建时间。

2021-01-12T14:36:01Z
GmtModifiedTimestring

实例修改时间。

2021-01-12T14:36:01Z
UserIdstring

用户Id。

1612285282502324
UserNamestring

用户名称。

测试用户
Datasetsarray

数据集集合。

object

数据集对象,数据集可以是NAS或者OSS类型。 数据集对象属性包括数据集ID以及容器内挂载路径

DatasetIdstring

数据集Id。

d-vsqjvsjp4orp5l206u
MountPathstring

容器内挂载路径。

/mnt/data
UserVpcobject

user vpc配置。

VpcIdstring

Vpc Id。

vpc-xxxxx
VSwitchIdstring

交换机Id。

vsw-xxxxx
SecurityGroupIdstring

安全组Id。

sg-xxxxxx
InstanceShutdownTimerobject

定时关机任务。

InstanceIdstring

实例Id。

dsw-730xxxxxxxxxx
GmtCreateTimestring

创建时间。

2021-01-12T14:36:01Z
GmtModifiedTimestring

修改时间。

2021-01-12T14:36:01Z
DueTimestring

设定关机时间。

2021-01-12T14:36:01Z
RemainingTimeInMslong

剩余关机时间(ms)。

3600000
ReasonCodestring

实例错误代码。

Internal Error
ReasonMessagestring

实例错误原因。

ImagePullBackOff
PaymentTypestring

支付类型。

PayAsYouGo
LatestSnapshotobject

最新保存的用户镜像。

ImageIdstring

镜像Id。

image-05cefd0be2exxxx
ImageNamestring

镜像名称。

py36_cpu_tf1.12_ubuntu
ImageUrlstring

镜像Url。

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

镜像仓库Url。

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

快照创建时间。

2021-01-12T14:36:01Z
GmtModifiedTimestring

快照修改时间。

2021-01-12T14:36:01Z
ReasonCodestring

实例快照错误代码

Internal Error
ReasonMessagestring

实例快照错误消息

ImagePullBackOff
Statusstring

实例快照状态

Pushing
AcceleratorTypestring

实例计算类型。

CPU
Accessibilitystring

工作空间内是否他人可见。

PRIVATE
EnvironmentVariablesobject

环境变量。

string

环境变量 用户自定义的环境变量,将会在实例启动后,注入到容器内部。

app: MAAS
ResourceIdstring

资源Id,预付费时填写。

dsw-123456789
ResourceNamestring

实例规格。 预付费(subscription),是请求的CPU和内存大小 后付费(pay-as-you-go),是选择的ECS规格

ecs.g7.xlarge
Prioritylong

优先级,在分配资源给实例时,优先级越高的实例越优先。

1
RequestedResourceobject

资源配置,弹内或者轻量化时使用。

CPUstring

cpu核数。

32
Memorystring

memory大小。

32
SharedMemorystring

shared memory大小。

32
GPUstring

gpu数量。

4
GPUTypestring

gpu显卡类型。

v100
Labelsarray

用户自定义标签。

object

用户自定义标签 用户可以对实例进行自定义打标,标记实例的一些自定义属性

Keystring

用户定义标签键。

stsTokenOwner
Valuestring

用户定义标签值。

123xxxxxxxx
IdleInstanceCullerobject

闲置实例自动关机设置。

InstanceIdstring

实例ID。

dsw-730xxxxxxxxxx
CpuPercentThresholdinteger

CPU使用率阈值,单位是百分比,取值1~100,低于此值则认为实例当前处于闲置。

20
GpuPercentThresholdinteger

GPU使用率阈值,单位是百分比,取值1~100。如果实例为GPU类型,则此参数生效。CPU和GPU同时低于阈值则认为指定实例处于闲置。

10
MaxIdleTimeInMinutesinteger

闲置等待时间阈值,单位是分钟。如果闲置时长超过此值,将自动停止DSW实例。

60
IdleTimeInMinutesinteger

实例当前闲置时长,单位是分钟。

30

示例

正常返回示例

JSON格式

{
  "RequestId": "E7D55162-4489-1619-AAF5-3F97D5FCA948",
  "Success": true,
  "Message": "\"XXX\"",
  "Code": "null",
  "HttpStatusCode": 0,
  "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"
  },
  "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": "app: MAAS"
  },
  "ResourceId": "dsw-123456789",
  "ResourceName": "ecs.g7.xlarge",
  "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"
    }
  ]
}

错误码

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2022-01-20OpenAPI 返回结构发生变更
变更项变更内容
出参OpenAPI 返回结构发生变更
2022-01-20OpenAPI 返回结构发生变更
变更项变更内容
出参OpenAPI 返回结构发生变更
阿里云首页 机器学习PAI 相关技术圈