delete /resource/{pathToResource}
get /resource/{pathToResource}
head /resource/{pathToResource}
post /resource/{pathToResource}
put /resource/{pathToResource}
delete /resource/{pathToResource}
/resource
references the top level resource directory. get /resource/{pathToResource}
Download a resource, list contents of directory, or show formatted resource metadata.
Response content depends upon parameters.
With operation=default
, if the request is made against a non-directory resource, the content of the resource is returned.
For example, /resource/styles/default_point.sld?operation=default
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- a Named Layer is the basic building block of an SLD document -->
<NamedLayer>
<Name>default_point</Name>
<UserStyle>
<!-- Styles can have names, titles and abstracts -->
<Title>Default Point</Title>
<Abstract>A sample style that draws a point</Abstract>
<!-- FeatureTypeStyles describe how to render different features -->
<!-- A FeatureTypeStyle for rendering points -->
<FeatureTypeStyle>
<Rule>
<Name>rule1</Name>
<Title>Red Square</Title>
<Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>square</WellKnownName>
<Fill>
<CssParameter name="fill">#FF0000</CssParameter>
</Fill>
</Mark>
<Size>6</Size>
</Graphic>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
If the request is made against a directory resource, a "ResourceDirectory" response is returned, containing information about the directory and its children. Examples:
http://localhost:8080/geoserver/rest/resource/logs?operation=default&format=xml
<ResourceDirectory>
<name>logs</name>
<parent>
<path>/</path>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/" rel="alternate" type="application/xml"/>
</parent>
<lastModified>2017-09-15 18:50:54.0 UTC</lastModified>
<children>
<child>
<name>DEFAULT_LOGGING.xml</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/logs/DEFAULT_LOGGING.xml" rel="alternate" type="application/octet-stream"/>
</child>
<child>
<name>geoserver.log</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/logs/geoserver.log" rel="alternate" type="application/octet-stream"/>
</child>
<child>
<name>geoserver.log.1</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/logs/geoserver.log.1" rel="alternate" type="application/octet-stream"/>
</child>
<child>
<name>geoserver.log.2</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/logs/geoserver.log.2" rel="alternate" type="application/octet-stream"/>
</child>
<child>
<name>GEOSERVER_DEVELOPER_LOGGING.xml</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/logs/GEOSERVER_DEVELOPER_LOGGING.xml" rel="alternate" type="application/octet-stream"/>
</child>
<child>
<name>GEOTOOLS_DEVELOPER_LOGGING.xml</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/logs/GEOTOOLS_DEVELOPER_LOGGING.xml" rel="alternate" type="application/octet-stream"/>
</child>
<child>
<name>PRODUCTION_LOGGING.xml</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/logs/PRODUCTION_LOGGING.xml" rel="alternate" type="application/octet-stream"/>
</child>
<child>
<name>QUIET_LOGGING.xml</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/logs/QUIET_LOGGING.xml" rel="alternate" type="application/octet-stream"/>
</child>
<child>
<name>TEST_LOGGING.xml</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/logs/TEST_LOGGING.xml" rel="alternate" type="application/octet-stream"/>
</child>
<child>
<name>VERBOSE_LOGGING.xml</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/logs/VERBOSE_LOGGING.xml" rel="alternate" type="application/octet-stream"/>
</child>
</children>
</ResourceDirectory>
http://localhost:8080/geoserver/rest/resource/logs?operation=default&format=json
{"ResourceDirectory":{"name":"logs","parent":{"path":"\/","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/","rel":"alternate","type":"application\/json"}},"lastModified":"2017-09-15 18:50:54.0 UTC","children":{"child":[{"name":"DEFAULT_LOGGING.xml","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/logs\/DEFAULT_LOGGING.xml","rel":"alternate","type":"application\/octet-stream"}},{"name":"geoserver.log","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/logs\/geoserver.log","rel":"alternate","type":"application\/octet-stream"}},{"name":"geoserver.log.1","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/logs\/geoserver.log.1","rel":"alternate","type":"application\/octet-stream"}},{"name":"geoserver.log.2","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/logs\/geoserver.log.2","rel":"alternate","type":"application\/octet-stream"}},{"name":"GEOSERVER_DEVELOPER_LOGGING.xml","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/logs\/GEOSERVER_DEVELOPER_LOGGING.xml","rel":"alternate","type":"application\/octet-stream"}},{"name":"GEOTOOLS_DEVELOPER_LOGGING.xml","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/logs\/GEOTOOLS_DEVELOPER_LOGGING.xml","rel":"alternate","type":"application\/octet-stream"}},{"name":"PRODUCTION_LOGGING.xml","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/logs\/PRODUCTION_LOGGING.xml","rel":"alternate","type":"application\/octet-stream"}},{"name":"QUIET_LOGGING.xml","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/logs\/QUIET_LOGGING.xml","rel":"alternate","type":"application\/octet-stream"}},{"name":"TEST_LOGGING.xml","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/logs\/TEST_LOGGING.xml","rel":"alternate","type":"application\/octet-stream"}},{"name":"VERBOSE_LOGGING.xml","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/logs\/VERBOSE_LOGGING.xml","rel":"alternate","type":"application\/octet-stream"}}]}}}
With operation=metadata
, a "ResourceMetadata" object is returned. If the resource is a directory, this metadata object will not list the children of the directory.
Examples:
http://localhost:8080/geoserver/rest/resource/styles/default_point.sld?operation=metadata&format=xml
<ResourceMetadata>
<name>default_point.sld</name>
<parent>
<path>/styles</path>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://localhost:8080/geoserver/rest/resource/styles" rel="alternate" type="application/xml"/>
</parent>
<lastModified>2017-01-18 19:02:38.0 UTC</lastModified>
<type>resource</type>
</ResourceMetadata>
http://localhost:8080/geoserver/rest/resource/styles/default_point.sld?operation=metadata&format=json
{"ResourceMetadata":{"name":"default_point.sld","parent":{"path":"\/styles","link":{"href":"http:\/\/localhost:8080\/geoserver\/rest\/resource\/styles","rel":"alternate","type":"application\/json"}},"lastModified":"2017-01-18 19:02:38.0 UTC","type":"resource"}}
/resource
references the top level resource directory. default
returns a list of the contained resources in the case of a directory resource, or the actual resource contents in the case of a resource resource.metadata
requests a metadata summary of the resource. default: default metadata
operation, or for a directory resource. default: html application/xml
application/json
text/plain
*/*
head /resource/{pathToResource}
/resource
references the top level resource directory. post /resource/{pathToResource}
/resource
references the top level resource directory. put /resource/{pathToResource}
/resource
references the top level resource directory. */*
move
or copy
operation, this is instead the path to the source resource to move/copy from. default
creates a new resource or alters an existing resource. move
moves the resource to a new location. copy
duplicates the resource to a new location default: default ResourceDirectory_children
- ResourceDirectory_children_child
- ResourceDirectory_children_link
- ResourceMetadata
- ResourceMetadata_parent
- ResourceMetadata_parent_link
- ResourceDirectory
- ResourceDirectory_children_child
- UpResourceDirectory_children_link
- UpResourceMetadata
- UpResourceMetadata_parent
- UpResourceMetadata_parent_link
- UpResourceDirectory
- Up