调用GetInstance,获取指定实例信息。

调试

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

请求语法

GET /api/v1/instances/InstanceId HTTP/1.1
Content-Type:application/json

请求参数

表 1. 请求Path参数
参数名称 类型 是否必选 示例 说明
InstanceId String dsw-cac06e348ceb****

实例ID

响应体语法

HTTP/1.1 200 OK
Content-Type:application/json

{
  "InstanceName" : "String",
  "InstanceId" : "String",
  "RequestId" : "String",
  "EcsSpec" : "String",
  "InstanceStatus" : "String",
  "JupyterlabUrl" : "String",
  "WebIdeUrl" : "String",
  "TerminalUrl" : "String",
  "AccumulativeRunningTimeInMinutes" : Long,
  "ImageId" : "String",
  "ImageUrl" : "String",
  "GmtCreateTime" : "String",
  "GmtModifiedTime" : "String",
  "UserId" : "String",
  "NasFileSystemId" : "String",
  "UserVpc" : {
    "VpcId" : "String",
    "VswitchId" : "String",
    "RoleArn" : "String",
    "SecurityGroupId" : "String"
  },
  "InstanceShutdownTimer" : {
    "InstanceId" : "String",
    "ScheduleTime" : "String",
    "GmtModifiedTime" : "String",
    "GmtCreateTime" : "String"
  }
}

响应参数

表 2. 响应Body参数
参数名称 类型 示例 说明
InstanceName String predicting_price

实例名称

InstanceId String dsw-d7adefa77718bc8e

实例ID

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

请求ID

EcsSpec String ecs.c6.large

ecs规格

InstanceStatus String Running

实例状态

JupyterlabUrl String https://dsw-gateway-cn-beijing.aliyun.com/dsw-****/lab/

jupyterlab(实验室)地址

WebIdeUrl String https://dsw-gateway-cn-beijing.aliyun.com/dsw-****/ide/

web开发环境地址

TerminalUrl String https://dsw-gateway-cn-beijing.aliyun.com/dsw-****/terminals/tty

命令行地址

AccumulativeRunningTimeInMinutes Long 10

实例累计运行时间(分钟)

ImageId String img-d7adefa77718bc8e

实例镜像ID

ImageUrl String registry.cn-shanghai.aliyuncs.com/pai_product/image:pai-images-dsw-ubuntu18.04-py3.6-paitf1.15-build.avx512

实例镜像地址

GmtCreateTime String 2021-04-01T00:00:00Z

实例创建时间

GmtModifiedTime String 2021-04-02T00:00:00Z

实例最后修改时间

UserId String 161228528250****

用户ID

NasFileSystemId String 0051a4bcca

nas文件系统ID

UserVpc UserVpc

被打通VPC配置

InstanceShutdownTimer InstanceShutdownTimer

实例定时关机配置

获取指定实例

GET /api/v1/instances/dsw-cac06e348ceb3edf HTTP/1.1
Host:pai-dsw.aliyuncs.com
Content-Type:application/json

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<InstanceName>predicting_price</InstanceName>
<InstanceId>dsw-d7adefa77718bc8e</InstanceId>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
<EcsSpec>ecs.c6.large</EcsSpec>
<InstanceStatus>Running</InstanceStatus>
<JupyterlabUrl>https://dsw-gateway-cn-beijing.aliyun.com/dsw-****/lab/</JupyterlabUrl>
<WebIdeUrl>https://dsw-gateway-cn-beijing.aliyun.com/dsw-****/ide/</WebIdeUrl>
<TerminalUrl>https://dsw-gateway-cn-beijing.aliyun.com/dsw-****/terminals/tty</TerminalUrl>
<AccumulativeRunningTimeInMinutes>10</AccumulativeRunningTimeInMinutes>
<ImageId>img-d7adefa77718bc8e</ImageId>
<ImageUrl>registry.cn-shanghai.aliyuncs.com/pai_product/image:pai-images-dsw-ubuntu18.04-py3.6-paitf1.15-build.avx512</ImageUrl>
<GmtCreateTime>2021-04-01T00:00:00Z</GmtCreateTime>
<GmtModifiedTime>2021-04-02T00:00:00Z</GmtModifiedTime>
<UserId>161228528250****</UserId>
<NasFileSystemId>0051a4bcca</NasFileSystemId>
<UserVpc>
    <VpcId>vpc-bp1i4x5wj2kgro93lj7z6</VpcId>
    <VswitchId>vsw-bp1irltu139f5qufwxrl4</VswitchId>
    <RoleArn>acs:ram::1234567890123456:role/appserverrole</RoleArn>
    <SecurityGroupId>sg-bp10mttdnsk58y5nlxhh</SecurityGroupId>
</UserVpc>
<InstanceShutdownTimer>
    <InstanceId>dsw-d7adefa77718bc8e</InstanceId>
    <ScheduleTime>2021-04-01T01:00:00Z</ScheduleTime>
    <GmtModifiedTime>2021-04-01T00:00:00Z</GmtModifiedTime>
    <GmtCreateTime>2021-04-01T00:00:00Z</GmtCreateTime>
</InstanceShutdownTimer>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "InstanceName" : "predicting_price",
  "InstanceId" : "dsw-d7adefa77718bc8e",
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "EcsSpec" : "ecs.c6.large",
  "InstanceStatus" : "Running",
  "JupyterlabUrl" : "https://dsw-gateway-cn-beijing.aliyun.com/dsw-****/lab/",
  "WebIdeUrl" : "https://dsw-gateway-cn-beijing.aliyun.com/dsw-****/ide/",
  "TerminalUrl" : "https://dsw-gateway-cn-beijing.aliyun.com/dsw-****/terminals/tty",
  "AccumulativeRunningTimeInMinutes" : 10,
  "ImageId" : "img-d7adefa77718bc8e",
  "ImageUrl" : "registry.cn-shanghai.aliyuncs.com/pai_product/image:pai-images-dsw-ubuntu18.04-py3.6-paitf1.15-build.avx512",
  "GmtCreateTime" : "2021-04-01T00:00:00Z",
  "GmtModifiedTime" : "2021-04-02T00:00:00Z",
  "UserId" : "161228528250****",
  "NasFileSystemId" : "0051a4bcca",
  "UserVpc" : {
    "VpcId" : "vpc-bp1i4x5wj2kgro93lj7z6",
    "VswitchId" : "vsw-bp1irltu139f5qufwxrl4",
    "RoleArn" : "acs:ram::1234567890123456:role/appserverrole",
    "SecurityGroupId" : "sg-bp10mttdnsk58y5nlxhh"
  },
  "InstanceShutdownTimer" : {
    "InstanceId" : "dsw-d7adefa77718bc8e",
    "ScheduleTime" : "2021-04-01T01:00:00Z",
    "GmtModifiedTime" : "2021-04-01T00:00:00Z",
    "GmtCreateTime" : "2021-04-01T00:00:00Z"
  }
}

错误码

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

开发者资源

  • SDK

    阿里云为您提供多种语言的SDK,帮助您快速通过API集成阿里云的产品和服务,推荐您使用SDK调用API,已免除您手动签名验证。

  • OpenAPI Explorer

    快速检索,可视化调试API,在线命令行工具,同步动态生成可执行的SDK代码示例。

  • 阿里云CLI

    阿里云资产管理和配置工具,可通过命令方式同时管理多个阿里云产品和服务,简单快捷,是您上云好帮手。