Title: | Interface to 'GeoNode' REST API |
---|---|
Description: | Provides an interface to the 'GeoNode' API, allowing to upload and publish metadata and data in 'GeoNode'. For more information about the 'GeoNode' API, see <https://geonode.org/>. |
Authors: | Emmanuel Blondel [aut, cre] |
Maintainer: | Emmanuel Blondel <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1-1 |
Built: | 2024-10-17 02:58:58 UTC |
Source: | https://github.com/eblondel/geonode4r |
GeoNode REST API Manager
GeoNode REST API Manager
R6Class
object.
Object of R6Class
with methods for communication with
the REST API of a GeoNode instance.
verbose.info
if geonode4R logs have to be printed
verbose.debug
if curl logs have to be printed
loggerType
the type of logger
url
the Base url of GeoNode
logger()
Prints a log message
GeoNodeManager$logger(type, text)
type
type of log, "INFO", "WARN", "ERROR"
text
text
INFO()
Prints an INFO log message
GeoNodeManager$INFO(text)
text
text
WARN()
Prints an WARN log message
GeoNodeManager$WARN(text)
text
text
ERROR()
Prints an ERROR log message
GeoNodeManager$ERROR(text)
text
text
new()
This method is used to instantiate a GeoNodeManager with the url
of the
GeoNode 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.
The keyring_backend
can be set to use a different backend for storing
the GeoNode user password with keyring (Default value is 'env').
GeoNodeManager$new(url, user, pwd, logger = NULL, keyring_backend = "env")
url
url
user
user
pwd
pwd
logger
logger
keyring_backend
keyring backend. Default is 'env'
getUrl()
Get URL
GeoNodeManager$getUrl()
the Geoserver URL
connect()
Connects to geoServer
GeoNodeManager$connect()
TRUE
if connected, raises an error otherwise
getExecutionStatus()
Get execution status
GeoNodeManager$getExecutionStatus(execution_id)
execution_id
the execution id
the status of execution
getCategories()
Get categories
GeoNodeManager$getCategories(raw = FALSE)
raw
Controls the output. Default will return an object of class data.frame.
an object of class list
getCategory()
Get category
GeoNodeManager$getCategory(id, raw = FALSE)
id
category id
raw
Controls the output. Default will return an object of class data.frame.
an object of class list
getResourceByUUID()
Get resource by UUID
GeoNodeManager$getResourceByUUID(uuid)
uuid
resource uuid (or semantic id if used in place of uuid)
an object of class list
getResourceByAlternate()
Get resource by Alternate
GeoNodeManager$getResourceByAlternate(alternate)
alternate
resource alternate
an object of class list
getResource()
Get resource
GeoNodeManager$getResource(id)
id
resource id
an object of class list
deleteResource()
Deletes a resource
GeoNodeManager$deleteResource(id)
id
resource (either a dataset or document) id
TRUE
if deleted, FALSE
otherwise
upload()
Uploads resource files
GeoNodeManager$upload(files)
files
files
an object of class list giving the upload status
uploadMetadata()
Uploads ISO 19115 dataset metadata
GeoNodeManager$uploadMetadata(id, file)
id
dataset id
file
a metadata XML file following ISO 19115 specification
an object
getDataset()
Get dataset standardized metadata
GeoNodeManager$getDataset(id)
id
dataset id
an object of class list
clone()
The objects of this class are cloneable with this method.
GeoNodeManager$clone(deep = FALSE)
deep
Whether to make a deep clone.
Emmanuel Blondel <[email protected]>
## Not run: GeoNodeManager$new("http://localhost:8080", "user", "password") ## End(Not run)
## Not run: GeoNodeManager$new("http://localhost:8080", "user", "password") ## End(Not run)
GeoNode REST API Manager Utils
GeoNode REST API Manager Utils
R6Class
object.
Object of R6Class
with static util methods for communication
with the REST API of a GeoNode instance.
getUserAgent()
This method is used to get the user agent for performing GeoNode API requests. Here the user agent will be compound by geonode4R package name and version.
getUserToken(user, pwd)
This method is used to get the user authentication token for performing GeoNode API requests. Token is given a Base64 encoded string.
GET(url, user, pwd, path, verbose)
This method performs a GET request for a given path
to GeoNode REST API
PUT(url, user, pwd, path, filename, contentType, verbose)
This method performs a PUT request for a given path
to GeoNode REST API,
to upload a file of name filename
with given contentType
POST(url, user, pwd, path, content, contentType, verbose)
This method performs a POST request for a given path
to GeoNode REST API,
to post content of given contentType
DELETE(url, user, pwd, path, verbose)
This method performs a DELETE request for a given GeoServer resource identified
by a path
in GeoNode REST API
clone()
The objects of this class are cloneable with this method.
GeoNodeUtils$clone(deep = FALSE)
deep
Whether to make a deep clone.
Emmanuel Blondel <[email protected]>
This class allows to grab the GeoNode version.
R6Class
object.
GeoNode REST API - GeoNode Version
Object of R6Class
for modelling a GeoNode version
version
version
value
value
new()
Initializes an object of class GeoNodeVersion
GeoNodeVersion$new(url, user, pwd)
url
url
user
user
pwd
pwd
lowerThan()
Compares to a version and returns TRUE if it is lower, FALSE otherwise
GeoNodeVersion$lowerThan(version)
version
version
TRUE
if lower, FALSE
otherwise
greaterThan()
Compares to a version and returns TRUE if it is greater, FALSE otherwise
GeoNodeVersion$greaterThan(version)
version
version
TRUE
if greater, FALSE
otherwise
equalTo()
Compares to a version and returns TRUE if it is equal, FALSE otherwise
GeoNodeVersion$equalTo(version)
version
version
TRUE
if equal, FALSE
otherwise
clone()
The objects of this class are cloneable with this method.
GeoNodeVersion$clone(deep = FALSE)
deep
Whether to make a deep clone.
Emmanuel Blondel <[email protected]>
## Not run: version <- GeoNodeVersion$new( url = "http://localhost:8080/GeoNode", user = "admin", pwd = "GeoNode" ) ## End(Not run)
## Not run: version <- GeoNodeVersion$new( url = "http://localhost:8080/GeoNode", user = "admin", pwd = "GeoNode" ) ## End(Not run)