GeoServer Importer Extension - Main

The Importer extension gives a GeoServer administrator an alternate, more-streamlined method for uploading and configuring new layers. The main endpoint manages individual import jobs. The importer extension is an optional install and may not be available on all deployments of GeoServer
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 /imports/{importId}
Delete an import (deleteImport)
Deletes the import with id {importId}, as long as it is not in the COMPLETE state.

Responses

204

No Content.

Up
delete /imports
Delete all imports (deleteImports)
Deletes all imports that are not in the COMPLETE state.

Responses

204

No Content.

Up
get /imports/{importId}
Retrieve import by id (getImport)

Path parameters

importId (required)
Path Parameter — The ID of the import

Query parameters

expand (optional)
Query Parameter — What level to expand the response object to. Can be "self" (expand only the response object and its immediate children), "all" (expand all children), "none" (don't include any children), or a nonnegative integer, indicating the depth of children to expand to. default: self

Return type

Context

Example data

Content-Type: application/json
{
  "data" : {
    "type" : "remote"
  },
  "targetStore" : {
    "href" : "href",
    "store" : "{}"
  },
  "targetWorkspace" : "targetWorkspace",
  "transforms" : "",
  "archive" : true,
  "id" : "id",
  "href" : "href",
  "state" : "INIT",
  "message" : "message",
  "tasks" : ""
}

Example data

Content-Type: application/xml

  aeiou
  aeiou
  aeiou
  aeiou
  true
  aeiou
null
null

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 Context

Up
get /imports
Get a list of all imports (getImports)

Query parameters

expand (optional)
Query Parameter — What level to expand the response object to. Can be "self" (expand only the response object and its immediate children), "all" (expand all children), "none" (don't include any children), or a nonnegative integer, indicating the depth of children to expand to. default: none

Return type

Contexts

Example data

Content-Type: application/json
"{\n   \"imports\": [{\n     \"id\": 0,\n     \"state\": \"COMPLETE\",\n     \"href\": \"http://localhost:8080/geoserver/rest/imports/0\"\n   }, {\n     \"id\": 1,\n     \"state\": \"PENDING\",\n     \"href\": \"http://localhost:8080/geoserver/rest/imports/1\"\n   }]\n}\n"

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 Contexts

Example data

Content-Type: application/json
{
   "imports": [{
     "id": 0,
     "state": "COMPLETE",
     "href": "http://localhost:8080/geoserver/rest/imports/0"
   }, {
     "id": 1,
     "state": "PENDING",
     "href": "http://localhost:8080/geoserver/rest/imports/1"
   }]
}

Up
post /imports/{importId}
Create a new import, or execute an existing import (postImport)
If an import with the id {importId} exists and is not in the INIT state, it is executed. If an import with that id does not exist, a new import is created with that id. If the exec parameter is true, this new import is immediately executed.

Request body

importBody Context (required)
Body Parameter — The import context to create.

Query parameters

async (optional)
Query Parameter — Run the import asyncronously. default: false
exec (optional)
Query Parameter — Run the import when it is created. default: false
expand (optional)
Query Parameter — What level to expand the response object to. Can be "self" (expand only the response object and its immediate children), "all" (expand all children), "none" (don't include any children), or a nonnegative integer, indicating the depth of children to expand to. default: self

Return type

Context

Example data

Content-Type: application/json
{
  "data" : {
    "type" : "remote"
  },
  "targetStore" : {
    "href" : "href",
    "store" : "{}"
  },
  "targetWorkspace" : "targetWorkspace",
  "transforms" : "",
  "archive" : true,
  "id" : "id",
  "href" : "href",
  "state" : "INIT",
  "message" : "message",
  "tasks" : ""
}

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

201

Created. Returned if the import was created. Context

204

No Content. Returned if the import already existed and was executed.

412

Precondition Failed. Returned if the import already existed and was in the INIT state.

Up
post /imports
Create a new import (postImports)
Creates a new import. If the exec parameter is true, that import is immediately executed.

Request body

importBody Context (required)
Body Parameter — The import context to create.

Query parameters

async (optional)
Query Parameter — Run the import asyncronously. default: false
exec (optional)
Query Parameter — Run the import when it is created. default: false
expand (optional)
Query Parameter — What level to expand the response object to. Can be "self" (expand only the response object and its immediate children), "all" (expand all children), "none" (don't include any children), or a nonnegative integer, indicating the depth of children to expand to. default: self

Return type

Context

Example data

Content-Type: application/json
{
  "data" : {
    "type" : "remote"
  },
  "targetStore" : {
    "href" : "href",
    "store" : "{}"
  },
  "targetWorkspace" : "targetWorkspace",
  "transforms" : "",
  "archive" : true,
  "id" : "id",
  "href" : "href",
  "state" : "INIT",
  "message" : "message",
  "tasks" : ""
}

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

201

Created Context

Up
put /imports/{importId}
Tries to create a new import with the provided id. (putImport)
Creates a new import with the next unclaimed id >= {importId}. If the exec parameter is true, that import is immediately executed.

Consumes

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

Request body

importBody Context (required)
Body Parameter — The import context to create.

Query parameters

async (optional)
Query Parameter — Run the import asyncronously. default: false
exec (optional)
Query Parameter — Run the import when it is created. default: false
expand (optional)
Query Parameter — What level to expand the response object to. Can be "self" (expand only the response object and its immediate children), "all" (expand all children), "none" (don't include any children), or a nonnegative integer, indicating the depth of children to expand to. default: self

Return type

Context

Example data

Content-Type: application/json
{
  "data" : {
    "type" : "remote"
  },
  "targetStore" : {
    "href" : "href",
    "store" : "{}"
  },
  "targetWorkspace" : "targetWorkspace",
  "transforms" : "",
  "archive" : true,
  "id" : "id",
  "href" : "href",
  "state" : "INIT",
  "message" : "message",
  "tasks" : ""
}

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

201

Created Context

Models

[ Jump to Methods ]

Table of Contents

  1. AttributeRemapTransform - AttributeRemapTransform
  2. AttributesToPointGeometryTransform - AttributesToPointGeometryTransform
  3. Bbox - Bbox
  4. Context - context
  5. Contexts - imports
  6. CoverageStore - Store
  7. CoverageStore_coverageStore -
  8. CoverageStore_coverageStore_coverages -
  9. CoverageStore_coverageStore_workspace -
  10. CreateIndexTransform - CreateIndexTransform
  11. Data - data
  12. DataFormatTransform - DataFormatTransform
  13. DataStore - Store
  14. Database - database
  15. Directory - directory
  16. FeatureType - featureType
  17. FeatureType_inner -
  18. File - file
  19. FileContents - filecontents
  20. Files - files
  21. GdalAddoTransform - GdalAddoTransform
  22. GdalTranslateTransform - GdalTranslateTransform
  23. GdalWarpTransform - GdalWarpTransform
  24. IntegerFieldToDateTransform - IntegerFieldToDateTransform
  25. Layer - layer
  26. Message - message
  27. Messages - messages
  28. PostScriptTransform - PostScriptTransform
  29. Remote - remote
  30. ReprojectTransform - ReprojectTransform
  31. Store - store
  32. Style - style
  33. Style_languageVersion -
  34. Table - table
  35. Task - task
  36. Tasks - tasks
  37. Transform - transform
  38. TransformChain - transformChain
  39. Transforms - transforms
  40. datastore -
  41. messages -

AttributeRemapTransform - AttributeRemapTransform Up

A data transform that maps an attribute from one type to another.
type (optional)
String "AttributeRemapTransform"
href (optional)
String URL to the transform endpoint
field (optional)
String The field to remap.
target (optional)
String The type to map the attribute to.

AttributesToPointGeometryTransform - AttributesToPointGeometryTransform Up

A data transform that maps two numerical attributes to a point geometry.
type (optional)
String "AttributesToPointGeometryTransform"
href (optional)
String URL to the transform endpoint
latField (optional)
String The field used for the lattitude
lonField (optional)
String The field used for the longitude

Bbox - Bbox Up

A spatially referenced bounding box.
minx (optional)
String The minimum x value
miny (optional)
String The minimum y value
maxx (optional)
String The maximum x value
maxy (optional)
String The maximum y value
crs (optional)
String The WKT representation of the CRS.

Context - context Up

An import context
id (optional)
String The import id
href (optional)
String URL to the import context endpoint
state (optional)
String State of the import.
Enum:
INIT
INIT_ERROR
PENDING
RUNNING
COMPLETE
message (optional)
String The current context message, if any
archive (optional)
Boolean Flag to control whether imported files (indirect) should be archived after import
targetWorkspace (optional)
String Target workspace of the import, if any.
targetStore (optional)
data (optional)
transforms (optional)
tasks (optional)

Contexts - imports Up

List of import contexts.

CoverageStore - Store Up

A raster store
href (optional)
String URL to the task target endpoint
coverageStore (optional)

CoverageStore_coverageStore - Up

name
String Name of the coverage store
description (optional)
String Description of the coverage store
type
String Type of coverage store
enabled (optional)
Boolean Whether the store is enabled, or not
workspace (optional)
__default__ (optional)
Boolean Whether the store is the default store of the workspace
url (optional)
String Location of the raster data source (often, but not necessarily, a file). Can be relative to the data directory.
coverages (optional)

CoverageStore_coverageStore_coverages - Up

link (optional)
String A link to the list of coverages contained in this store

CoverageStore_coverageStore_workspace - Up

The workspace containing the store
name
String Name of the workspace
link (optional)
String A link to the workspace representation

CreateIndexTransform - CreateIndexTransform Up

A data transform that creates an index in the data (assuming the import data is a database).
type (optional)
String "CreateIndexTransform"
href (optional)
String URL to the transform endpoint
field (optional)
String The field to create the index for

Data - data Up

A data representation. Paramaters vary depending on the type.
type (optional)
String The type of the data
Enum:
remote
file
directory
mosaic
database
table

DataFormatTransform - DataFormatTransform Up

A data transform that converts a non date attribute in a date attribute.
type (optional)
String "DataFormatTransform"
href (optional)
String URL to the transform endpoint
field (optional)
String The field to apply the transform to
format (optional)
String A date parsing pattern, setup using the Java SimpleDateFormat syntax. In case it's missing, a number of built-in formats will be tried instead (short and full ISO date formats, dates without any separators).

DataStore - Store Up

A vector store
href (optional)
String URL to the task target endpoint
datastore (optional)

Database - database Up

An import data object representing a database
type (optional)
String "database"
format (optional)
href (optional)
String URL to the database endpoint
properties (optional)
Object Database connection parameters. Actual paramaters vary depending on the type of database.
tables (optional)

Directory - directory Up

An import data object representing a directory of spatial files or an image mosaic
type (optional)
String "directory" or "mosaic"
location (optional)
String Absolute system path to the directory
href (optional)
String URL to the directory endpoint
charset (optional)
String Charset encoding of the data
files (optional)

FeatureType - featureType Up

Feature type attributes

FeatureType_inner - Up

A feature type attribute.
name (optional)
String The name of the attribute
binding (optional)
String The java class representing the type of the attribute

File - file Up

An import data object representing a spatial file or granule
type (optional)
String "file"
format (optional)
String Format of the file
href (optional)
String URL to the file endpoint
location (optional)
String Absolute system path to the file
charset (optional)
String The charset encoding of the data
file (optional)
String Name of the file
prj (optional)
String Name of the .prj file, if applicable
other (optional)
array[String] List of other files that comprise this spatial file.
message (optional)

FileContents - filecontents Up

Description of a spatial file or granule
file (optional)
String Name of the file
href (optional)
String URL to the file endpoint
prj (optional)
String Name of the .prj file, if applicable
other (optional)
array[String] List of other files that comprise this spatial file.

Files - files Up

List of file descriptors

GdalAddoTransform - GdalAddoTransform Up

A data transform that runs gdaladdo on a input raster file.
type (optional)
String "GdalAddoTransform"
href (optional)
String URL to the transform endpoint
options (optional)
array[String] Array of options that are passed to gdal when running the transform
levels (optional)
array[Integer] The levels

GdalTranslateTransform - GdalTranslateTransform Up

A data transform that runs gdal_translate on a input raster file.
type (optional)
String "GdalTranslateTransform"
href (optional)
String URL to the transform endpoint
options (optional)
array[String] Array of options that are passed to gdal when running the transform

GdalWarpTransform - GdalWarpTransform Up

A data transform that runs gdalwarp on a input raster file.
type (optional)
String "GdalWarpTransform"
href (optional)
String URL to the transform endpoint
options (optional)
array[String] Array of options that are passed to gdal when running the transform

IntegerFieldToDateTransform - IntegerFieldToDateTransform Up

A data transform that allows a string or number field to be used as a year Date. The number is interpreted as an Integer.
type (optional)
String "IntegerFieldToDateTransform"
href (optional)
String URL to the transform endpoint
field (optional)
String The field to apply the transform to

Layer - layer Up

A layer
name (optional)
String The name of the layer
href (optional)
String URL to the importer layer endpoint
title (optional)
String The layer title
abstract (optional)
String The layer abstract
description (optional)
String The layer description
originalName (optional)
String The original name of the layer. This may be different from the name if this name already exists in geoserver.
nativeName (optional)
String The name of the underlying resource
srs (optional)
String The SRS of the layer
bbox (optional)
attributes (optional)
style (optional)

Message - message Up

A message about the import data.

Messages - messages Up

A list of log messages

PostScriptTransform - PostScriptTransform Up

Invokes a script found in $GEOSERVER_DATA_DIR/importer/scripts
type (optional)
String "PostScriptTransform"
href (optional)
String URL to the transform endpoint
name (optional)
String The name of the script to be invoked
options (optional)
array[String] Array of options that are passed to the script when running the transform

Remote - remote Up

An import data object representing remote data.
type (optional)
String "remote"
location (optional)
String The location from which to fetch the data.
username (optional)
String Username required to access the data (optional).
password (optional)
String Password required to access the data (optional).
domain (optional)
String domain of the data.

ReprojectTransform - ReprojectTransform Up

A data transform that reprojects the geometry from one CRS to another.
type (optional)
String "ReprojectTransform"
href (optional)
String URL to the transform endpoint
source (optional)
String The CRS to reproject from
target (optional)
String The CRS to reproject to

Store - store Up

A store
href (optional)
String URL to the task target endpoint
store (optional)
Object JSON representation of the store

Style - style Up

A layer style
name (optional)
String Name of the style
href (optional)
String URL to the importer layer style endpoint
format (optional)
String Format of style
languageVersion (optional)
filename (optional)
String File name of the style

Style_languageVersion - Up

version (optional)
String Version of style format

Table - table Up

An import data object representing a a database table
type (optional)
String "table"
name (optional)
format (optional)
href (optional)
String URL to the table endpoint

Task - task Up

An import task
id (optional)
String The task id
href (optional)
String URL to the task endpoint
state (optional)
String State of the task.
Enum:
PENDING
READY
RUNNING
NO_CRS
NO_BOUNDS
NO_FORMAT
BAD_FORMAT
ERROR
CANCELED
COMPLETE
updateMode (optional)
String Update mode of the task.
Enum:
CREATE
REPLACE
APPEND
UPDATE
data (optional)
target (optional)
progress (optional)
String URL to the progress endpoint for this task
layer (optional)
errorMessage (optional)
String Any error messages for the task, concatenated.
transformChain (optional)
messages (optional)

Tasks - tasks Up

A list of tasks

Transform - transform Up

A data transform applied to the import data.
type (optional)
String The name of the transform
href (optional)
String URL to the transform endpoint

TransformChain - transformChain Up

A chain of tranform operations to apply during the import process
type (optional)
String The type of transforms in the chain. One of "vector" or "raster"
transforms (optional)

Transforms - transforms Up

A list of transforms

datastore - Up

name (optional)
String Name of data store
link (optional)
String URL to data store definition

messages - Up

level (optional)
String Level of the log message.
messsage (optional)
String The log message