<managerRoot_uri>/componentsets[.<format>]
componentSets 资源是包含所有已配置的服务组件集的集合,通过对 componentSets 资源执行 POST 请求可以创建一个新的服务组件集,也可以通过 PUT 操作更改已有的服务组件集列表。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,localhost 是本地服务器。
http://localhost:8090/iserver/manager/componentsets.rjson
获取当前 GIS 服务中已配置的所有服务组件集。
对 componentSets 资源执行 GET 请求,返回的是一个服务组件集集合,其中单个服务组件集的表述的结构如下:
字段 | 类型 | 说明 |
name | String | 服务组件集的名称。 |
settings | List<ComponentSetting> | 服务组件配置信息列表。即服务组件配置集合中包含的服务组件配置信息。 |
interfaceNames | String | 绑定的服务接口名称列表,以逗号分隔多个接口名称 。 |
disabledInterfaceNames | String | 停止了的服务接口名称列表,以逗号分隔。 |
enabled | boolean | 当前服务组件集合是否可用。默认为 true,表示可用。 |
对 componentSets 资源:http://localhost:8090/iserver/manager/componentsets.rjson 执行 GET 请求,返回服务组件集列表,截取部分服务组件集的 rjson 格式的表述如下:
[{
"disabledInterfaceNames": "",
"interfaceNames": "handler",
"name": "components-handler",
"settings": [{
"config": {
"clip": false,
"logLevel": null,
"outputPath": null,
"outputSite": null,
"useCache": false
},
"disabledInterfaceNames": "",
"enabled": true,
"interfaceNames": "rest,wms111,wms130,wmts100,wmts-china",
"name": "map-world",
"providers": "ugcMapProvider-World",
"type": "com.supermap.services.components.impl.MapImpl"
}]
},
{
"disabledInterfaceNames": "",
"interfaceNames": "rest",
"name": "components-rest",
"settings": [{
"config": {
"clip": false,
"logLevel": null,
"outputPath": null,
"outputSite": null,
"useCache": false
},
"disabledInterfaceNames": "",
"enabled": true,
"interfaceNames": "rest,wms111,wms130,wmts100,wmts-china",
"name": "map-world",
"providers": "ugcMapProvider-World",
"type": "com.supermap.services.components.impl.MapImpl"
}]
}]
添加一个新的服务组件配置集,并启动该服务组件集。
对 componentSets 资源执行 POST 请求,添加并启动一个新的服务组件集,需要在请求体中包含以下参数:
字段 | 类型 | 含义 |
name | String | 服务组件集的名称。 |
settings | List<ComponentSetting> | 服务组件引用列表。即服务组件配置集合中包含的服务组件配置信息。 |
interfaceNames | String | 绑定的服务接口名称。 |
disabledInterfaceNames | String | 停止了的服务接口名称列表,以逗号分隔。 |
enabled | boolean | 当前服务组件是否可用。默认为 true,表示可用。 |
对 componentSets 资源执行 POST 请求,返回的操作结果表述的结构如下(表述在响应消息的实体主体里):
字段 | 类型 | 说明 |
succeed | boolean | 添加服务组件集操作是否成功。 |
对 componentSets 资源:http://localhost:8090/iserver/manager/componentsets.rjson 执行请求体如下的 POST 请求,添加新的服务组件集 components-rest :
{
"name": "components-rest",
"settings": [{
"name": "map-world",
"enabled": true
},
{
"name": "data-world",
"enabled": true
}],
"interfaceNames": "rest"
}
则返回的响应结果如下:
{
"newResourceLocation": "http://localhost:8090/iserver/manager/componentsets/components-rest.rjson",
"postResultType": "CreateChild",
"succeed": true
}
模拟 DELETE,批量删除服务组件集。
请求体为服务组件集名构成的字符串数组,参数如下:
类型 | 说明 |
String[] | 待删除服务组件集的名称数组。 |
对 componentSets 资源执行 PUT 请求,返回的操作结果表述的结构如下(表述在响应消息的实体主体里):
字段 | 类型 | 说明 |
succeed | boolean | 删除服务组件集是否成功。 |
对 componentSets 资源:http://localhost:8090/iserver/manager/componentsets.rjson 执行请求体如下的 PUT 请求,删除服务组件集 components-rest:
["components-rest"]
则返回 rjson 格式的响应结果如下:
{"succeed": true}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 componentSets 资源是否存在,或者客户端是否有权限访问 componentSets 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 componentSets 资源是否支持<format>格式的表述。