1 source("./R/HttpRequest.R")
2 source("./R/HttpParser.R")
6 #' All Arvados logic is inside this class
8 #' @field token represents user authentification token.
9 #' @field host represents server name we wish to connect to.
11 Arvados <- setRefClass(
22 initialize = function(auth_token, host_name)
24 #Todo(Fudo): Validate token
33 #' Get Arvados collection
35 #' @name collection_get
36 #' @field uuid UUID of the given collection
39 collection_get = function(uuid)
41 collection_relative_url <- paste0("collections/", uuid)
42 http_request <- HttpRequest("GET", token, host, collection_relative_url)
43 server_response <- http_request$execute()
45 httpParser <- HttpParser()
46 collection <- httpParser$parseCollectionGet(server_response)
47 class(collection) <- "ArvadosCollection"
55 #' List Arvados collections based on filter matching
57 #' @name collection_list
58 #' @field uuid UUID of the given collection
61 collection_list = function(filters = NULL, limit = NULL, offset = NULL)
63 #Todo(Fudo): Implement limit and offset
64 collection_relative_url <- "collections"
65 http_request <- HttpRequest("GET", token, host, collection_relative_url, filters)
66 server_response <- http_request$execute()
68 httpParser <- HttpParser()
69 collection <- httpParser$parseCollectionGet(server_response)
70 class(collection) <- "ArvadosCollectionList"