查询DSW实例详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
paidsw:GetInstance |
get |
*全部资源
|
无 | 无 |
请求语法
GET /api/v2/instances/{InstanceId} HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| InstanceId |
string |
是 |
实例 ID。如何获取实例 ID,请参见 ListInstances 。 |
dsw-730xxxxxxxxxx |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Token |
string |
否 |
分享令牌信息。 |
WUzWCMr325LV0bH2JH4C4HoDaKIU6C4S |
| Fields |
string |
否 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
实例详情。 |
||
| WorkspaceId |
string |
工作空间 ID。 |
40823 |
| WorkspaceName |
string |
工作空间名称。 |
training_data |
| InstanceId |
string |
实例 ID。 |
dsw-730xxxxxxxxxx |
| InstanceName |
string |
实例名称。 |
training_data |
| EcsSpec |
string |
实例对应的 ECS 规格。 |
ecs.c6.large |
| Status |
string |
实例状态。 枚举值:
|
Running |
| InstanceUrl |
string |
实例 Url。 |
https://dsw-cn-shanghai.data.aliyun.com/notebook.htm?instance=3****#/ |
| JupyterlabUrl |
string |
Jupyterlab Url。 |
https://dsw-gateway-cn-shanghai.aliyun.com/dsw-3****/lab/ |
| WebIDEUrl |
string |
Web IDE Url。 |
https://dsw-gateway-cn-shanghai.aliyun.com/dsw-3****/ide/ |
| TerminalUrl |
string |
终端 Url。 |
https://dsw-gateway-cn-shanghai.aliyun.com/dsw-3****/tty/ |
| AccumulatedRunningTimeInMs |
integer |
累计运行时间,单位为毫秒。 |
3600000 |
| ImageId |
string |
镜像 ID。 |
image-05cefd0be2exxxx |
| ImageUrl |
string |
镜像地址。 |
registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu |
| ImageName |
string |
镜像名称。 |
py36_cpu_tf1.12_ubuntu |
| GmtCreateTime |
string |
实例创建时间。 |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
实例修改时间。 |
2021-01-12T14:36:01Z |
| UserId |
string |
用户 ID。 |
161228528250**** |
| UserName |
string |
用户名称。 |
测试用户 |
| Datasets |
array<object> |
数据集集合。 |
|
|
object |
数据集对象,数据集可以是 NAS 或者 OSS 类型。 数据集对象属性包括数据集 ID 以及容器内挂载路径。 |
||
| DatasetId |
string |
数据集 ID。 |
d-vsqjvsjp4orp5l**** |
| DatasetVersion |
string |
数据集版本。 |
v1 |
| Uri |
string |
指定的数据集 Uri。 |
oss://bucket-name.oss-cn-shanghai-internal.aliyuncs.com/data/path/ |
| MountPath |
string |
容器内挂载路径。 |
/mnt/data |
| MountAccess |
string |
读写权限,RW:读写,RO:只读。 枚举值:
|
RW |
| Options |
string |
指定的数据集的挂载属性。 |
{ "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 |
指定的数据集的挂载类型(已废弃)。 |
FastReadWrite |
| Dynamic |
boolean |
是否开启动态挂载,默认为 false。 |
false |
| ActualMountAccess |
string |
||
| UserVpc |
object |
User VPC 配置。 |
|
| VpcId |
string |
VPC ID。 |
vpc-xxxxx |
| VSwitchId |
string |
交换机 ID。 |
vsw-xxxxx |
| SecurityGroupId |
string |
安全组 ID。 |
sg-xxxxxx |
| ExtendedCIDRs |
array |
扩展网段。
|
["192.168.0.1/24", "192.168.1.1/24"] |
|
string |
扩展网段。 |
"172.16.19.0/24","172.16.2.0/24","172.16.12.0/24" |
|
| DefaultRoute |
string |
Default Route |
eth0 | eth1 |
| ForwardInfos |
array |
端口透出信息。 |
|
| ForwardInfoResponse |
端口透出信息列表。 |
||
| BandwidthLimit |
BandwidthLimit |
公网带宽限速配置 |
|
| Ip |
string |
||
| InstanceShutdownTimer |
object |
定时关机任务。 |
|
| InstanceId |
string |
实例 ID。 |
dsw-730xxxxxxxxxx |
| GmtCreateTime |
string |
创建时间。 |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
修改时间。 |
2021-01-12T14:36:01Z |
| DueTime |
string |
设定关机时间。 |
2021-01-12T14:36:01Z |
| RemainingTimeInMs |
integer |
剩余关机时间,单位为毫秒。 |
3600000 |
| ReasonCode |
string |
实例错误代码。 |
Internal Error |
| ReasonMessage |
string |
实例错误原因。 |
ImagePullBackOff |
| PaymentType |
string |
支付类型。可能值:
|
PayAsYouGo |
| LatestSnapshot |
object |
最新保存的用户镜像。 |
|
| ImageId |
string |
镜像 ID。 |
image-05cefd0be2exxxx |
| ImageName |
string |
镜像名称。 |
py36_cpu_tf1.12_ubuntu |
| ImageUrl |
string |
镜像 Url。 |
registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu |
| RepositoryUrl |
string |
镜像仓库 Url。 |
https://cr.console.aliyun.com/repository/cn-hangzhou/zouxu/kf/images |
| GmtCreateTime |
string |
快照创建时间。 |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
快照修改时间。 |
2021-01-12T14:36:01Z |
| ReasonCode |
string |
实例快照错误代码。 |
Internal Error |
| ReasonMessage |
string |
实例快照错误消息。 |
ImagePullBackOff |
| Status |
string |
实例快照状态。 枚举值:
|
Pushing |
| AcceleratorType |
string |
实例计算类型。 枚举值:
|
CPU |
| Accessibility |
string |
工作空间内是否他人可见。可能值:
枚举值:
|
PRIVATE |
| EnvironmentVariables |
object |
环境变量。 |
{userName: "Chris"} |
|
string |
用户自定义的环境变量,将会在实例启动后,注入到容器内部。 |
app: MAAS |
|
| ResourceId |
string |
资源 ID。预付费时填写。 |
dsw-12345**** |
| ResourceName |
string |
实例规格。
|
ecs.g7.xlarge |
| Priority |
integer |
优先级,在分配资源给实例时,优先级越高的实例越优先。 |
1 |
| RequestedResource |
object |
资源配置,预付费场景使用。 |
{"CPU":"4","Memory":"8Gi","SharedMemory":"4Gi","GPU":"1","GPUType":"Tesla-V100-16G"} |
| CPU |
string |
CPU 核数。 |
32 |
| Memory |
string |
内存大小,单位 GB。 |
32 |
| SharedMemory |
string |
共享内存大小,单位 GB。 |
32 |
| GPU |
string |
GPU 数量。 |
4 |
| GPUType |
string |
GPU 显卡类型。可能值:
|
v100 |
| Labels |
array<object> |
用户自定义标签。 |
{'foo': 'bar'} |
|
object |
用户可以对实例进行自定义打标,标记实例的一些自定义属性。 |
||
| Key |
string |
用户定义标签键。 |
stsTokenOwner |
| Value |
string |
用户定义标签值。 |
123xxxxxxxx |
| IdleInstanceCuller |
object |
闲置实例自动关机设置。 |
{"InstanceId":"dsw-05cefd0be2e5a278","CpuPercentThreshold":20,"GpuPercentThreshold":10,"MaxIdleTimeInMinutes":120,"IdleTimeInMinutes":30} |
| InstanceId |
string |
实例 ID。 |
dsw-730xxxxxxxxxx |
| CpuPercentThreshold |
integer |
CPU 使用率阈值,单位是百分比,取值 1~100,低于此值则认为实例当前处于闲置。 |
20 |
| GpuPercentThreshold |
integer |
GPU 使用率阈值,单位是百分比,取值 1~100。如果实例为 GPU 类型,则此参数生效。CPU 和 GPU 同时低于阈值则认为指定实例处于闲置。 |
10 |
| MaxIdleTimeInMinutes |
integer |
闲置等待时间阈值,单位是分钟。如果闲置时长超过此值,将自动停止 DSW 实例。 |
60 |
| IdleTimeInMinutes |
integer |
实例当前闲置时长,单位是分钟。 |
30 |
| InstanceSnapshotList |
array<object> |
实例快照列表。 |
[] |
|
object |
实例快照。 |
||
| ImageId |
string |
镜像 ID。 |
image-05cefd0be2exxxx |
| ImageName |
string |
镜像名称。 |
py36_cpu_tf1.12_ubuntu |
| ImageUrl |
string |
镜像 Url。 |
registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu |
| RepositoryUrl |
string |
镜像仓库 Url。 |
https://cr.console.aliyun.com/repository/cn-hangzhou/zouxu/kf/images |
| GmtCreateTime |
string |
快照创建时间。 |
2021-01-12T14:36:01Z |
| GmtModifiedTime |
string |
快照修改时间。 |
2021-01-12T14:36:01Z |
| ReasonCode |
string |
实例快照错误代码。 |
Internal Error |
| ReasonMessage |
string |
实例快照错误消息。 |
ImagePullBackOff |
| Status |
string |
实例快照状态。 |
Pushing |
| CloudDisks |
array<object> |
实例的云盘列表 |
[] |
|
array<object> |
云盘信息。 |
||
| Capacity |
string |
云盘容量 |
30Gi |
| SubType |
string |
云盘使用方式, rootfs 挂载为 rootfs |
rootfs |
| MountPath |
string |
容器内挂载云盘路径 |
/mmt/workspace |
| Path |
string |
云盘内被挂载目录路径 |
/workspace |
| Status |
object |
||
| Available |
integer |
||
| Usage |
integer |
||
| Capacity |
integer |
||
| WorkspaceSource |
string |
工作空间指向的存储,如果不指定,则依次使用 NAS,CloudDisk 或者本地磁盘 |
d-123456789 |
| RequestId |
string |
请求 ID。 |
E7D55162-4489-1619-AAF5-3F97D5FC**** |
| Success |
boolean |
成功标志,可能值:
|
true |
| Message |
string |
操作结果说明。
|
null |
| Code |
string |
状态码,可能值:
|
null |
| HttpStatusCode |
integer |
HTTP 状态码,可能值:
|
null |
| Driver |
string |
NVIDIA 驱动配置 |
535.54.03 |
| NodeErrorRecovery |
object |
节点错误恢复配置。 |
|
| hasNodeError |
boolean |
是否有节点错误。 |
false |
| enableAutoSwitchOnNodeError |
boolean |
当出现节点错误时,是否开启自动切换。 |
true |
| autoSwitchCountdownSeconds |
integer |
自动切换时等待秒数。 |
30 |
| CredentialConfig | CredentialConfig |
Credential 注入配置。 |
|
| Affinity |
object |
亲和性配置。 |
|
| CPU |
object |
CPU 亲和性配置。仅支持通用计算预付费实例。 |
|
| Enable |
boolean |
是否开启 CPU 亲和性。 true:开启。 false:不开启。 |
true |
| ImageAuth |
string |
用户私有镜像的账号密码信息 base64 编码后的值,密码部分会被隐藏。 |
YWxpeXVuNjUzMzM5MjIwMzoqKioqKio= |
| Tags |
array<object> |
标签列表。 |
|
|
object |
资源标签。 |
||
| TagKey |
string |
标签 Key。 |
tag1 |
| TagValue |
string |
标签值。 |
value1 |
| DynamicMount | DynamicMount |
动态挂载配置。 |
|
| ProxyPath |
string |
Proxy 的路径。 |
dsw-170197/proxy/ |
| UserCommandId |
string |
自定义命令 ID。可根据此 ID 调用 GetUserCommand 接口获取自定义命令具体内容。 |
1900 |
| ServiceConfig |
ServiceConfig |
||
| PodIps |
array |
||
| PodIp | |||
| MigrationOptions |
object |
||
| AccessRestrictionRules |
object |
||
|
string |
|||
| DockerConfig |
object |
||
| Enable |
boolean |
||
| ContainersLimit |
integer |
10 |
|
| MountAccessConfigPath |
string |
/etc/docker/dockerboard/mount_access.json |
|
| TenantId |
string |
示例
正常返回示例
JSON格式
{
"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=3****#/",
"JupyterlabUrl": "https://dsw-gateway-cn-shanghai.aliyun.com/dsw-3****/lab/",
"WebIDEUrl": "https://dsw-gateway-cn-shanghai.aliyun.com/dsw-3****/ide/",
"TerminalUrl": "https://dsw-gateway-cn-shanghai.aliyun.com/dsw-3****/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": "161228528250****",
"UserName": "测试用户",
"Datasets": [
{
"DatasetId": "d-vsqjvsjp4orp5l****",
"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,
"ActualMountAccess": ""
}
],
"UserVpc": {
"VpcId": "vpc-xxxxx",
"VSwitchId": "vsw-xxxxx",
"SecurityGroupId": "sg-xxxxxx",
"ExtendedCIDRs": [
"\"172.16.19.0/24\",\"172.16.2.0/24\",\"172.16.12.0/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.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-12345****",
"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"
}
],
"CloudDisks": [
{
"Capacity": "30Gi",
"SubType": "rootfs",
"MountPath": "/mmt/workspace",
"Path": "/workspace",
"Status": {
"Available": 0,
"Usage": 0,
"Capacity": 0
}
}
],
"WorkspaceSource": "d-123456789",
"RequestId": "E7D55162-4489-1619-AAF5-3F97D5FC****",
"Success": true,
"Message": "null",
"Code": "null",
"HttpStatusCode": 0,
"Driver": "535.54.03",
"NodeErrorRecovery": {
"hasNodeError": false,
"enableAutoSwitchOnNodeError": true,
"autoSwitchCountdownSeconds": 30
},
"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": "YWxpeXVuNjUzMzM5MjIwMzoqKioqKio=",
"Tags": [
{
"TagKey": "tag1",
"TagValue": "value1"
}
],
"DynamicMount": {
"Enable": true,
"MountPoints": [
{
"RootPath": "/mnt/dynamic/",
"Options": "{}"
}
]
},
"ProxyPath": "dsw-170197/proxy/",
"UserCommandId": "1900",
"ServiceConfig": {
"JupyterServerPassword": "",
"JupyterServerAuth": "",
"CodeServerPassword": "",
"CodeServerAuth": ""
},
"PodIps": [
{
"Type": "",
"Ip": "",
"InterfaceName": ""
}
],
"MigrationOptions": {
"test": "test",
"test2": 1
},
"AccessRestrictionRules": {
"key": ""
},
"DockerConfig": {
"Enable": true,
"ContainersLimit": 10,
"MountAccessConfigPath": "/etc/docker/dockerboard/mount_access.json"
},
"TenantId": ""
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。