API
server
URI
http://<server>:<port>/imanager/cloud/web/nodes/server[.<format>]
Supported Methods
GET, POST
Introduction
server is a resource for a list of GIS servers, which allows you to obtain a list of GIS servers or create a GIS server through a POST request.
Supported methods:
- GET: Gets GIS server list.
- POST: Create GIS Server
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 server name.
http://supermapimanager:8390/imanager/cloud/web/nodes/server.json
GET Request
Gets GIS server 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 servers that contain basic information about the GIS server, which consists of the following fields:
Field | Type | Description |
---|---|---|
list | List |
The list of GIS servers returned for this request |
total | String | The total number of records, that is, the number of servers |
Where NodeInfo represents the detailed information of GIS server, 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_iserver-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/server.json
to return the JSON format responds as follows:
{
"list": [
{
"availabelTime": 0,
"clusterSource": "CREATED",
"cpu": 2,
"createTime": 1480665238132,
"description": "",
"disk": 20,
"hireDays": 0,
"hostName": "iServer-38",
"id": 4,
"ip": "172.16.16.38",
"memory": 2,
"nodeCount": 1,
"nodeName": "test",
"nodeSource": "CREATED",
"nodeSpec": "SMALL",
"nodeStatus": "RUNNING",
"operatingSystem": "LINUX",
"parentId": -1,
"password": "test",
"productInfos": [
{
"address": "http://172.16.16.38:8090/iserver",
"id": 5,
"name": "iServer",
"nodeId": 4,
"productStatus": "STOPPED",
"webApp": true
}
],
"productPath": "/etc/icloud/SuperMapiServer",
"resourceType": "SERVER",
"thresholdEntity": {
"id": 4,
"maxCreateCount": 0,
"maxUsage": 80,
"metricType": "CPU",
"minUsage": 20,
"thresholdStatus": "DISABLED"
},
"thresholdId": 4,
"updateTime": 1480665267181,
"userName": "admin",
"uuid": "bc43556c-a6f7-4670-a5c7-bb5682b8f8a4"
}
],
"total": 1
}
POST Request
Create GIS Server
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_iserver-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 server 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/server.json
to pass in related parameters, as shown below:
{
"nodeSpec": "MEDIUM",
"nodeCount": 1,
"nodeName": "iserver",
"password": "",
"description": "",
"physicalMachineName": "admin"
}
The returned json format response is as follows:
{
"isSucceed": true,
"msg": "",
"resultId": "684"
}