Help Center/ ModelArts/ API Reference/ DevServer Management/ Synchronizing the Status of All DevServer Instances of a User in Real Time
Updated on 2024-05-30 GMT+08:00

Synchronizing the Status of All DevServer Instances of a User in Real Time

Function

This API is used to synchronize the status of all DevServer instances of a user in real time.

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

PUT /v1/{project_id}/dev-servers/sync

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

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 big account or has the admin permission. Generally, the value is the ID of the current login user.

sort_dir

No

String

Sorting order. The options are ASC (ascending order) and DESC (descending order).

sort_key

No

String

Sorting fields. Separate multiple fields with commas (,).

offset

No

Integer

Start offset of the records on each page

limit

No

Integer

Number of records on each page

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

current

Integer

Current page

data

Array of ServerResponse objects

DevServer 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 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

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 occurred.

  • RUNNING: The instance is running.

  • STARTING: The instance is starting.

  • START_FAILED: Starting the instance failed.

  • STOPPED: The instance has been stopped.

  • STOPPING: The instance is being stopped.

  • STOP_FAILED: Stopping the instance failed.

vpc_id

String

ID of the VPC to which the instance belongs

endpoints

Array of EndpointsRes objects

Private IP address of the server

image

ServerImageResponse object

Server image information

Table 5 CloudServer

Parameter

Type

Description

id

String

Server resource ID

type

String

DevServer type. Enums:

  • BMS

  • ECS

Table 6 Endpoints

Parameter

Type

Description

allowed_access_ips

Array of strings

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 this parameter is specified, only the clients at the specified IP addresses can access the notebook instances.

dev_service

String

Supported service. Enums:

  • NOTEBOOK: You can access notebook instances using HTTPS.

  • SSH: You can remotely access notebook instances 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 of public IP addresses that are allowed to access the notebook instance through SSH. By default, all public IP addresses can access the notebook instance. If this parameter is specified, only the clients with the specified IP addresses can access the notebook instance.

dev_service

String

Supported service. Options:

  • 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

Supported service. The options are:

  • NOTEBOOK: You can access notebook instances using HTTPS.

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

uri

String

Private IP address of the instance

Table 8 ServerImageResponse

Parameter

Type

Description

arch

String

Architecture of the server image. The options are as follows:

  • ARM

  • X86

image_id

String

Server image ID

name

String

Server image name

server_type

String

Server type. Enums:

  • BMS

  • ECS

Example Requests

PUT https://{endpoint}/v1/{project_id}/dev-servers/sync

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

Error Codes

See Error Codes.