read: read method to access bfabric REST

View source: R/fgcz.R

readR Documentation

read method to access bfabric REST

Description

read method to access bfabric REST

Usage

read(
  login = NULL,
  webservicepassword = NULL,
  endpoint = "workunit",
  query,
  posturl = "http://localhost:5000/",
  as_data_frame = FALSE
)

Arguments

login

bfabric login

webservicepassword

bfabric webservicepassword, visible when you check your user details in the bfabric system.

endpoint

the endpoint, e.g., 'sample'

query

e,g, list(containerid = 3000)

posturl

POST url, default is 'http://localhost:5000/q'.

as_data_frame

if TRUE it returns a data.frame object.

Value

a nested list object

Examples

# ensure you have login and password
Rprofile <- file.path(Sys.getenv("HOME"), ".Rprofile")
source(Rprofile, local = TRUE)

res.sample <- bfabricShiny::read(login = login,
   webservicepassword = webservicepassword,
   endpoint = 'sample',
   query = list(containerid = 27053),
   as_data_frame = TRUE)
   
res.sample |> subset(select=c("_id", "name", "groupingvar.name"))
   
res.file <- bfabricShiny::read(login, webservicepassword,
  endpoint = 'resource',
  query = list('filechecksum' = '127f0c5b6352a326f9a6c8458d59d921'),
  )
  
res.workunit <- bfabricShiny::read(login, webservicepassword, 
    endpoint='workunit',
    query = list('status' = 'pending'),
    as_data_frame = TRUE)
      

 ## query metadata
 Q <- bfabricShiny::read(login, webservicepassword,
   endpoint = 'resource',
   query = list('workunitid' = 163763))
   

cpanse/bfabricShiny documentation built on March 27, 2024, 1:53 a.m.