GeoServer Resources

A resource is any item in the data directory that does not represent configuration. Typical resources include styles and icons.
More information: http://geoserver.org/comm/
Contact Info: geoserver-users@sourceforge.net
Version: 1.0.0
BasePath:/geoserver/rest
All rights reserved
http://apache.org/licenses/LICENSE-2.0.html

Access

Methods

[ Jump to Models ]

Table of Contents

Default

Default

Up
delete /resource/{pathToResource}
(resourceDelete)
Delete a resource (recursively if directory)

Path parameters

pathToResource (required)
Path Parameter — The full path to the resource. Required, but may be empty; a request to /resource references the top level resource directory.

Responses

200

OK

404

Resource not found.

Up
get /resource/{pathToResource}
(resourceGet)

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:

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:

Path parameters

pathToResource (required)
Path Parameter — The full path to the resource. Required, but may be empty; a request to /resource references the top level resource directory.

Query parameters

operation (optional)
Query Parameter — The type of GET operation. 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
format (optional)
Query Parameter — The format of the response. Only applicable for the metadata operation, or for a directory resource. default: html

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK

404

Resource not found.

Up
head /resource/{pathToResource}
(resourceHead)
Show resource metadata in HTTP headers.

Path parameters

pathToResource (required)
Path Parameter — The full path to the resource. Required, but may be empty; a request to /resource references the top level resource directory.

Responses

200

OK

404

Resource not found.

Up
post /resource/{pathToResource}
(resourcePost)
Invalid. Use PUT to create a resource.

Path parameters

pathToResource (required)
Path Parameter — The full path to the resource. Required, but may be empty; a request to /resource references the top level resource directory.

Responses

405

Method not allowed.

Up
put /resource/{pathToResource}
(resourcePut)
Upload/move/copy a resource, create directories on the fly (overwrite if exists). For move/copy operations, place source path in body. Copying is not supported for directories.

Path parameters

pathToResource (required)
Path Parameter — The full path to the resource. Required, but may be empty; a request to /resource references the top level resource directory.

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

resourceBody binary (optional)
Body Parameter — The content of the resource to upload. In the case of a move or copy operation, this is instead the path to the source resource to move/copy from.

Query parameters

operation (optional)
Query Parameter — The type of PUT operation. 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

Responses

200

OK (existing resource)

201

Created (new resource)

404

Source path that doesn't exist

405

PUT to directory or copy where source path is directory

Models

[ Jump to Methods ]

Table of Contents

  1. ResourceDirectory_children -
  2. ResourceDirectory_children_child -
  3. ResourceDirectory_children_link -
  4. ResourceMetadata -
  5. ResourceMetadata_parent -
  6. ResourceMetadata_parent_link -
  7. ResourceDirectory -

ResourceDirectory_children - Up

List of child resources in the directory
child (optional)

ResourceDirectory_children_child - Up

A child resource
name (optional)
String The name of the resource, including the extension if applicable.
link (optional)

ResourceDirectory_children_link - Up

A link to the child resource
href (optional)
String The link to the resource
rel (optional)
String Relationship between the current resource and the linked resource
Enum:
alternate
type (optional)
String The mime type returned by the link

ResourceMetadata - Up

Metadata about a resource
name (optional)
String The name of the resource, including the extension if applicable.
parent (optional)
lastModified (optional)
String The last modified date of the resource
type (optional)
String Type of resource.
Enum:
resource
directory

ResourceMetadata_parent - Up

The parent resource of this one
path (optional)
String The full path to the parent resource
link (optional)

ResourceMetadata_parent_link - Up

A link to the parent resource
href (optional)
String The link to the resource
rel (optional)
String Relationship between the current resource and the linked resource
Enum:
alternate
type (optional)
String The mime type returned by the link

ResourceDirectory - Up

Metadata about a directory of resources
name (optional)
String The name of the resource, including the extension if applicable.
parent (optional)
lastModified (optional)
String The last modified date of the resource
type (optional)
String Type of resource.
Enum:
resource
directory
children (optional)