Commit b69666e8 authored by Marek Ostaszewski's avatar Marek Ostaszewski
Browse files

access functions updated

parent f0dd7bdf
Pipeline #36820 passed with stages
in 3 minutes and 38 seconds
...@@ -21,12 +21,17 @@ ask_GET <- function(fask_url, verbose = F) { ...@@ -21,12 +21,17 @@ ask_GET <- function(fask_url, verbose = F) {
return(NULL) return(NULL)
} }
### Get the id of the default project for this MINERVA instance
get_default_project <- function(map_api) {
cfg <- fromJSON(ask_GET(paste0(map_api, "configuration/")))
return(cfg$options[cfg$options$type == "DEFAULT_MAP","value"])
}
### Get the components of a given map/project on the MINERVA Platform ### Get the components of a given map/project on the MINERVA Platform
get_map_components <- function(map_api, project_id = NULL) { get_map_components <- function(map_api, project_id = NULL) {
if(is.null(project_id)) { if(is.null(project_id)) {
### If project id not given, get configuration of the map, to obtain the latest (default) version ### If project id not given, get configuration of the map, to obtain the latest (default) version
cfg <- fromJSON(ask_GET(paste0(map_api, "configuration/"))) project_id <- get_default_project
project_id <- cfg$options[cfg$options$type == "DEFAULT_MAP","value"]
} }
### The address of the latest (default) build ### The address of the latest (default) build
mnv_base <- paste0(map_api, "projects/",project_id,"/") mnv_base <- paste0(map_api, "projects/",project_id,"/")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment