R/status.R

Defines functions uo_get_service_status

# (autogenerated content from swagger API)


#' Service status
#'
#'
#'  ### Description
#'  Request the API status. It can be used to determine whether the API is online. You do not have to be authenticated to access this method.
#'
#'  ### Response Structure
#'  - `status`: API status, either ok or fail. The database connection is tested at each status request, to make sure that the API is online.
#'
#'  #### Response Examples
#'  ```
#'  {
#'    "status": "ok"
#'  }
#'  ```
#'
#' @param UBIOPS_TOKEN default NULL will search for token in environment
#' @return status
#' @export
uo_get_service_status <- function(UBIOPS_TOKEN=NULL){
    endpoint=glue::glue("{base}/status")
        tk <- check_ubiobstoken(UBIOPS_TOKEN)
        h  <- create_headers(tk)
    res <- httr::GET(url=endpoint,encode = "json",h)
    httr::stop_for_status(res)
    httr::content(res)
}
RMHogervorst/ubiopscontroller documentation built on May 25, 2021, 5:26 p.m.