Geoserver REST API Workspace Manager
GSWorkspaceManagerObject of R6Class with methods for managing the workspaces
of a GeoServer instance.
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
getWorkspaces()Get the list of available workspace. Returns an object of class list
containing items of class GSWorkspace
getWorkspaceNames()Get the list of available workspace names. Returns an vector of class
character
getWorkspace(ws)Get a GSWorkspace object given a workspace name.
createWorkspace(name, uri)Creates a GeoServer workspace given a name, and an optional URI. If the URI
is not specified, GeoServer will automatically create an associated Namespace
with the URI being "http://workspaceName. If the URI is specified, the method
invokes the method createNamespace(ns, uri) of the GSNamespaceManager.
Returns TRUE if the workspace has been successfully created, FALSE otherwise
updateWorkspace(name, uri)Updates a GeoServer workspace given a name, and an optional URI. If the URI
is not specified, GeoServer will automatically update the associated Namespace
with the URI being "http://workspaceName. If the URI is specified, the method
invokes the method updateNamespace(ns, uri) of the GSNamespaceManager.
Returns TRUE if the workspace has been successfully updated, FALSE otherwise
deleteWorkspace(ws)Deletes a GeoServer workspace given a name. Returns TRUE if the
workspace has been successfully deleted, FALSE otherwise
# NOT RUN {
GSWorkspaceManager$new("http://localhost:8080/geoserver", "admin", "geoserver")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab