Help Center/ ModelArts/ SDK Reference/ Lite Server Lifecycle Management/ Querying All Lite Server Instances of a User
Updated on 2025-12-04 GMT+08:00

Querying All Lite Server Instances of a User

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.get_user_servers_list(session=Session())

Parameters

Table 1 URI parameter

Parameter

Mandatory

Type

Description

session

Yes

class

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

Table 2 Query parameters

Parameter

Mandatory

Type

Description

owner

No

String

User ID of the instance, which contains 32 characters, including lowercase letters and digits. This parameter is valid only when the account is a large account or has the admin permission. Generally, the value is the ID of the current login user.

sort_dir

No

String

Sorting method. The value can be:

  • ASC: ascending order
  • DESC: descending order

sort_key

No

String

Sorting field. The value can be:

  • createTime: sorting by creation time (default value)
  • updateTime: sorting by update time

limit

No

Integer

Number of records on each page.

offset

No

Integer

Start offset of the records on each page.

Table 3 Response body parameters

Parameter

Type

Description

current

Integer

Current page number.

data

Array of ServerResponse objects

Lite Server instance list.

pages

Integer

Total number of pages.

size

Integer

Number of records on each page.

total

Long

Total number of records.

Table 4 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.

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 an 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 5 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 6 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 7 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 8 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 9 ServerHpsInfo

Parameter

Type

Description

id

String

Lite Server supernode instance ID.

name

String

Lite Server supernode name.