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
Version: 1.0.0
BasePath:/geoserver/rest
All rights reserved
http://apache.org/licenses/LICENSE-2.0.html
Access
[ Jump to Models ]
Table of Contents
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.
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
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 request header;
the media type will be conveyed by the response header.
text/html
application/json
application/xml
Responses
200
OK
Context
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
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 request header;
the media type will be conveyed by the response header.
application/json
text/html
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
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
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 request header;
the media type will be conveyed by the response header.
application/json
text/html
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.
Create a new import (postImports)
Creates a new import. If the exec parameter is true, that import is immediately executed.
Request body
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
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 request header;
the media type will be conveyed by the response header.
application/json
text/html
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 request header:
application/json
text/json
Request body
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
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 request header;
the media type will be conveyed by the response header.
application/json
text/html
Responses
201
Created
Context
[ Jump to Methods ]
Table of Contents
AttributeRemapTransform
- AttributeRemapTransform
AttributesToPointGeometryTransform
- AttributesToPointGeometryTransform
Bbox
- Bbox
Context
- context
Contexts
- imports
CoverageStore
- Store
CoverageStore_coverageStore
-
CoverageStore_coverageStore_coverages
-
CoverageStore_coverageStore_workspace
-
CreateIndexTransform
- CreateIndexTransform
Data
- data
DataFormatTransform
- DataFormatTransform
DataStore
- Store
Database
- database
Directory
- directory
FeatureType
- featureType
FeatureType_inner
-
File
- file
FileContents
- filecontents
Files
- files
GdalAddoTransform
- GdalAddoTransform
GdalTranslateTransform
- GdalTranslateTransform
GdalWarpTransform
- GdalWarpTransform
IntegerFieldToDateTransform
- IntegerFieldToDateTransform
Layer
- layer
Message
- message
Messages
- messages
PostScriptTransform
- PostScriptTransform
Remote
- remote
ReprojectTransform
- ReprojectTransform
Store
- store
Style
- style
Style_languageVersion
-
Table
- table
Task
- task
Tasks
- tasks
Transform
- transform
TransformChain
- transformChain
Transforms
- transforms
datastore
-
messages
-
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)
target (optional)
String The type to map the attribute to.
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
A spatially referenced bounding box.
minx (optional)
miny (optional)
maxx (optional)
maxy (optional)
crs (optional)
String The WKT representation of the CRS.
An import context
id (optional)
href (optional)
String URL to the import context endpoint
state (optional)
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)
A raster store
href (optional)
String URL to the task target endpoint
coverageStore (optional)
name
String Name of the coverage store
description (optional)
String Description of the coverage store
type
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)
link (optional)
String A link to the list of coverages contained in this store
The workspace containing the store
name
link (optional)
String A link to the workspace representation
A data transform that creates an index in the data (assuming the import data is a database).
type (optional)
href (optional)
String URL to the transform endpoint
field (optional)
String The field to create the index for
A data representation. Paramaters vary depending on the type.
type (optional)
remote
file
directory
mosaic
database
table
A data transform that converts a non date attribute in a date attribute.
type (optional)
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).
A vector store
href (optional)
String URL to the task target endpoint
datastore (optional)
An import data object representing a database
type (optional)
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)
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)
A feature type attribute.
name (optional)
String The name of the attribute
binding (optional)
String The java class representing the type of the attribute
An import data object representing a spatial file or granule
type (optional)
format (optional)
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)
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)
Description of a spatial file or granule
file (optional)
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.
A data transform that runs gdaladdo on a input raster file.
type (optional)
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)
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
A data transform that runs gdalwarp on a input raster file.
type (optional)
href (optional)
String URL to the transform endpoint
options (optional)
array[String] Array of options that are passed to gdal when running the transform
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
A layer
name (optional)
href (optional)
String URL to the importer layer endpoint
title (optional)
abstract (optional)
description (optional)
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)
bbox (optional)
attributes (optional)
style (optional)
A message about the import data.
Invokes a script found in $GEOSERVER_DATA_DIR/importer/scripts
type (optional)
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
An import data object representing remote data.
type (optional)
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)
A data transform that reprojects the geometry from one CRS to another.
type (optional)
href (optional)
String URL to the transform endpoint
source (optional)
String The CRS to reproject from
target (optional)
String The CRS to reproject to
A store
href (optional)
String URL to the task target endpoint
store (optional)
Object JSON representation of the store
A layer style
name (optional)
href (optional)
String URL to the importer layer style endpoint
format (optional)
languageVersion (optional)
filename (optional)
version (optional)
String Version of style format
An import data object representing a a database table
type (optional)
name (optional)
format (optional)
href (optional)
String URL to the table endpoint
An import task
id (optional)
href (optional)
String URL to the task endpoint
state (optional)
PENDING
READY
RUNNING
NO_CRS
NO_BOUNDS
NO_FORMAT
BAD_FORMAT
ERROR
CANCELED
COMPLETE
updateMode (optional)
String Update mode of the task.
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)
A data transform applied to the import data.
type (optional)
String The name of the transform
href (optional)
String URL to the transform endpoint
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)
name (optional)
link (optional)
String URL to data store definition
level (optional)
String Level of the log message.
messsage (optional)