Help Center/ ModelArts/ API Reference/ Historical APIs/ DevEnviron (Old Version)/ Managing a Development Environment Instance
Updated on 2024-05-30 GMT+08:00

Managing a Development Environment Instance

Function

This API is used to start, restart, queue, cancel queuing of, or stop a notebook instance.

URI

POST /v1/{project_id}/demanager/instances/{instance_id}/action

Table 1 describes the required parameters.
Table 1 Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

instance_id

Yes

String

Instance ID

Request Body

Table 2 describes the request parameters.
Table 2 Parameters

Parameter

Mandatory

Type

Description

action

Yes

String

Operation on a development environment instance. The options are as follows:

  • start
  • stop
  • restart
  • queue
  • dequeue

queue and dequeue operations can be performed only on free resources.

Response Body

Table 3 describes the response parameters.

Table 3 Parameters

Parameter

Type

Description

current_status

String

Current status of an instance

previous_state

String

Previous status of an instance

Sample Request

The following shows how to start instance 6fa459ea-ee8a-3ca4-894e-db77e160355e.

{
    "action": "start"
}

Sample Response

  • Successful response
    {
        "current_status": "STARTING",
        "previous_state": "STOPPED"
    }
  • Failed response
    {
        "error_message": "The instance does not exist.",
        "error_code": "ModelArts.6309"
    }

Status Code

For details about the status code, see Status Code.