API

portal

URI

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

Supported Methods

GET, POST

Introduction

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

Supported methods:

  • GET: Gets GIS portal list.
  • POST: Creates GIS portal.

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 portal name.

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

GET Request

Gets GIS portal 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 portals that contain basic information about the GIS portal, which consists of the following fields:

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

Where NodeInfo represents the detailed information of GIS portal, 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_iportal-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/portal.json to return the JSON format responds as follows:

{
  "list": [
    {
      "availabelTime": 0,
      "clusterSource": "CREATED",
      "cpu": 4,
      "createTime": 1481593591130,
      "description": "",
      "disk": 30,
      "hireDays": 0,
      "hostName": "iPortal-30",
      "id": 9,
      "ip": "172.16.16.30",
      "memory": 4,
      "nodeCount": 1,
      "nodeName": "iportal",
      "nodeSource": "CREATED",
      "nodeSpec": "MEDIUM",
      "nodeStatus": "CREATING",
      "operatingSystem": "LINUX",
      "parentId": -1,
      "password": "rxkWiLyh",
      "productInfos": [
        {
          "address": "http://172.16.16.30:8090/iportal",
          "id": 12,
          "name": "iPortal",
          "nodeId": 9,
          "productStatus": "CREATING",
          "webApp": true
        }
      ],
      "resourceType": "PORTAL",
      "thresholdEntity": {
        "id": 9,
        "maxCreateCount": 0,
        "maxUsage": 80,
        "metricType": "CPU",
        "minUsage": 20,
        "thresholdStatus": "DISABLED"
      },
      "thresholdId": 9,
      "updateTime": 1481593591130,
      "userName": "admin",
      "uuid": "d55c8ad3-5ad3-4bca-b234-d7d7652dcea3"
    }
  ],
  "total": 1
}

POST Request

Create GIS Portal.

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_iportal-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 portal 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/portal.json to pass in related parameters, as shown below:

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

The returned json format response is as follows:

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