Updated on 2025-12-04 GMT+08:00

Starting a Lite Server Instance

Example Code

In ModelArts Notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.

from modelarts.server_mgmt import ServerManagement
from modelarts.session import Session

ServerManagement.start(session = Session(),server_id = "server_id") #Enter server_id.

Parameters

Table 1 URI parameters

Parameter

Mandatory

Type

Description

server_id

Yes

String

Lite Server ID.

session

Yes

Class

Manage the interaction with Lite Server and provide project ID (project_id).

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

arch

No

String

Server architecture. The value can be:

  • ARM
  • X86

charging_mode

No

String

Billing mode of the server flavor. The value can be:

  • COMMON: Both yearly/monthly and pay-per-use are supported.
  • POST_PAID: pay-per-use
  • PRE_PAID: yearly/monthly

server_type

No

String

Server type. The value can be:

  • BMS: Bare Metal Server
  • ECS: Elastic Cloud Server
  • HPS: supernode server
Table 3 ServerResponse

Parameter

Type

Description

create_at

Long

Creation time.

update_at

Long

Update time.

charging_mode

String

Billing mode.

  • COMMON: Both yearly/monthly and pay-per-use are supported.
  • POST_PAID: pay-per-use
  • PRE_PAID: yearly/monthly

cloud_server

CloudServer object

Cloud service information.

endpoints_response

Array of Endpoints objects

Private IP address of the instance.

flavor

String

Instance flavor name.

id

String

Instance ID.

key_pair_name

String

Key pair name.

name

String

Instance name.

order_id

String

Order ID.

server_image_response

ServerImageResponse object

Instance image information.

status

String

Instance status.

  • 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 occurs.
  • 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

ID of the VPC where the instance is located.

endpoints

Array of EndpointsRes objects

Private IP address of the server

image

ServerImageResponse object

Server image information.

category

String

Server type.

  • HPS: supernode server
  • SPOD: entire-rack server
  • SERVER: single server

server_hps

ServerHpsInfo object

Information about the supernode to which the server belongs.

subnet_id

String

ID of the subnet where the instance is located.

Table 4 CloudServer

Parameter

Type

Description

id

String

Server resource ID.

type

String

Lite server type. The value can be:

  • BMS: Bare Metal Server
  • ECS: Elastic Cloud Server
  • HPS: supernode server

hps_id

String

Resource ID of the supernode to which the server belongs.

Table 5 Endpoints

Parameter

Type

Description

allowed_access_ips

Array of strings

Whitelist 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

Supported service. The value can be:

  • NOTEBOOK: You can access notebook instances using HTTPS.
  • SSH: You can remotely access the notebook instance through SSH.
  • AI_FLOW
  • MA_STUDIO
  • TENSOR_BOARD
  • WEB_IDE

extensions

Map<String,String>

App-specific URL for accessing the remote development mode of the App.

ssh_keys

Array of strings

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

Table 6 EndpointsRes

Parameter

Type

Description

allowed_access_ips

Array of strings

Whitelist 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

Notebook access method. The value can be:

  • NOTEBOOK: You can access notebook instances using HTTPS.
  • SSH: You can remotely access the notebook instance through SSH.

ssh_keys

Array of strings

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

service

String

Notebook access method. The value can be:

  • NOTEBOOK: You can access notebook instances using HTTPS.
  • SSH: You can remotely access the notebook instance through SSH.

uri

String

Private IP address of the instance.

Table 7 ServerImageResponse

Parameter

Type

Description

arch

String

Server image architecture type.

  • ARM
  • X86

image_id

String

Server image ID.

name

String

Server image name.

server_type

String

Server type. The value can be:

  • BMS: Bare Metal Server
  • ECS: Elastic Cloud Server
Table 8 ServerHpsInfo

Parameter

Type

Description

id

String

Lite Server supernode instance ID.

name

String

Lite Server supernode name.