GetInstance

更新时间:
复制 MD 格式

Retrieve the details of a DSW instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

paidsw:GetInstance

get

*All Resource

*

None None

Request syntax

GET /api/v2/instances/{InstanceId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID. For information about how to obtain an instance ID, see ListInstances.

dsw-730xxxxxxxxxx

Request parameters

Parameter

Type

Required

Description

Example

Token

string

No

The sharing token.

WUzWCMr325LV0bH2JH4C4HoDaKIU6C4S

Fields

string

No

Response elements

Element

Type

Description

Example

object

The instance details.

WorkspaceId

string

The workspace ID.

40823

WorkspaceName

string

The workspace name.

training_data

InstanceId

string

The instance ID.

dsw-730xxxxxxxxxx

InstanceName

string

The instance name.

training_data

EcsSpec

string

The ECS instance type associated with the DSW instance.

ecs.c6.large

Status

string

The instance status.

Valid values:

  • Creating :

    Creating

  • SaveFailed :

    Image save failed

  • Stopped :

    Stopped

  • Failed :

    Failed

  • ResourceAllocating :

    Allocating resources

  • Stopping :

    Stopping

  • Updating :

    Updating

  • Saving :

    Saving image

  • Queuing :

    Queuing

  • Recovering :

    Recovering instance

  • Starting :

    Creating

  • Running :

    Running

  • Saved :

    Image saved successfully

  • Deleting :

    Deleting

  • EnvPreparing :

    Preparing environment

Running

InstanceUrl

string

The instance URL.

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

JupyterlabUrl

string

The JupyterLab URL.

https://dsw-gateway-cn-shanghai.aliyun.com/dsw-3****/lab/

WebIDEUrl

string

The Web IDE URL.

https://dsw-gateway-cn-shanghai.aliyun.com/dsw-3****/ide/

TerminalUrl

string

The terminal URL.

https://dsw-gateway-cn-shanghai.aliyun.com/dsw-3****/tty/

AccumulatedRunningTimeInMs

integer

The accumulated running time in milliseconds.

3600000

ImageId

string

The image ID.

image-05cefd0be2exxxx

ImageUrl

string

The registry address.

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

ImageName

string

The image name.

py36_cpu_tf1.12_ubuntu

GmtCreateTime

string

The instance creation time.

2021-01-12T14:36:01Z

GmtModifiedTime

string

The instance modification time.

2021-01-12T14:36:01Z

UserId

string

The user ID.

161228528250****

UserName

string

The username.

测试用户

Datasets

array<object>

The dataset collection.

object

A dataset object. The dataset can be of NAS or OSS type. The dataset object attributes include the dataset ID and the mount path inside the container.

DatasetId

string

The dataset ID.

d-vsqjvsjp4orp5l****

DatasetVersion

string

The dataset version.

v1

Uri

string

The dataset URI.

oss://bucket-name.oss-cn-shanghai-internal.aliyuncs.com/data/path/

MountPath

string

The mount path inside the container.

/mnt/data

MountAccess

string

The read and write permission. RW: read and write. RO: read-only.

Valid values:

  • RW :

    RW

  • RO :

    RO

RW

Options

string

The mount options for the specified dataset.

{ "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

The mount type for the specified dataset (deprecated).

FastReadWrite

Dynamic

boolean

Indicates whether dynamic mounting is enabled. Default value: false.

false

ActualMountAccess

string

UserVpc

object

The user VPC configuration.

VpcId

string

The VPC ID.

vpc-xxxxx

VSwitchId

string

The vSwitch ID.

vsw-xxxxx

SecurityGroupId

string

The security group ID.

sg-xxxxxx

ExtendedCIDRs

array

The extended CIDR blocks.

  • If the vSwitch ID is empty, you can omit this parameter. The system automatically obtains all CIDR blocks in the VPC.

  • If the vSwitch ID is not empty, you must specify this parameter. We recommend that you specify all CIDR blocks in the VPC.

["192.168.0.1/24", "192.168.1.1/24"]

string

The extended CIDR block.

"172.16.19.0/24","172.16.2.0/24","172.16.12.0/24"

DefaultRoute

string

Default Route

eth0 | eth1

ForwardInfos

array

The port forwarding information.

ForwardInfoResponse

The list of port forwarding information.

BandwidthLimit

BandwidthLimit

The Internet bandwidth throttling configuration.

Ip

string

InstanceShutdownTimer

object

The scheduled shutdown task.

InstanceId

string

The instance ID.

dsw-730xxxxxxxxxx

GmtCreateTime

string

The creation time.

2021-01-12T14:36:01Z

GmtModifiedTime

string

The modification time.

2021-01-12T14:36:01Z

DueTime

string

The scheduled shutdown time.

2021-01-12T14:36:01Z

RemainingTimeInMs

integer

The remaining shutdown time in milliseconds.

3600000

ReasonCode

string

The error code of the instance.

Internal Error

ReasonMessage

string

The reason for the instance error.

ImagePullBackOff

PaymentType

string

The payment type. Valid values:

  • PayAsYouGo: pay-as-you-go.

  • Subscription: subscription.

PayAsYouGo

LatestSnapshot

object

The latest saved user image.

ImageId

string

The image ID.

image-05cefd0be2exxxx

ImageName

string

The image name.

py36_cpu_tf1.12_ubuntu

ImageUrl

string

The image URL.

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

RepositoryUrl

string

The image repository URL.

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

GmtCreateTime

string

The snapshot creation time.

2021-01-12T14:36:01Z

GmtModifiedTime

string

The snapshot modification time.

2021-01-12T14:36:01Z

ReasonCode

string

The error code of the instance snapshot.

Internal Error

ReasonMessage

string

The error message of the instance snapshot.

ImagePullBackOff

Status

string

The instance snapshot status.

Valid values:

  • Committing :

    Committing

  • Pushing :

    Pushing

  • Failed :

    Save failed

  • Saved :

    Save succeeded

Pushing

AcceleratorType

string

The instance compute type.

Valid values:

  • CPU :

    CPU

  • GPU :

    GPU

CPU

Accessibility

string

Indicates whether the instance is visible to others in the workspace. Valid values:

  • PRIVATE: The instance is visible only to you and administrators in the workspace.

  • PUBLIC: The instance is visible to all users in the workspace.

Valid values:

  • PUBLIC :

    Visible to all users in the workspace

  • PRIVATE :

    Visible only to you and administrators in the workspace

PRIVATE

EnvironmentVariables

object

The environment variables.

{userName: "Chris"}

string

The custom environment variables defined by the user. These variables are injected into the container after the instance starts.

app: MAAS

ResourceId

string

The resource ID. Specify this parameter for subscription instances.

dsw-12345****

ResourceName

string

The instance type.

  • For subscription instances, this parameter specifies the requested CPU and memory size.

  • For pay-as-you-go instances, this parameter specifies the selected ECS instance type.

ecs.g7.xlarge

Priority

integer

The priority. When allocating resources to instances, instances with higher priorities are allocated resources first.

1

RequestedResource

object

The resource configuration. This parameter is used for subscription instances.

{"CPU":"4","Memory":"8Gi","SharedMemory":"4Gi","GPU":"1","GPUType":"Tesla-V100-16G"}

CPU

string

The number of CPU cores.

32

Memory

string

The memory size in GB.

32

SharedMemory

string

The shared memory size in GB.

32

GPU

string

The number of GPUs.

4

GPUType

string

The GPU model. Valid values:

  • V100

  • A100

  • T4

  • A10

  • P100

v100

Labels

array<object>

The custom tags.

{'foo': 'bar'}

object

You can add custom tags to an instance to mark its custom attributes.

Key

string

The custom tag key.

stsTokenOwner

Value

string

The custom tag value.

123xxxxxxxx

IdleInstanceCuller

object

The automatic shutdown settings for idle instances.

{"InstanceId":"dsw-05cefd0be2e5a278","CpuPercentThreshold":20,"GpuPercentThreshold":10,"MaxIdleTimeInMinutes":120,"IdleTimeInMinutes":30}

InstanceId

string

The instance ID.

dsw-730xxxxxxxxxx

CpuPercentThreshold

integer

The CPU utilization threshold. Unit: percentage. Valid values: 1 to 100. If the CPU utilization is lower than this value, the instance is considered idle.

20

GpuPercentThreshold

integer

The GPU utilization threshold. Unit: percentage. Valid values: 1 to 100. This parameter takes effect only for GPU instances. The instance is considered idle only when both CPU and GPU utilizations are below their respective thresholds.

10

MaxIdleTimeInMinutes

integer

The maximum idle wait time in minutes. If the idle duration exceeds this value, the DSW instance is automatically stopped.

60

IdleTimeInMinutes

integer

The current idle duration of the instance in minutes.

30

InstanceSnapshotList

array<object>

The instance snapshot list.

[]

object

An instance snapshot.

ImageId

string

The image ID.

image-05cefd0be2exxxx

ImageName

string

The image name.

py36_cpu_tf1.12_ubuntu

ImageUrl

string

The image URL.

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

RepositoryUrl

string

The image repository URL.

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

GmtCreateTime

string

The snapshot creation time.

2021-01-12T14:36:01Z

GmtModifiedTime

string

The snapshot modification time.

2021-01-12T14:36:01Z

ReasonCode

string

The error code of the instance snapshot.

Internal Error

ReasonMessage

string

The error message of the instance snapshot.

ImagePullBackOff

Status

string

The instance snapshot status.

Pushing

CloudDisks

array<object>

The cloud disk list of the instance.

[]

array<object>

The cloud disk information.

Capacity

string

The cloud disk capacity.

30Gi

SubType

string

The cloud disk usage mode. rootfs is mounted as rootfs.

rootfs

MountPath

string

The mount path of the cloud disk inside the container.

/mmt/workspace

Path

string

The directory path on the cloud disk that is mounted.

/workspace

Status

object

Available

integer

Usage

integer

Capacity

integer

WorkspaceSource

string

The storage referenced by the workspace. If this parameter is not specified, NAS, cloud disk, or local disk is used in sequence.

d-123456789

RequestId

string

The request ID.

E7D55162-4489-1619-AAF5-3F97D5FC****

Success

boolean

The success indicator. Valid values:

  • true

  • false

true

Message

string

The operation result description.

  • If the operation succeeds, null is returned.

  • If the operation fails, the failure reason is returned.

null

Code

string

The status code. Valid values:

  • InternalError: An internal error occurred. All errors except parameter validation errors are classified as internal errors.

  • ValidationError: A parameter validation error occurred.

null

HttpStatusCode

integer

The HTTP status code. Valid values:

  • 400

  • 404

null

Driver

string

The NVIDIA driver configuration.

535.54.03

NodeErrorRecovery

object

The node error recovery configuration.

hasNodeError

boolean

Indicates whether a node error has occurred.

false

enableAutoSwitchOnNodeError

boolean

Indicates whether automatic switchover is enabled when a node error occurs.

true

autoSwitchCountdownSeconds

integer

The countdown time in seconds before automatic switchover.

30

CredentialConfig CredentialConfig

The credential injection configuration.

Affinity

object

The affinity configuration.

CPU

object

The CPU affinity configuration. This parameter is supported only for general computing subscription instances.

Enable

boolean

Indicates whether CPU affinity is enabled.

true: enabled. false: disabled.

true

ImageAuth

string

The Base64-encoded username and password for a private image. The password part is masked.

YWxpeXVuNjUzMzM5MjIwMzoqKioqKio=

Tags

array<object>

The tag list.

object

The resource tags.

TagKey

string

The tag key.

tag1

TagValue

string

The tag value.

value1

DynamicMount DynamicMount

The dynamic mounting configuration.

ProxyPath

string

The proxy path.

dsw-170197/proxy/

UserCommandId

string

The custom command ID. You can call the GetUserCommand operation with this ID to obtain the specific content of the custom command.

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

Examples

Success response

JSON format

{
  "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": false,
    "ContainersLimit": 10,
    "MountAccessConfigPath": "/etc/docker/dockerboard/mount_access.json"
  },
  "TenantId": ""
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.