GIS Cloud Suite
POST
URI
http://{server}:{port}/manager/web/api/service/instances
Method
POST
Parent Resource
service
Introduction
Publish service instance by API.
Supported Interchange Format: JSON
HTTP Request Method
Execute HTTP request to the URI below. In the URI below, {server}
is the server of gateway, replace it by the actual gateway IP. {port}
is the port of gateway, replace it by the actual gateway port.
http://{server}:{port}/manager/web/api/service/instances
POST Request
Publish the service instance.
The Format of Headers
content-type: application/json
authorization: Bearer {access_token}
Request Params
The necessary parameters to publish the service instance:
Name | Type | Explanation |
---|---|---|
dataSource | String | The type of datasource(please refer API > service to check the name of datasource types) |
serviceTypes | String[] | The type of service(please refer API > service to check the name of service types) |
nodeType | String | The type of node(please refer API > service to check the name of node types) |
nodeNames | String[] | The name of service node. Fill in an existing node or create a new one. |
isCreateNode | Boolean | Whether to create a new node |
serviceXml | String | Customize service configuration(please refer to SuperMap iServer Documentation) |
settings | String | Config service according to the datasource type and service type. |
Response Structure
The returned response would tell whether published successful, and provide the error information if failed.
Field | Type | Explanation | |
---|---|---|---|
isSucceed | Boolean | The result of the request. True means succeed, false means failed | |
msg | String | If the execution failed, the result would return the error information. The result would be empty if succeed. | |
serviceInfos | componentName | String | The name of the service component |
interfaceName | The name of the service interface |
Response Case
Execute POST request for http://192.168.17.139:32507/manager/web/api/service/instances
, input parameters to publish the service instance.
{
//The type of datasource: files workspace
"dataSource": "workspace",
//The type of service: REST-Map Service
"serviceTypes":[
"map-rest"
],
//The type of node:general node
"nodeType": "gisapplication",
"nodeNames":[
"Node1"
],
"isCreateNode": true,
"serviceXml": "",
//The path of datasource: /data/China400.smwu
"settings":
{
"workspacePath": "/data/China400.smwu",
"mapEditable": ""
}
}
The returned response in json format:
{
"isSucceed": true,
"msg": "",
"serviceInfos": [
{
"componentName": "map-China400-astczjug0f",
"interfaceName": "rest",
"alias": "map-China400-astczjug0f-rest",
"createTime": 1607676383491
}
]
}