GeoServer Importer Extension - Tasks

The Importer extension gives a GeoServer administrator an alternate, more-streamlined method for uploading and configuring new layers. The tasks endpoint controls individual tasks within an import job. 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

ImporterTasks

ImporterTasks

Up
delete /imports/{importId}/tasks/{taskId}
Remove task with id {taskId} within import with id {importId} (deleteTask)

Path parameters

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

Responses

200

OK

Up
get /imports/{importId}/tasks/{taskId}
Retrieve task with id {taskId} within import with id {importId} (getTask)

Path parameters

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

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

Task

Example data

Content-Type: application/json
{
  "data" : {
    "type" : "remote"
  },
  "updateMode" : "CREATE",
  "errorMessage" : "errorMessage",
  "progress" : "progress",
  "messages" : "",
  "id" : "id",
  "href" : "href",
  "state" : "PENDING",
  "transformChain" : {
    "transforms" : "",
    "type" : "type"
  },
  "layer" : {
    "originalName" : "originalName",
    "nativeName" : "nativeName",
    "srs" : "srs",
    "bbox" : {
      "miny" : "miny",
      "minx" : "minx",
      "crs" : "crs",
      "maxy" : "maxy",
      "maxx" : "maxx"
    },
    "name" : "name",
    "description" : "description",
    "attributes" : "",
    "style" : {
      "filename" : "filename",
      "languageVersion" : {
        "version" : "version"
      },
      "name" : "name",
      "format" : "format",
      "href" : "href"
    },
    "href" : "href",
    "abstract" : "abstract",
    "title" : "title"
  },
  "target" : {
    "href" : "href",
    "store" : "{}"
  }
}

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 Task

Up
get /imports/{importId}/tasks/{taskId}/layer
Retrieve the layer of a task with id {taskId} within import with id {importId} (getTaskLayer)

Path parameters

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

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

Layer

Example data

Content-Type: application/json
{
  "originalName" : "originalName",
  "nativeName" : "nativeName",
  "srs" : "srs",
  "bbox" : {
    "miny" : "miny",
    "minx" : "minx",
    "crs" : "crs",
    "maxy" : "maxy",
    "maxx" : "maxx"
  },
  "name" : "name",
  "description" : "description",
  "attributes" : "",
  "style" : {
    "filename" : "filename",
    "languageVersion" : {
      "version" : "version"
    },
    "name" : "name",
    "format" : "format",
    "href" : "href"
  },
  "href" : "href",
  "abstract" : "abstract",
  "title" : "title"
}

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 Layer

Up
get /imports/{importId}/tasks/{taskId}/progress
Retrieve the current state and import progress of a task with id {taskId} within import with id {importId} (getTaskProgress)

Path parameters

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

Return type

Progress

Example data

Content-Type: application/json
{
  "total" : "total",
  "progress" : "progress",
  "state" : "PENDING",
  "message" : "message"
}

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 Progress

Up
get /imports/{importId}/tasks/{taskId}/target
Retrieve the store of a task with id {taskId} within import with id {importId} (getTaskTarget)

Path parameters

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

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

Store

Example data

Content-Type: application/json
{
  "href" : "href",
  "store" : "{}"
}

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 Store

Up
get /imports/{importId}/tasks
Retrieve all tasks for import with id {importId} (getTasks)

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: none

Return type

Tasks

Example data

Content-Type: application/json
"{\n   \"tasks\": [\n     {\n       \"id\": 0,\n       \"href\": \"http://localhost:8080/geoserver/rest/imports/2/tasks/0\",\n       \"state\": \"READY\"\n     }\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 Tasks

Example data

Content-Type: application/json
{
   "tasks": [
     {
       "id": 0,
       "href": "http://localhost:8080/geoserver/rest/imports/2/tasks/0",
       "state": "READY"
     }
   ]
 }

Up
post /imports/{importId}/tasks
Create a new task (postTask)
A new task can be created by issuing a POST to imports//tasks as a "Content-type: multipart/form-data" multipart encoded data as defined by RFC 2388. One or more file can be uploaded this way, and a task will be created for importing them. In case the file being uploaded is a zip file, it will be unzipped on the server side and treated as a directory of files. Alternatively, a new task can be created by issuing a POST as a "Content-type: application/x-www-form-urlencoded" form url encoded data containing a url paramerter with the location of the uploaded file.

Path parameters

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

Consumes

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

Request body

taskBody Task (required)
Body Parameter — The task to create or modify

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

Task

Example data

Content-Type: application/json
"{\n   \"task\": {\n     \"id\": 1,\n     \"href\": \"http://localhost:8080/geoserver/rest/imports/2/tasks/1\",\n     \"state\": \"READY\",\n     \"updateMode\": \"CREATE\",\n     \"data\": {\n       \"type\": \"file\",\n       \"format\": \"Shapefile\",\n       \"href\": \"http://localhost:8080/geoserver/rest/imports/2/tasks/1/data\",\n       \"file\": \"bugsites.shp\"\n     },\n     \"target\": {\n       \"href\": \"http://localhost:8080/geoserver/rest/imports/2/tasks/1/target\",\n       \"dataStore\": {\n         \"name\": \"shapes\",\n         \"type\": \"PostGIS\"\n       }\n     },\n     \"progress\": \"http://localhost:8080/geoserver/rest/imports/2/tasks/1/progress\",\n     \"layer\": {\n       \"name\": \"bugsites\",\n       \"href\": \"http://localhost:8080/geoserver/rest/imports/2/tasks/1/layer\"\n     },\n     \"transformChain\": {\n       \"type\": \"vector\",\n       \"transforms\": []\n     }\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

201

Created Task

Example data

Content-Type: application/json
{
   "task": {
     "id": 1,
     "href": "http://localhost:8080/geoserver/rest/imports/2/tasks/1",
     "state": "READY",
     "updateMode": "CREATE",
     "data": {
       "type": "file",
       "format": "Shapefile",
       "href": "http://localhost:8080/geoserver/rest/imports/2/tasks/1/data",
       "file": "bugsites.shp"
     },
     "target": {
       "href": "http://localhost:8080/geoserver/rest/imports/2/tasks/1/target",
       "dataStore": {
         "name": "shapes",
         "type": "PostGIS"
       }
     },
     "progress": "http://localhost:8080/geoserver/rest/imports/2/tasks/1/progress",
     "layer": {
       "name": "bugsites",
       "href": "http://localhost:8080/geoserver/rest/imports/2/tasks/1/layer"
     },
     "transformChain": {
       "type": "vector",
       "transforms": []
     }
   }
 }

Up
put /imports/{importId}/tasks/{taskId}
Modify task with id {taskId} within import with id {importId} (putTask)
A PUT request over an existing task can be used to update its representation. The representation can be partial, and just contains the elements that need to be updated. The updateMode of a task normally starts as "CREATE", that is, create the target resource if missing. Other possible values are "REPLACE", that is, delete the existing features in the target layer and replace them with the task source ones, or "APPEND", to just add the features from the task source into an existing layer.

Path parameters

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

Consumes

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

Request body

taskBody Task (required)
Body Parameter — The task to create or modify

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

Task

Example data

Content-Type: application/json
{
  "data" : {
    "type" : "remote"
  },
  "updateMode" : "CREATE",
  "errorMessage" : "errorMessage",
  "progress" : "progress",
  "messages" : "",
  "id" : "id",
  "href" : "href",
  "state" : "PENDING",
  "transformChain" : {
    "transforms" : "",
    "type" : "type"
  },
  "layer" : {
    "originalName" : "originalName",
    "nativeName" : "nativeName",
    "srs" : "srs",
    "bbox" : {
      "miny" : "miny",
      "minx" : "minx",
      "crs" : "crs",
      "maxy" : "maxy",
      "maxx" : "maxx"
    },
    "name" : "name",
    "description" : "description",
    "attributes" : "",
    "style" : {
      "filename" : "filename",
      "languageVersion" : {
        "version" : "version"
      },
      "name" : "name",
      "format" : "format",
      "href" : "href"
    },
    "href" : "href",
    "abstract" : "abstract",
    "title" : "title"
  },
  "target" : {
    "href" : "href",
    "store" : "{}"
  }
}

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 Task

Up
put /imports/{importId}/tasks/{filename}
Create a new task (putTaskFile)
A new task can be created by issuing a PUT containing the raw file content to this endpoint. The name of the uploaded file will be {filename}. The location of the uploaded file will be the top level directory associated with the import, or the "uploads" directory in the data directory if no directory is associated with the current import.

Path parameters

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

Consumes

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

Request body

fileBody binary (required)
Body Parameter — The file contents to upload.

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

Tasks

Example data

Content-Type: application/json
""

Responses

201

Created Tasks

Up
put /imports/{importId}/tasks/{taskId}/layer
Modify the target layer for a task with id {taskId} within import with id {importId} (putTaskLayer)

Path parameters

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

Consumes

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

Request body

layerBody Layer (required)
Body Parameter — The layer to modify

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

Task

Example data

Content-Type: application/json
{
  "data" : {
    "type" : "remote"
  },
  "updateMode" : "CREATE",
  "errorMessage" : "errorMessage",
  "progress" : "progress",
  "messages" : "",
  "id" : "id",
  "href" : "href",
  "state" : "PENDING",
  "transformChain" : {
    "transforms" : "",
    "type" : "type"
  },
  "layer" : {
    "originalName" : "originalName",
    "nativeName" : "nativeName",
    "srs" : "srs",
    "bbox" : {
      "miny" : "miny",
      "minx" : "minx",
      "crs" : "crs",
      "maxy" : "maxy",
      "maxx" : "maxx"
    },
    "name" : "name",
    "description" : "description",
    "attributes" : "",
    "style" : {
      "filename" : "filename",
      "languageVersion" : {
        "version" : "version"
      },
      "name" : "name",
      "format" : "format",
      "href" : "href"
    },
    "href" : "href",
    "abstract" : "abstract",
    "title" : "title"
  },
  "target" : {
    "href" : "href",
    "store" : "{}"
  }
}

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 Task

Up
put /imports/{importId}/tasks/{taskId}/target
Modify the target store for a task with id {taskId} within import with id {importId} (putTaskTarget)

Path parameters

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

Consumes

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

Request body

targetBody Store (required)
Body Parameter — The store to modify

Responses

200

OK

Models

[ Jump to Methods ]

Table of Contents

  1. Bbox - Bbox
  2. Data - data
  3. FeatureType - featureType
  4. FeatureType_inner -
  5. Layer - layer
  6. Message - message
  7. Messages - messages
  8. Progress - progress
  9. Store - store
  10. Style - style
  11. Style_languageVersion -
  12. Task - task
  13. Tasks - tasks
  14. Transform - transform
  15. TransformChain - transformChain
  16. Transforms - transforms
  17. messages -

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.

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

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

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

Progress - progress Up

Task progress
progress (optional)
String Number of operations completed
total (optional)
String Total number of operations
state (optional)
String State of the task.
Enum:
PENDING
READY
RUNNING
NO_CRS
NO_BOUNDS
NO_FORMAT
BAD_FORMAT
ERROR
CANCELED
COMPLETE
message (optional)
String Error message. Only shown if state is "ERROR"

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

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

messages - Up

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