关于¶
RESTAPI允许您设置和检索有关服务器本身的信息。
备注
阅读 API reference for /about/manifests <manifests.yaml>__ .
正在检索组件版本¶
检索主要组件的版本:geoserver、geotools和geoWebcache
请求
卷曲
curl -v -u admin:geoserver -XGET -H "Accept: text/xml"
http://localhost:8080/geoserver/rest/about/version.xml
响应
<about>
<resource name="GeoServer">
<Build-Timestamp>11-Dec-2012 17:55</Build-Timestamp>
<Git-Revision>e66f8da85521f73d0fd00b71331069a5f49f7865</Git-Revision>
<Version>2.3-SNAPSHOT</Version>
</resource>
<resource name="GeoTools">
<Build-Timestamp>04-Dec-2012 02:31</Build-Timestamp>
<Git-Revision>380a2b8545ee9221f1f2d38a4f10ef77a23bccae</Git-Revision>
<Version>9-SNAPSHOT</Version>
</resource>
<resource name="GeoWebCache">
<Git-Revision>2a534f91f6b99e5120a9eaa5db62df771dd01688</Git-Revision>
<Version>1.3-SNAPSHOT</Version>
</resource>
</about>
正在检索清单¶
检索类加载器已知的清单的完整清单和子集
请求
卷曲
curl -v -u admin:geoserver -XGET -H "Accept: text/xml"
http://localhost:8080/geoserver/rest/about/manifest.xml
备注
结果将是一个非常长的清单信息列表。虽然这可能很有用,但通常需要筛选此列表。
检索清单,按资源名称筛选
备注
此示例将只检索 name
属性匹配 gwc-.*
.
请求
卷曲
curl -v -u admin:geoserver -XGET -H "Accept: text/xml"
http://localhost:8080/geoserver/rest/about/manifest.xml?manifest=gwc-.*
响应
<about>
<resource name="gwc-2.3.0">
...
</resource>
<resource name="gwc-core-1.4.0">
...
</resource>
<resource name="gwc-diskquota-core-1.4.0">
...
</resource>
<resource name="gwc-diskquota-jdbc-1.4.0">
...
</resource>
<resource name="gwc-georss-1.4.0">
...
</resource>
<resource name="gwc-gmaps-1.4.0">
...
</resource>
<resource name="gwc-kml-1.4.0">
...
</resource>
<resource name="gwc-rest-1.4.0">
...
</resource>
<resource name="gwc-tms-1.4.0">
...
</resource>
<resource name="gwc-ve-1.4.0">
...
</resource>
<resource name="gwc-wms-1.4.0">
...
</resource>
<resource name="gwc-wmts-1.4.0">
...
</resource>
</about>
检索清单,按资源属性筛选
备注
此示例将只检索属性等于 GeoServerModule
.
请求
卷曲
curl -u admin:geoserver -XGET -H "Accept: text/xml"
http://localhost:8080/geoserver/rest/about/manifest.xml?key=GeoServerModule
响应
<about>
<resource name="control-flow-2.3.0">
<GeoServerModule>extension</GeoServerModule>
...
</resource>
...
<resource name="wms-2.3.0">
<GeoServerModule>core</GeoServerModule>
...
</resource>
</about>
检索清单,同时按资源名称和属性筛选
备注
此示例仅检索名为 GeoServerModule
值等于 extension
请求
卷曲
curl -u admin:geoserver -XGET -H "Accept: text/xml"
http://localhost:8080/geoserver/rest/about/manifest.xml?key=GeoServerModule&value=extension
系统状态¶
可以通过Geoserver REST API请求可用的系统信息(监控数据)。支持的格式有XML、JSON和HTML。
可用的REST端点为:
/geoserver/rest/about/system-status
/geoserver/rest/about/system-status.json
/geoserver/rest/about/system-status.xml
/geoserver/rest/about/system-status.html
系统数据的HTML表示形式等于 System status
制表符表示法:

系统状态¶
XML和JSON表示非常相似。对于每个系统信息指标,以下属性将可用:
Name |
Description |
名字 |
指标的名称 |
可用 |
如果系统信息值可用,则为True |
描述 |
此系统信息的说明 |
单位 |
单位的系统信息,可以为空 |
范畴 |
此系统信息的类别 |
优先性 |
该值可用于以预定义的顺序呈现指标 |
识别符 |
标识与指标关联的资源,例如文件分区名 |
XML表示的示例:
<metrics>
<metric>
<value>99614720</value>
<available>true</available>
<description>Partition [/dev/nvme0n1p2] total space</description>
<name>PARTITION_TOTAL</name>
<unit>bytes</unit>
<category>FILE_SYSTEM</category>
<identifier>/dev/nvme0n1p2</identifier>
<priority>507</priority>
</metric>
(...)
JSON表示示例:
{
"metrics": {
"metric": [
{
"available": true,
"category": "FILE_SYSTEM",
"description": "Partition [/dev/nvme0n1p2] total space",
"identifier": "/dev/nvme0n1p2",
"name": "PARTITION_TOTAL",
"priority": 507,
"unit": "bytes",
"value": 99614720
},