Help Center> ModelArts> API Reference> Development Environment> Querying the List of Development Environment Instances

Querying the List of Development Environment Instances

Function

This API is used to query the development environment instances that meet the search criteria.

URI

GET /v1/{project_id}/demanager/instances?de_type={de_type}&provision_type={provision_type}&status={status}&sortby={sortby}&order={order}&offset={offset}&limit={limit}

Table 1 describes the required parameters.
Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Request Body

Table 2 describes the request parameters.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

de_type

Yes

String

Development environment type. Currently, only Notebook is supported. The first letter must be capitalized.

provision_type

No

String

Deployment type. Currently, only Docker is supported.

status

No

String

Instance status. By default, all statuses are returned. Possible values are as follows:

  • CREATE_QUEUING: The instance is queuing for creating free resources.
  • CREATING: The instance is being created.
  • CREATE_FAILED: The instance fails to be created.
  • START_QUEUING: The instance is queuing for starting free resources.
  • READY_TO_START: The free resources are waiting to be started.
  • STARTING: The instance is being started.
  • RESTARTING: The instance is being restarted.
  • START_FAILED: The instance fails to be started.
  • RUNNING: The instance is running.
  • STOPPING: The instance is being stopped.
  • STOPPED: The instance has been stopped.
  • UNAVAILABLE: The instance is unavailable.
  • DELETED: The instance has been deleted.
  • RESIZING: The instance specifications are being changed.
  • RESIZE_FAILED: The instance specifications fail to be changed.

sortby

No

String

Classification standard. The value can be name or creation_timestamp. Default value: name

order

No

String

Sorting mode. The value can be asc or desc. Default value: asc

offset

No

Integer

Start index. Default value: 0

limit

No

Integer

Number of returned result records. The value range is (0, ∞). Default value: 0 which indicates that all results are returned.

workspace_id

No

String

Workspace ID. If no workspace is created, the default value is 0. If a workspace is created and used, use the actual value.

ai_project

No

String

AI project ID

pool_id

No

String

ID of a dedicated resource pool. This parameter can be used to query information about all instances in a dedicated resource pool.

Response Body

Table 3 describes the response parameters.
Table 3 Parameter description

Parameter

Type

Description

total_count

String

Total number of development environments

instances

List

Configuration list. For details, see Table 4.

Table 4 instances parameters

Parameter

Type

Description

id

String

Instance ID

name

String

Instance name

description

String

Instance description

status

String

Instance status

creation_timestamp

String

Time when an instance is created

profile

Object

Configuration information. For details, see Table 5.

flavor

String

Instance flavor

spec

Object

Instance definition. For details about parameters of a notebook instance, see Table 12.

workspace

Object

Workspace. For details, see Table 15.

latest_update_timestamp

String

Time when an instance is modified

flavor_details

Object

Flavor details. See Table 9.

pool

Object

Dedicated resource pool. See Table 10.

ai_project

Object

AI project

error_code

String

Error code. For details, see Error Code.

queuing_info

Object

Queuing information. For details, see Table 16.

user

Object

User information. For details, see Table 17.

Table 5 profile parameters

Parameter

Type

Description

id

String

Configuration ID

name

String

Configuration name

description

String

Configuration description

de_type

String

Development environment type. Currently, only notebook is supported.

provision

Object

Deployment information. For details, see Table 6.

flavor_type

String

Hardware, including CPU, GPU, and Ascend.

Table 6 provision parameters

Parameter

Type

Description

type

String

Deployment type. Currently, only Docker is supported.

spec

Object

Deployment details. For details, see Table 7.

annotations

Object

Label information, which can be extended. By default, this parameter is left blank.

Table 7 spec parameters

Parameter

Type

Description

engine

String

Deployment engine. Currently, only CCE is supported.

params

Object

Deployment parameters. Currently, only Docker is supported. For details, see Table 8.

Table 8 Docker deployment parameters

Parameter

Type

Description

namespace

String

SWR organization name, which is globally unique

image_name

String

Image name

image_tag

String

Image tag

annotations

Object

Label information, which can be extended. By default, this parameter is left blank.

Table 9 flavor_details parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Flavor name

status

Yes

String

Flavor sale status The options are as follows:

  • onSale
  • soldOut

queuing_num

No

Integer

This parameter is mandatory when promo_type is set to Free and status is set to soldOut.

queue_left_time

No

Integer

Left queuing time, in seconds

This parameter is mandatory when promo_type is set to Free and status is set to soldOut.

storage_list

No

List< storageType >

Supported storage type. The options are obs, evs, and efs.

is_permitted

No

String

Whether the current user has the permission to use this flavor

type

Yes

String

Flavor status. The options are as follows:

  • GPU
  • CPU
  • ASCEND

params

Yes

Dict

Parameters that describing flavor

promo_type

No

String

Promotion type. Possible values are as follows:

  • Free
  • NoDiscount

instance_num

No

Integer

Number of instances of this flavor the current created

duration

No

Integer

Auto stop time after startup, in seconds

store_time

No

Integer

Maximum retention period of an inactive instance of this flavor in the database, in hours

The default value is -1, indicating that the instance can be permanently saved.

billing_flavor

No

String

Billing specifications. If this field is left blank, the specifications name is used for billing.

billing_params

No

Integer

Billing ratio This parameter is mandatory when billing_flavor is specified.

Table 10 pool parameters

Parameter

Mandatory

Type

Description

id

Yes

String

ID of a resource pool

name

No

String

Name of a resource pool

type

No

String

Type of a resource pool. USER_DEFINED indicates a dedicated resource pool.

owner

No

Dict

This parameter is mandatory when type is set to USER_DEFINED. For details, see Table 11.

Table 11 owner parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Table 12 notebook parameters

Parameter

Type

Description

storage

Object

Storage path

auto_stop

Object

Auto stop parameter. For details, see Table 14.

annotations

Object

Annotations

The generated URL cannot be directly accessed.

failed_reasons

Object

Cause for creation or startup failures. See Table 13.

extend_params

Dict

Extended parameter

Table 13 failed_reasons parameters

Parameter

Type

Description

code

String

Error code

message

String

Error message

detail

Dict

Error details

Table 14 auto_stop parameters

Parameter

Type

Description

enable

Boolean

Whether to enable the auto stop function

duration

Integer

Running duration, in seconds

prompt

Boolean

Whether to display a prompt again. This parameter is provided for the console to use.

stop_timestamp

Integer

Time when the instance stops. The value is a 13-digit timestamp.

remain_time

Integer

Remaining time before actual stop, in seconds

Table 15 workspace parameters

Parameter

Type

Description

id

String

Workspace ID

Table 16 queuing_info parameters

Parameter

Mandatory

Type

Description

id

Yes

String

Instance ID

name

No

String

Instance name

de_type

No

String

Development environment type. By default, all types are returned.

Currently, only the notebook is supported.

flavor

No

String

Instance flavor. By default, all types are returned. Currently, the options are as follows:

  • modelarts.vm.cpu.free
  • modelarts.vm.gpu.free

flavor_details

No

Object

Flavor details, which display the flavor information and whether the flavor is sold out For details, see Table 9.

status

Yes

String

Instance status. By default, all statuses are returned, including:

  • CREATE_QUEUING
  • START_QUEUING

begin_timestamp

Yes

Integer

Time when an instance starts queuing. The value is a 13-digit timestamp.

remain_time

Yes

Integer

Left queuing time, in seconds

end_timestamp

No

Integer

Time when an instance completes queuing. The value is a 13-digit timestamp.

rank

Yes

Integer

Ranking of an instance in a queue

Table 17 user parameters

Parameter

Type

Description

id

String

User ID

name

String

Username

Samples

The following shows how to query the list of Notebook development environments.

  • Sample request
    GET https://endpoint/v1/{project_id}/demanager/instances?de_type=Notebook
  • Successful sample response
    {
        "instances": [
            {
                "ai_project": {
                    "id": "default-ai-project"
                },
                "creation_timestamp": "1594887749962",
                "description": "",
                "flavor": "modelarts.bm.gpu.v100NV32",
                "flavor_details": {
                    "name": "modelarts.bm.gpu.v100NV32",
                    "params": {
                        "CPU": 8,
                        "GPU": 1,
                        "gpu_type": "v100NV32",
                        "memory": "64GiB"
                    },
                    "status": "onSale",
                    "type": "GPU"
                },
                "id": "DE-7d558ef8-c73d-11ea-964c-0255ac100033",
                "latest_update_timestamp": "1594887749962",
                "name": "notebook-c6fd",
                "profile": {
                    "de_type": "Notebook",
                    "description": "multi engine, gpu, python 3.6 for notebook",
                    "flavor_type": "GPU",
                    "id": "Python3-gpu",
                    "name": "Python3",
                    "provision": {
                        "annotations": {
                            "category": "Multi-Engine (Recommend)",
                            "flavor": "modelarts.vm.gpu.p100",
                            "type": "system"
                        },
                        "spec": {
                            "engine": "CCE",
                            "params": {
                                "annotations": null,
                                "image_name": "mul-kernel-gpu-cuda-cp36",
                                "image_tag": "2.0.5-B003",
                                "namespace": "atelier"
                            }
                        },
                        "type": "Docker"
                    }
                },
                "spec": {
                    "annotations": {
                        "target_domain": "https://modelarts-notebook-2.cn-north-4.myhuaweicloud.com",
                        "url": "https://modelarts-lvs-common-lb.cn-north-4.myhuaweicloud.com:32000/modelarts/cn-north-4/hubv100/notebook/user/DE-7d558ef8-c73d-11ea-964c-0255ac100033"
                    },
                    "auto_stop": {
                        "duration": 3600,
                        "enable": true,
                        "prompt": true,
                        "remain_time": 3450,
                        "stop_timestamp": 1594891408723
                    },
                    "extend_params": null,
                    "failed_reasons": null,
                    "repository": null,
                    "storage": {
                        "location": {
                            "path": "/home/ma-user/work",
                            "volume_size": 5,
                            "volume_unit": "GB"
                        },
                        "type": "evs"
                    }
                },
                "status": "RUNNING",
                "user": {
                    "id": "15dda26361214ca2a5953917d2f48ffb",
                    "name": "ops_dev_env"
                },
                "workspace": {
                    "id": "0"
                }
            },
            {
                "ai_project": {
                    "id": "default-ai-project"
                },
                "creation_timestamp": "1594883877728",
                "description": "",
                "flavor": "modelarts.vm.cpu.2u",
                "flavor_details": {
                    "name": "modelarts.vm.cpu.2u",
                    "params": {
                        "CPU": 2,
                        "GPU": 0,
                        "memory": "8GiB"
                    },
                    "status": "onSale",
                    "type": "CPU"
                },
                "id": "DE-7936a360-c734-11ea-a72b-0255ac100033",
                "latest_update_timestamp": "1594883877728",
                "name": "notebook-b1b8",
                "profile": {
                    "de_type": "Notebook",
                    "description": "multi engine, cpu, python 3.6 for notebook",
                    "flavor_type": "CPU",
                    "id": "Python3",
                    "name": "Python3",
                    "provision": {
                        "annotations": {
                            "category": "Multi-Engine (Recommend)",
                            "flavor": "modelarts.vm.cpu.2u",
                            "type": "system"
                        },
                        "spec": {
                            "engine": "CCE",
                            "params": {
                                "annotations": null,
                                "image_name": "mul-kernel-cpu-cp36",
                                "image_tag": "2.0.5-B003",
                                "namespace": "atelier"
                            }
                        },
                        "type": "Docker"
                    }
                },
                "spec": {
                    "annotations": {
                        "target_domain": "https://modelarts-notebook.cn-north-4.myhuaweicloud.com",
                        "url": ""
                    },
                    "auto_stop": {
                        "duration": 3600,
                        "enable": true,
                        "prompt": true
                    },
                    "extend_params": null,
                    "failed_reasons": null,
                    "repository": null,
                    "storage": {
                        "location": {
                            "path": "/home/ma-user/work",
                            "volume_size": 5,
                            "volume_unit": "GB"
                        },
                        "type": "evs"
                    }
                },
                "status": "STOPPED",
                "user": {
                    "id": "15dda26361214ca2a5953917d2f48ffb",
                    "name": "ops_dev_env"
                },
                "workspace": {
                    "id": "0"
                }
            }],
        "total_count": 2
    }

Status Code

For details about the status code, see Status Code.