Class: module:DatastoreClient

module:DatastoreClient(url, auth)

new module:DatastoreClient(url, auth)

Creates a GeoServer REST DatastoreClient instance.
Parameters:
Name Type Description
url String The URL of the GeoServer REST API endpoint
auth String The Basic Authentication string
Source:

Methods

(async) createGeotiffFromFile(workspace, coverageStore, layerName, layerTitle, filePath) → {String}

Creates a GeoTIFF store from a file by path and publishes it as layer. The GeoTIFF file has to be placed on the server, where your GeoServer is running.
Parameters:
Name Type Description
workspace String The workspace to create GeoTIFF store in
coverageStore String The name of the new GeoTIFF store
layerName String The published name of the new layer
layerTitle String The published title of the new layer
filePath String The path to the GeoTIFF file on the server
Source:
Throws:
Error if request fails
Returns:
The successful response text
Type
String

(async) createGeotiffFromStream(workspace, coverageStore, layerName, layerTitle, readStream, fileSizeInBytes) → {String}

Creates a GeoTIFF store from a file by stream and publishes it as layer. The GeoTIFF file is placed on the server, where your GeoServer is running.
Parameters:
Name Type Description
workspace String The workspace to create GeoTIFF store in
coverageStore String The name of the new GeoTIFF store
layerName String The published name of the new layer
layerTitle String The published title of the new layer
readStream Stream The stream of the GeoTIFF file
fileSizeInBytes Number The number of bytes of the stream
Source:
Throws:
Error if request fails
Returns:
The successful response text
Type
String

(async) createGpkgStore(workspace, dataStore, gpkgPath)

Creates a GeoPackage store from a file placed in the geoserver_data dir.
Parameters:
Name Type Description
workspace String The WS to create the data store in
dataStore String The data store name
gpkgPath String Relative path to GeoPackage file within geoserver_data dir
Source:
Throws:
Error if request fails

(async) createImageMosaicStore(workspace, dataStore, zipArchivePath) → {String}

Creates an ImageMosaic store from a zip archive with the 3 necessary files - datastore.properties - indexer.properties - timeregex.properties The zip archive has to be given as absolute path, so before it has to be placed on the server, where your GeoServer is running.
Parameters:
Name Type Description
workspace String The WS to create the data store in
dataStore String The data store name
zipArchivePath String Absolute path to zip archive with the 3 properties files
Source:
Throws:
Error if request fails
Returns:
The response text
Type
String

(async) createPostgisStore(workspace, namespaceUri, dataStore, pgHost, pgPort, pgUser, pgPassword, pgSchema, pgDb, exposePkopt)

Creates a PostGIS based data store.
Parameters:
Name Type Attributes Description
workspace String The WS to create the data store in
namespaceUri String The namespace URI of the workspace
dataStore String The data store name to be created
pgHost String The PostGIS DB host
pgPort Number The PostGIS DB port
pgUser String The PostGIS DB user
pgPassword String The PostGIS DB password
pgSchema String The PostGIS DB schema
pgDb String The PostGIS DB name
exposePk Boolean <optional>
expose primary key, defaults to false
Source:
Throws:
Error if request fails

(async) createWfsStore(workspace, dataStore, wfsCapabilitiesUrl, namespaceUrl, useHttpConnectionPoolingopt)

Creates a WFS based data store.
Parameters:
Name Type Attributes Default Description
workspace String The WS to create the data store in
dataStore String The data store name
wfsCapabilitiesUrl String WFS capabilities URL
namespaceUrl String URL of the GeoServer namespace
useHttpConnectionPooling Boolean <optional>
true use HTTP connection pooling for WFS connection
Source:
Throws:
Error if request fails

(async) createWmsStore(workspace, dataStore, wmsCapabilitiesUrl)

Creates a WMS based data store.
Parameters:
Name Type Description
workspace String The WS to create the data store in
dataStore String The data store name
wmsCapabilitiesUrl String Base WMS capabilities URL
Source:
Throws:
Error if request fails

(async) createWmtsStore(workspace, dataStore, wmtsCapabilitiesUrl)

Creates a WMTS based data store.
Parameters:
Name Type Description
workspace String The WS to create the data store in
dataStore String The data store name
wmtsCapabilitiesUrl String Base WMTS capabilities URL
Source:
Throws:
Error if request fails

(async) deleteCoverageStore(workspace, coverageStore, recurse)

Deletes a CoverageStore.
Parameters:
Name Type Description
workspace String The workspace where the CoverageStore is in
coverageStore String Name of CoverageStore to delete
recurse String Flag to enable recursive deletion
Source:
Throws:
Error if request fails

(async) deleteDataStore(workspace, coverageStore, recurse)

Deletes a data store.
Parameters:
Name Type Description
workspace String The workspace where the data store is in
coverageStore String Name of data store to delete
recurse String Flag to enable recursive deletion
Source:
Throws:
Error if request fails

(async) getCoverageStore(workspace, covStore) → {Object}

Get specific CoverageStore by name in a workspace.
Parameters:
Name Type Description
workspace String The workspace to search CoverageStore in
covStore String CoverageStore name
Source:
Returns:
An object containing store details or undefined if it cannot be found
Type
Object

(async) getCoverageStores(workspace) → {Object}

Get all CoverageStores in a workspace.
Parameters:
Name Type Description
workspace String The workspace to get CoverageStores for
Source:
Returns:
An object containing store details
Type
Object

(async) getDataStore(workspace, dataStore) → {Object}

Get specific DataStore by name in a workspace.
Parameters:
Name Type Description
workspace String The workspace to search DataStore in
dataStore String DataStore name
Source:
Returns:
An object containing store details or undefined if it cannot be found
Type
Object

(async) getDataStores(workspace) → {Object}

Get all DataStores in a workspace.
Parameters:
Name Type Description
workspace String The workspace to get DataStores for
Source:
Returns:
An object containing store details
Type
Object

(async) getWmsStore(workspace, wmsStore) → {Object}

Get specific WmsStore by name in a workspace.
Parameters:
Name Type Description
workspace String The workspace to search WmsStore in
wmsStore String WmsStore name
Source:
Returns:
An object containing store details or undefined if it cannot be found
Type
Object

(async) getWmsStores(workspace) → {Object}

Get all WmsStores in a workspace.
Parameters:
Name Type Description
workspace String The workspace to get WmsStores for
Source:
Returns:
An object containing store details
Type
Object

(async) getWmtsStore(workspace, wmtsStore) → {Object}

Get specific WmtsStore by name in a workspace.
Parameters:
Name Type Description
workspace String The workspace to search WmtsStore in
wmtsStore String WmtsStore name
Source:
Returns:
An object containing store details or undefined if it cannot be found
Type
Object

(async) getWmtsStores(workspace) → {Object}

Get all WmtsStores in a workspace.
Parameters:
Name Type Description
workspace String The workspace to get WmtsStores for
Source:
Returns:
An object containing store details
Type
Object