Geoserver REST API DataStore Manager
Object of R6Class
with methods for managing GeoServer
DataStores (i.e. stores of vector data)
R6Class
object.
new(url, user, pwd, logger)
This method is used to instantiate a GSManager with the url
of the
GeoServer and credentials to authenticate (user
/pwd
). By default,
the logger
argument will be set to NULL
(no logger). This argument
accepts two possible values: INFO
: to print only geosapi logs,
DEBUG
: to print geosapi and CURL logs
getDataStores(ws)
Get the list of available dataStores. Returns an object of class list
giving items of class GSDataStore
getDataStoreNames(ws)
Get the list of available dataStore names. Returns an vector of class character
getDataStore(ws, ds)
Get an object of class GSDataStore
given a workspace and datastore
names.
createDataStore(ws, dataStore)
Creates a new datastore given a workspace and an object of class GSDataStore
updateDataStore(ws, dataStore)
Updates an existing dataStore given a workspace and an object of class GSDataStore
deleteDataStore(ws, ds, recurse)
Deletes a datastore given a workspace and an object of class GSDataStore
.
By defaut, the option recurse
is set to FALSE, ie datastore layers are not removed.
To remove all datastore layers, set this option to TRUE.
getFeatureTypes(ws, ds)
Get the list of available feature types for given workspace and datastore.
Returns an object of class list
giving items of class GSFeatureType
getFeatureTypeNames(ws, ds)
Get the list of available feature type names for given workspace and datastore.
Returns an vector of classcharacter
getFeatureType(ws, ds, ft)
Get an object of class GSFeatureType
given a workspace, datastore
and feature type names.
createFeatureType(ws, ds, featureType)
Creates a new featureType given a workspace, datastore names and an object of
class GSFeatureType
updateFeatureType(ws, ds, FeatureType)
Updates a featureType given a workspace, datastore names and an object of
class GSFeatureType
deleteFeatureType(ws, ds, featureType, recurse)
Deletes a featureType given a workspace, datastore names, and an object of
class GSFeatureType
. By defaut, the option recurse
is
set to FALSE, ie datastore layers are not removed.
getLayers()
Get the list of layers. Returns an object of class list
giving items
of class GSLayer
getLayerNames()
Get the list of layer names.
getLayer(lyr)
Get an object of class GSLayer
if existing
createLayer(layer)
Creates a new layer given an object of class GSLayer
updateLayer(layer)
Creates a layer given an object of class GSLayer
deleteLayer(layer)
Deletes a layer given an object of class GSLayer
getLayerGroups()
Get the list of layers. Returns an object of class list
giving items
of class GSLayer
getLayerGroupNames()
Get the list of layer names.
getLayerGroup(lyr, ws)
Get an object of class GSLayerGroup
if existing. Can be restrained
to a workspace.
createLayerGroup(layerGroup, ws)
Creates a new layer given an object of class GSLayerGroup
. Can be
restrained to a particular workspace.
updateLayerGroup(layerGroup, ws)
Creates a layer given an object of class GSLayerGroup
. Can be
restrained to a particular workspace.
deleteLayerGroup(layerGroup, ws)
Deletes a layer given an object of class GSLayerGroup
. Can be
restrained to a particular workspace.
publishLayer(ws, ds, featureType, layer)
Publish a web-layer (including the featureType and 'layer' resources), given
a workspace, a datastore, providing an object of class GSFeatureType
,
and GSLayer
unpublishLayer(ws, ds, lyr)
Unpublish a web-layer (including the featureType and 'layer' resources), given a workspace, a datastore, and a layer name
uploadData(ws, ds, endpoint, extension,
configure, update, filename, charset, contentType)
Uploads data to a target dataStore
uploadShapefile(ws, ds, endpoint,
configure, update, filename, charset)
Uploads a zipped ESRIshapefile to a target dataStore
uploadProperties(ws, ds, endpoint,
configure, update, filename, charset)
Uploads a properties file to a target dataStore
uploadH2(ws, ds, endpoint,
configure, update, filename, charset)
Uploads a H2 database to a target dataStore
uploadSpatialite(ws, ds, endpoint,
configure, update, filename, charset)
Uploads a Spatialite database to a target dataStore
uploadAppschema(ws, ds, endpoint,
configure, update, filename, charset)
Uploads a appschema file to a target dataStore
uploadGeopackage(ws, ds, endpoint,
configure, update, filename, charset)
Uploads a GeoPackage file to a target dataStore
# NOT RUN {
GSDataStoreManager$new("http://localhost:8080/geoserver", "admin", "geoserver")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab