Help Center/ ModelArts/ API Reference/ DevServer Management/ Performing Operations on DevServer Instances in Batches
Updated on 2025-11-19 GMT+08:00

Performing Operations on DevServer Instances in Batches

Function

This API is used to perform operations on DevServer instances in batches.

Constraints

No constraints.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

POST /v1/{project_id}/dev-servers/action

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Project ID. For details, see Obtaining a Project ID and Name.

Constraints: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed.

Range: N/A

Default Value: N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

type

Yes

String

Definition: Batch operation type.

Constraints: N/A

Range

  • START: DevServer instances are started in batches.

  • STOP: DevServer instances are stopped in batches.

  • REBOOT: DevServer instances are restarted in batches.

  • CHANGEOS: DevServer server OS images are changed in batches.

  • REINSTALLOS: DevServer server OS images are reinstalled in batches.

  • DELETE: DevServer instances are deleted in batches.

Default Value: N/A

servers

Yes

Array of BatchActionDevServerIds objects

Definition: DevServer ID list for batch operations.

extend_param

No

ServerOsRequest object

Definition: Parameters for changing and resetting the OS image of DevServer instances in batches.

Table 3 BatchActionDevServerIds

Parameter

Mandatory

Type

Description

id

Yes

String

Definition: DevServer instance ID.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 4 ServerOsRequest

Parameter

Mandatory

Type

Description

admin_pass

No

String

Definition: Password used for logging in to the server. Note that either admin_pass or key_pair_name must be specified for ECSs and BMSs and supernodes support only key_pair_name.

Constraints: The password must:

  • Contain 8 to 26 characters.

  • Contain at least three of the following types: uppercase letters, lowercase letters, digits, and special characters (!@%-_=+[{}]:,./?).

  • Cannot be the username or the username spelled backwards.

  • Cannot contain root, administrator, or their reverse.

Range: N/A

Default value: N/A

key_pair_name

No

String

Name of the key pair for logging in to the server. Note that either admin_pass or key_pair_name must be specified. This parameter is supported only when ECSs or BMSs are reset or their OSs are changed. Supernodes do not support this parameter.

image_id

No

String

Definition: Image ID. This parameter is mandatory when the OS is changed.

Constraints: N/A

Range: N/A

Default value: N/A

user_data

No

String

Definition:

Custom data to be injected into the instance during cloud server creation. Texts and text files can be injected.

Example:

Before base64 encoding:

  • Linux server:

#!/bin/bash
echo user_test > /home/user.txt

After base64 encoding:

  • Linux server:

IyEvYmluL2Jhc2gKZWNobyB1c2VyX3Rlc3QgPiAvaG9tZS91c2VyLnR4dA==

For details about how to inject custom data, see Injecting User Data.

You must be aware of the effects of user_data. You are responsible for the impact and risks.

Constraints:

  • The content of user_data must be encoded with Base64.

  • The maximum size of the content to be injected (before encoding) is 32K.

Range: N/A

Default Value: N/A

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

current

Integer

Definition: Current page number.

Value range: 1 to 2097152

data

Array of ServerResponse objects

Definition: DevServer instance list.

pages

Integer

Definition: Total number of pages.

Value range: 1 to 2097152

size

Integer

Definition: Number of records on each page. Maximum number of instances returned on each page. The value of this parameter directly affects the amount of returned data. You can adjust the value to optimize the query performance or increase the information volume of a single request.

Range: 1 to 1024

total

Long

Definition: Total number of records. Total number of instances that meet the search criteria. This field is used to learn the overall data scale.

Range: 1 to 2147483647

Table 6 ServerResponse

Parameter

Type

Description

create_at

Long

Definition: Creation time.

Range: N/A

update_at

Long

Definition: Update time.

Range: N/A

charging_mode

String

Definition: Billing mode.

Range:

  • COMMON: both yearly/monthly and pay-per-use

  • POST_PAID: pay-per-use

  • PRE_PAID: yearly/monthly

cloud_server

CloudServer object

Definition: Cloud service information.

endpoints_response

Array of Endpoints objects

Definition: Private IP address of the instance.

flavor

String

Definition: Instance flavor name.

Range: ^.{1,128}$

id

String

Definition: Instance ID.

Range: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

key_pair_name

String

Definition: Key pair name.

Range: ^[-_.a-zA-Z0-9]{1,64}$

name

String

Definition: Instance name.

Range: ^[-_.a-zA-Z0-9]{1,64}$

order_id

String

Definition: Order ID.

Range: ^[a-zA-Z0-9]{1,64}$

server_image_response

ServerImageResponse object

Definition: Instance image information.

Range: N/A

status

String

Definition: Instance status. Current running status of the instance, which is used to monitor the lifecycle and health status of the instance.

Range:

  • CREATE_FAILED: Creating the instance failed.

  • CREATING: The instance is being created.

  • DELETED: The instance has been deleted.

  • DELETE_FAILED: Deleting the instance failed.

  • DELETING: The instance is being deleted.

  • ERROR: An error occurred.

  • RUNNING: The instance is running.

  • STARTING: The instance is being started.

  • START_FAILED: Starting the instance failed.

  • STOPPED: The instance has been stopped.

  • STOPPING: The instance is being stopped.

  • STOP_FAILED: Stopping the instance failed.

  • REBOOTING: The instance is being restarted.

  • REBOOT_FAILED: Restarting the instance failed.

  • CHANGINGOS: The OS is being changed.

  • CHANGINGOS_FAILED: Changing the OS failed.

  • REINSTALLINGOS: The OS is being reinstalled.

  • REINSTALLINGOS_FAILED: Reinstalling the OS failed.

vpc_id

String

Definition: ID of the VPC where the instance is located.

Range: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

endpoints

Array of EndpointsRes objects

Definition: Private IP address of the server.

volumes

Array of ServerVolume objects

Definition: Information about the mounted hard disk.

image

ServerImageResponse object

Definition: Server image information.

category

String

Definition: Server type.

Range:

  • HPS: supernode server

  • SPOD: full-cabinet server

  • SERVER: single server

server_hps

ServerHpsInfo object

Definition: Information about the supernode to which the server belongs.

subnet_id

String

Parameter description: ID of the subnet where the instance is located.

** Value range: **:^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$.

Table 7 CloudServer

Parameter

Type

Description

id

String

Definition: Server resource ID or supernode's child node ID.

Range: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

type

String

Definition: DevServer server type.

Range:

  • BMS: BMS

  • ECS: ECS

  • HPS: supernode server

hps_id

String

Definition: Server resource ID of the supernode's child node.

Range: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

hps_ecs_id

String

Definition: Server resource ID of the supernode's child node.

Range: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

Table 8 Endpoints

Parameter

Type

Description

allowed_access_ips

Array of strings

Definition: Whitelisted public IP addresses that are allowed to access notebook instances through SSH. By default, all IP addresses can access the notebook instances. If IP addresses are specified, only the clients with the specified IP addresses can access the notebook instances.

Constraints: N/A

Range: 0 to 1,024 IP addresses

Default Value: N/A

dev_service

String

Definition: Supported services.

Range:

  • NOTEBOOK: You can access notebook instances using HTTPS.

  • SSH: You can remotely access notebook instances through SSH.

extensions

Map<String,String>

Definition: App-specific URL for accessing the remote development mode of the app. It includes extended configurations of the application.

Constraints: N/A

Range: N/A

Default Value: N/A

ssh_keys

Array of strings

Definition: List of SSH key pairs. You can set multiple key pairs to access an SSH instance at the same time.

Constraints: N/A

Range: 0 to 1,024 key pairs

Default Value: N/A

Table 9 EndpointsRes

Parameter

Type

Description

allowed_access_ips

Array of strings

Definition: Whitelisted public IP addresses that are allowed to access notebook instances through SSH. By default, all public IP addresses can access the notebook instances. If IP addresses are specified, only the clients with the specified IP addresses can access the notebook instances.

dev_service

String

Definition: Method for accessing the notebook instance.

Range:

  • NOTEBOOK: You can access notebook instances using HTTPS.

  • SSH: You can remotely access notebook instances through SSH.

ssh_keys

Array of strings

Definition: List of SSH key pairs. You can set multiple key pairs to access an SSH instance at the same time.

service

String

Definition: Method for accessing the notebook instance.

Range:

  • NOTEBOOK: You can access notebook instances using HTTPS.

  • SSH: You can remotely access notebook instances through SSH.

uri

String

Definition: Private IP address of the instance.

Range: N/A

Table 10 ServerVolume

Parameter

Type

Description

size

Integer

Definition: EVS disk size, which is the storage space allocated to the system disk.

Constraints: N/A

Range: 100 to 1,024 GB

Default Value: N/A

type

String

Definition: Storage type, which can be a system disk or data disk.

Constraints: N/A

Range

  • ROOT: system disk

  • DATA: data disk

Default Value: N/A

evs_type

String

Definition: EVS disk type. Storage type of the EVS disk.

Constraints: N/A

Range

  • ESSD: extreme SSD

  • GPSSD: general-purpose SSD

  • SAS: high I/O EVS disk

  • SATA: common I/O EVS disk

  • SSD: ultra-high I/O EVS disk

Default Value: N/A

evs_id

String

Definition: ID of the EVS disk.

Range: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

Table 11 ServerImageResponse

Parameter

Type

Description

arch

String

Definition: Architecture type of a server image.

Range:

  • ARM

  • X86

image_id

String

Definition: Server image ID.

Range: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

name

String

Definition: Server image name.

Constraints: N/A

Range: 1 to 256 characters

Default Value: N/A

server_type

String

Definition: Server type.

Range:

  • BMS: BMS

  • ECS: ECS

  • HPS: supernode server

status

String

Definition: Server image status.

Range:

  • ACTIVE

  • INACTIVE

Table 12 ServerHpsInfo

Parameter

Type

Description

id

String

Definition: ID of the DevServer supernode instance.

Range: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

name

String

Definition: Name of the DevServer supernode.

Range: ^[-_.a-zA-Z0-9]{1,64}$

Status code: 400

Table 13 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Link trace ID.

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Status code: 401

Table 15 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Link trace ID.

Table 16 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Status code: 403

Table 17 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Link trace ID.

Table 18 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Status code: 500

Table 19 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Link trace ID.

Table 20 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Example Requests

post https://{endpoint}/v1/{project_id}/dev-servers/action

{
  "type" : "START",
  "servers" : [ {
    "id" : "b6dfd2ba-ac27-49cc-9fa5-750a1ad6342e"
  }, {
    "id" : "75751015-8929-434f-a346-c0c4c3afa547"
  } ]
}

Example Responses

Status code: 200

OK

{
  "current" : 0,
  "data" : [ {
    "charging_mode" : "POST_PAID",
    "cloud_server" : {
      "id" : "eb8b4e32-afc9-4f71-8372-1f55f3d7ab28",
      "type" : "ECS"
    },
    "create_at" : 1699352013484,
    "endpoints" : [ {
      "service" : "SSH",
      "uri" : "192.168.0.23"
    } ],
    "flavor" : "Si2.large.4",
    "id" : "c65c4f27-f791-452b-9098-a2726fa2e922",
    "image" : {
      "arch" : "X86",
      "image_id" : "c90fb553-2cdb-4b81-b56a-ef68812c6cf7",
      "name" : "Ubuntu18.04_x86_64_CPU",
      "server_type" : "ECS"
    },
    "name" : "EI-evs-01",
    "status" : "RUNNING",
    "update_at" : 1699352058465,
    "vpc_id" : "05982b48-a70f-43a1-a2b0-1fe36a236172"
  }, {
    "charging_mode" : "POST_PAID",
    "cloud_server" : {
      "type" : "ECS"
    },
    "create_at" : 1699348284990,
    "flavor" : "Si2.large.4",
    "id" : "62383738-e52a-450a-9f84-f9e705402be8",
    "image" : {
      "arch" : "X86",
      "image_id" : "c90fb553-2cdb-4b81-b56a-ef68812c6cf7",
      "name" : "Ubuntu18.04_x86_64_CPU",
      "server_type" : "ECS"
    },
    "name" : "EI-evs-1107",
    "status" : "CREATING",
    "update_at" : 1699348285077
  } ],
  "pages" : 1,
  "size" : 2,
  "total" : 2
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

500

Server Internal Error

Error Codes

See Error Codes.