API

desktop

URI

http://<server>:<port>/imanager/cloud/web/nodes/desktop[.<format>]

Supported Methods

GET, POST

Introduction

desktop is a resource for a list of GIS desktops, which allows you to obtain a list of GIS desktops or create a GIS desktop through a POST request.

Supported methods:

  • GET: Gets GIS desktop list.
  • POST: Creates GIS dekstop.

Supported representation format: JSON.

HTTP Request Method

An HTTP request is performed on the following URI. Here we take JSON output format for illustration, where supermapimanager is the desktop name.

http://supermapimanager:8390/imanager/cloud/web/nodes/desktop.json

GET Request

Gets GIS desktop list.

Request Parameters

Name Type Definition
pageSize String The page size. If it is -1, there is no limit, and the default value is-1

Response Structure

Returns a list of GIS desktops that contain basic information about the GIS desktop, which consists of the following fields:

Field Type Description
list List The list of GIS desktops returned for this request
total String The total number of records, that is, the numer of desktops

Where NodeInfo represents the detailed information of GIS desktop, which is composed of the fields below:

Field Type Description
availabelTime long Available time for the environment
clusterSource ClusterSource Cluster source, where ClusterSource has two values: CREATED indicates it is created by the system, BUILDED indicates the cluster
cpu int CPU kernel number occupied by the virtual machine
createTime long Creation time
description String Description
disk int Disk size (GB) occupied by the virtual machine
hireDays int The number of days for the rent. The default value is 0, indicating unlimited.
hostName String Host of the environment
id int ID of the environment
ip String IP of the environment
memory int Memory size occupied by the virtual machine (GB)
nodeCount int Number of environments or cluster nodes
nodeName String Node name. If not specified, the default value is the name of the VM. such as: sm_idesktop-123
nodeSource NodeSource Environment source, where NodeSource has two values: CREATED indicates it is created by the system, and IMPORTED indicates it is imported from the exernal
nodeSpec String Node specification, corresponding to template specification name
nodeStatus NodeStatus Environment status, including CREATING (being created), STARTING (being started), STOPPING (being stopped), REBOOTING (being restarted), RUNNING (running), DELETING (being deleted), STOPPED (Stopped), PAUSED (paused), CREATE_FAILED (failed to create), NOT_FOUND (not present), UNKNOWN (unknown), MOVING (moving), RESIZING (under adjustment), RESIZED (being resized)
operatingSystem OperatingSystem Environment operating system types, including Windows, LINUX, UNKNOWN
parentId int Parent Node ID. For Cluster worker nodes
password String Environment password
productInfos List Information of the application deployed in the environment
productPath String Location of the application deployed in the environment
resourceType String Resource type, corresponding to the template type name
thresholdEntity ThresholdEntity Environment threshold configuration information
updateTime long Update time
userName String Users of the environment
uuid String Environment uuid, unique identification of the corresponding virtual platform

Where ProductInfo represents the details of the application deployed in the environment, which is composed of the following fields:

Field Type Description
id int Application id
nodeId int ID of the environment
name String Application name
address String Application address
productStatus ProductStatus Application status, including CREATING (being created), STARTING (being started), STOPPING (being stopped), REBOOTING (being restarted), RUNNING (running), DELETING (being deleted), STOPPED (Stopped), CREATE_FAILED (failed to create), NOT_FOUND (not present), UNKNOWN (unknown), DEPLOYING (environment in configuration)

Where ThresholdEntity represents the details of the threshold entity, which is composed of the following fields:

Field Type Description
id int Threshold value id
maxCreateCount int Maximum number of added nodes
maxUsage float Maximum threshold
minUsage float Minimum threshold
metricType MetricType Performance monitoring type, including CPU, RAM, NETWORK (network I/O), INSTANCE
thresholdStatus ThresholdStatus Dynamic scaling state, including ENABLED (dynamic scaling on), DISABLED (dynamic scaling off), CONFLICT (dynamic scaling conflicts)

Response Example

Log in as an administrator, perform the GET request on http://supermapimanager:8390/imanager/cloud/web/nodes/desktop.json to return the JSON format responds as follows:

{
  "list": [
    {
      "availabelTime": 0,
      "clusterSource": "CREATED",
      "cpu": 4,
      "createTime": 1481595392916,
      "description": "",
      "disk": 30,
      "hireDays": 0,
      "hostName": "iDesktop-30",
      "id": 12,
      "ip": "172.16.16.30",
      "memory": 4,
      "nodeCount": 1,
      "nodeName": "idesktop",
      "nodeSource": "CREATED",
      "nodeSpec": "MEDIUM",
      "nodeStatus": "CREATING",
      "operatingSystem": "WINDOWS",
      "parentId": -1,
      "password": "kiKNrWya",
      "productInfos": [
        {
          "address": "172.16.16.30",
          "id": 15,
          "name": "iDesktop",
          "nodeId": 12,
          "productStatus": "CREATING",
          "webApp": false
        }
      ],
      "resourceType": "DESKTOP",
      "thresholdEntity": {
        "id": 12,
        "maxCreateCount": 0,
        "maxUsage": 80,
        "metricType": "CPU",
        "minUsage": 20,
        "thresholdStatus": "DISABLED"
      },
      "thresholdId": 12,
      "updateTime": 1481595392916,
      "userName": "admin",
      "uuid": "a13c09d0-bade-4edf-9611-7e3a28855a24"
    }
  ],
  "total": 1
}

POST Request

Creates GIS dekstop.

Request Parameters

Field Type Description
nodeSpec String Node specification, corresponding to template specification name
nodeCount int Number of environments or cluster nodes
nodeName String Node name. If not specified, the default value is the name of the VM. such as: sm_idesktop-123
password String Environment password
description String Description
physicalMachineName String Physical machine name, that is, which host the VM needs to deploy on. By default, it is consistent with the template VM

Response Structure

Returns whether the desktop has been created successfully. If failed, an error message will be given:

Field Type Description
isSucceed boolean Whether the execution is successful. If failed, false will be returned.
msg String If failed, the error message will be returned. If successful, it will be blank.
resultId String Requrst handle result id. For example, the id of the task returned by the environment.

Response Example

Log in as an administrator, implement the POST request on http://supermapimanager:8390/imanager/cloud/web/nodes/desktop.json to pass in related parameers, as shown below:

{
  "nodeSpec": "MEDIUM",
  "nodeCount": "1",
  "nodeName": "idesktop",
  "password": "",
  "description": "",
  "physicalMachineName": "admin"
}

The returned json format response is as follows:

{
  "isSucceed": true,
  "msg": "",
  "resultId": "678"
}