API
general
URI
http://<server>:<port>/imanager/cloud/web/nodes/general[.<format>]
Supported methods
GET, POST
Introduction
general is the resource of GIS general platform list. It can get the GIS general platform list, and also create the GIS general platform by executing the POST request.
Supported Methods:
- GET: Get the GIS general platform list.
- POST: Create the GIS general platform.
Supported output formats: JSON.
HTTP request methods
Implement the HTTP request on the following URI, where supermapmanager
is the general platform name, with json being the output format.
http://supermapimanager:8390/imanager/cloud/web/nodes/general.json
GET request
Get the GIS general platform list.
Request parameter
Name | Type | Description |
---|---|---|
pageSize | String | The page size. If it is the -1, it does not have the limit. The default value is -1 |
Response structure
Returns the GIS general platform list, including the basic information of GIS general platform. It is composed by the following fields:
Field | Type | Description |
---|---|---|
list | List |
The GIS general platform list returned by this request |
total | String | The total record, namely, the GIS general platform number |
NodeInfo means the GIS general platform details, and is composed by the following fields:
Field | Type | Description |
---|---|---|
availabelTime | long | The environment time |
clusterSource | ClusterSource | The cluster source where the ClusterSource has two values: CREATED means to be created by the system, and built by BUILDED, the specified cluster |
cpu | int | The CPU kernel number occupied by the virtual machine |
createTime | long | Create time. |
description | String | Description |
disk | int | The disk size occupied by the virtual machine |
hireDays | int | The lease days. Default is 0, meaning no limits |
hostName | String | The host name of the environment |
id | int | The environment id |
ip | String | The environment ip |
memory | int | The memory size occupied by the virtual machine |
nodeCount | int | The environment number or the cluster node number |
nodeName | String | The node name. If it isn't specified, it is the VM name by default, such as sm_igeneral-123 |
nodeSource | NodeSource | The environment source where the NodeSource has two values: CREATED means to be created by the system, and IMPORTED means to be imported by external. |
nodeSpec | String | The node format corresponds to module format name |
nodeStatus | NodeStatus | The environment status include CREATING, STARTING, STOPPING, REBOOTING, RUNNING, DELETING, STOPPED, PAUSED, CREATE_FAILED, NOT_FOUND, UNKNOWN, MOVING, RESIZING, RESIZED |
operatingSystem | OperatingSystem | The environment operating system type includes WINDOWS, LINUX and UNKNOWN |
parentId | int | The parent node ID, which is for the cluster worker nodes |
password | String | The environment password |
productInfos | List |
The application information deployed in environment |
productPath | String | The application deployment place in environment |
resourceType | String | The resource type corresponds to module type name |
thresholdEntity | ThresholdEntity | The environment threshold configuration information |
updateTime | long | Update time |
userName | String | The environment user |
uuid | String | The environment uuid corresponding to the ID of virtual platform |
ProductInfo represents the application detailed info deployed in environment:
Field | Type | Description |
---|---|---|
id | int | The application id |
nodeId | int | The environment id |
name | String | Application name |
address | String | Application address |
productStatus | ProductStatus | The application status include CREATING, STARTING, START_FAILED, STOPPING, REBOOTING, RUNNING, DELETING, STOPPED, CREATE_FAILED, NOT_FOUND, UNKNOWN, DEPLOYING |
The ThresholdEntity means the threshold value entity information, and is composed by the following fields:
Field | Type | Description |
---|---|---|
id | int | The threshold id |
maxCreateCount | int | The max new node number |
maxUsage | float | The maximum threshold |
minUsage | float | The minimum threshold |
metricType | MetricType | The performance monitoring types: CPU,RAM, NETWORK and INSTANCE |
thresholdStatus | ThresholdStatus | Dynamic scaling state includes ENABLED, DISABLED, CONFLICT |
Response example
After the administrator logins in, execute GET request for http://supermapimanager:8390/imanager/cloud/web/nodes/general.json
. The returned json responding result is as follows:
{
"list": [
{
"availabelTime": 0,
"clusterSource": "CREATED",
"cpu": 4,
"createTime": 1481596329560,
"description": "",
"disk": 30,
"hireDays": 0,
"hostName": "general-66",
"id": 526,
"ip": "192.168.22.66",
"memory": 4,
"nodeCount": 1,
"nodeName": "Sichuan Land Resources System",
"nodeSource": "CREATED",
"nodeSpec": "MEDIUM",
"nodeStatus": "CREATING",
"operatingSystem": "LINUX",
"parentId": -1,
"password": "gLcBJaqP",
"productInfos": [
{
"address": "http://192.168.22.66:8090/iserver",
"id": 562,
"name": "iserver",
"nodeId": 526,
"productStatus": "CREATING",
"webApp": true
}
],
"resourceType": "Land Resources System",
"thresholdEntity": {
"id": 689,
"maxCreateCount": 0,
"maxUsage": 80,
"metricType": "CPU",
"minUsage": 20,
"thresholdStatus": "DISABLED"
},
"thresholdId": 689,
"updateTime": 1481596329560,
"userName": "admin",
"uuid": "VirtualMachine:vm-1527"
}
],
"total": 1
}
POST request
Create the GIS general platform.
Request parameter
Field | Type | Description |
---|---|---|
nodeSpec | String | The node format corresponds to module format name |
nodeCount | int | The environment number or the cluster node number |
nodeName | String | The node name. If it isn't specified, it is the VM name by default, such as sm_igeneral-123 |
password | String | The environment password |
description | String | Description |
physicalMachineName | String | The physical machine name. It is the same with VM by default |
Response structure
Return whether the GIS general platform is created successfully. If it fails, it will give the error info:
Field | Type | Description |
---|---|---|
isSucceed | boolean | Whether it is successful. Return false if failed. |
msg | String | If it failed, it will show the error; otherwise, it is null |
resultId | String | Request processing result id. For example, creating environment returns the corresponding task id |
Response example
After the administrator logins in, execute POST request for http://supermapimanager:8390/imanager/cloud/web/nodes/general.json
. Import the related parameter, as shown below:
{
"resourceType": "Land Resources System",
"nodeSpec": "MEDIUM",
"nodeCount": 1,
"nodeName": "Sichuan Land Resources System",
"password": "",
"description": "",
"physicalMachineName": "HostSystem:host-9"
}
The response result in json format returned is as follows:
{
"isSucceed": true,
"msg": "",
"resultId": "659"
}