1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
5 #' R6 Class Representing a Arvados
8 #' Arvados class gives users ability to access Arvados REST API. It also allowes user to manipulate collections (and projects?)
11 Arvados <- R6::R6Class(
18 #' Initialize new enviroment.
19 #' @param authToken ARVADOS_API_TOKEN from 'Get API Token' on Arvados.
20 #' @param hostName ARVADOS_API_HOST from 'Get API Token' on Arvados.
21 #' @param numRetries Specify number of times to retry failed service requests.
22 #' @return A new `Arvados` object.
24 #' arv <- Arvados$new(authToken = "ARVADOS_API_TOKEN", hostName = "ARVADOS_API_HOST", numRetries = 3)
25 initialize = function(authToken = NULL, hostName = NULL, numRetries = 0)
27 if(!is.null(hostName))
28 Sys.setenv(ARVADOS_API_HOST = hostName)
30 if(!is.null(authToken))
31 Sys.setenv(ARVADOS_API_TOKEN = authToken)
33 hostName <- Sys.getenv("ARVADOS_API_HOST")
34 token <- Sys.getenv("ARVADOS_API_TOKEN")
36 if(hostName == "" | token == "")
37 stop(paste("Please provide host name and authentification token",
38 "or set ARVADOS_API_HOST and ARVADOS_API_TOKEN",
39 "environment variables."))
41 private$token <- token
42 private$host <- paste0("https://", hostName, "/arvados/v1/")
43 private$numRetries <- numRetries
44 private$REST <- RESTService$new(token, hostName,
45 HttpRequest$new(), HttpParser$new(),
51 #' project_exist enables checking if the project with such a UUID exist.
52 #' @param uuid The UUID of a project or a file.
54 #' arv$project_exist(uuid = projectUUID)
55 project_exist = function(uuid)
57 proj <- self$project_list(list(list("uuid", '=', uuid)))
58 value <- length(proj$items)
68 #' project_get returns the demanded project.
69 #' @param uuid The UUID of the Group in question.
71 #' project <- arv$project_get(uuid = projectUUID)
72 project_get = function(uuid)
78 #' project_create creates a new project of a given name and description.
79 #' @param name Name of the project.
80 #' @param description Description of the project.
81 #' @param ownerUUID The UUID of the maternal project to created one.
82 #' @param properties List of the properties of the project.
83 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
85 #' Properties <- list() # should contain a list of new properties to be added
86 #' new_project <- arv$project_create(name = "project name", description = "project description", owner_uuid = "project UUID", properties = NULL, ensureUniqueName = "false")
87 project_create = function(name, description, ownerUUID, properties = NULL, ensureUniqueName = "false")
89 group <- list(name = name, description = description, owner_uuid = ownerUUID, properties = properties)
90 group <- c("group_class" = "project", group)
91 self$groups_create(group, ensureUniqueName = ensureUniqueName)
95 #' project_properties_set is a method defined in Arvados class that enables setting properties. Allows to set or overwrite the properties. In case there are set already it overwrites them.
96 #' @param listProperties List of new properties.
97 #' @param uuid The UUID of a project or a file.
99 #' Properties <- list() # should contain a list of new properties to be added
100 #' arv$project_properties_set(Properties, uuid)
101 project_properties_set = function(listProperties, uuid)
103 group <- c("group_class" = "project", list("properties" = listProperties))
104 self$groups_update(group, uuid)
109 #' project_properties_append is a method defined in Arvados class that enables appending properties. Allows to add new properties.
110 #' @param listOfNewProperties List of new properties.
111 #' @param uuid The UUID of a project or a file.
113 #' newProperties <- list() # should contain a list of new properties to be added
114 #' arv$project_properties_append(properties = newProperties, uuid)
115 project_properties_append = function(properties, uuid)
117 proj <- self$project_list(list(list('uuid', '=', uuid)))
118 projProp <- proj$items[[1]]$properties
120 newListOfProperties <- c(projProp, properties)
121 uniqueProperties <- unique(unlist(newListOfProperties))
122 newListOfProperties <- suppressWarnings(newListOfProperties[which(newListOfProperties == uniqueProperties)])
124 group <- c("group_class" = "project", list("properties" = newListOfProperties))
125 self$groups_update(group, uuid);
130 #' project_properties_get is a method defined in Arvados class that returns properties.
131 #' @param uuid The UUID of a project or a file.
133 #' arv$project_properties_get(projectUUID)
134 project_properties_get = function(uuid)
136 proj <- self$project_list(list(list('uuid', '=', uuid)))
137 proj$items[[1]]$properties
141 #' project_properties_delete is a method defined in Arvados class that deletes list of properties.
142 #' @param oneProp Property to be deleted.
143 #' @param uuid The UUID of a project or a file.
145 #' Properties <- list() # should contain a list of new properties to be added
146 #' arv$project_properties_delete(Properties, projectUUID)
147 project_properties_delete = function(oneProp, uuid)
149 proj <- self$project_list(list(list('uuid', '=', uuid))) # find project
150 projProp <- proj$items[[1]]$properties
151 for (i in 1:length(projProp)){
152 solution <- identical(projProp[i],oneProp)
153 if (solution == TRUE) {
154 projProp <- projProp[names(projProp) != names(oneProp)]
155 self$project_properties_set(projProp, uuid)
161 #' project_update enables updating project. New name, description and properties may be given.
162 #' @param ... Feature to be updated (name, description, properties).
163 #' @param uuid The UUID of a project in question.
165 #' newProperties <- list() # should contain a list of new properties to be added
166 #' arv$project_update(name = "new project name", properties = newProperties, uuid = projectUUID)
167 project_update = function(..., uuid) {
169 for (i in 1:length(vec))
171 if (names(vec[i]) == 'properties') {
172 solution <- self$project_properties_append(vec$properties, uuid = uuid)
175 vecNew <- vec[names(vec) != "properties"]
176 vecNew <- c("group_class" = "project", vecNew)
177 z <- self$groups_update(vecNew, uuid)
181 #' project_list enables listing project by its name, uuid, properties, permissions.
189 #' @param includeTrash Include items whose is_trashed attribute is true.
190 #' @param uuid The UUID of a project in question.
191 #' @param recursive Include contents from child groups recursively.
193 #' listOfprojects <- arv$project_list(list(list("owner_uuid", "=", projectUUID))) # Sample query which show projects within the project of a given UUID
194 project_list = function(filters = NULL, where = NULL,
195 order = NULL, select = NULL, distinct = NULL,
196 limit = "100", offset = "0", count = "exact",
199 filters[[length(filters) + 1]] <- list("group_class", "=", "project")
200 self$groups_list(filters, where, order, select, distinct,
201 limit, offset, count, includeTrash)
205 #' project_delete trashes project of a given uuid. It can be restored from trash or deleted permanently.
206 #' @param uuid The UUID of the Group in question.
207 project_delete = function(uuid)
209 self$groups_delete(uuid)
213 #' api_clients_get is a method defined in Arvados class.
214 #' @param uuid The UUID of the apiClient in question.
215 api_clients_get = function(uuid)
217 endPoint <- stringr::str_interp("api_clients/${uuid}")
218 url <- paste0(private$host, endPoint)
219 headers <- list(Authorization = paste("Bearer", private$token),
220 "Content-Type" = "application/json")
225 response <- private$REST$http$exec("GET", url, headers, body,
226 queryArgs, private$numRetries)
227 resource <- private$REST$httpParser$parseJSONResponse(response)
229 if(!is.null(resource$errors))
230 stop(resource$errors)
236 #' api_clients_create is a method defined in Arvados class.
237 #' @param apiClient apiClient object.
238 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
239 #' @param clusterID Create object on a remote federated cluster instead of the current one.
240 api_clients_create = function(apiClient,
241 ensureUniqueName = "false", clusterID = NULL)
243 endPoint <- stringr::str_interp("api_clients")
244 url <- paste0(private$host, endPoint)
245 headers <- list(Authorization = paste("Bearer", private$token),
246 "Content-Type" = "application/json")
247 queryArgs <- list(ensureUniqueName = ensureUniqueName,
248 clusterID = clusterID)
250 if(length(apiClient) > 0)
251 body <- jsonlite::toJSON(list(apiClient = apiClient),
256 response <- private$REST$http$exec("POST", url, headers, body,
257 queryArgs, private$numRetries)
258 resource <- private$REST$httpParser$parseJSONResponse(response)
260 if(!is.null(resource$errors))
261 stop(resource$errors)
267 #' api_clients_update is a method defined in Arvados class.
268 #' @param apiClient apiClient object.
269 #' @param uuid The UUID of the apiClient in question.
270 api_clients_update = function(apiClient, uuid)
272 endPoint <- stringr::str_interp("api_clients/${uuid}")
273 url <- paste0(private$host, endPoint)
274 headers <- list(Authorization = paste("Bearer", private$token),
275 "Content-Type" = "application/json")
278 if(length(apiClient) > 0)
279 body <- jsonlite::toJSON(list(apiClient = apiClient),
284 response <- private$REST$http$exec("PUT", url, headers, body,
285 queryArgs, private$numRetries)
286 resource <- private$REST$httpParser$parseJSONResponse(response)
288 if(!is.null(resource$errors))
289 stop(resource$errors)
295 #' api_clients_delete is a method defined in Arvados class.
296 #' @param uuid The UUID of the apiClient in question.
297 api_clients_delete = function(uuid)
299 endPoint <- stringr::str_interp("api_clients/${uuid}")
300 url <- paste0(private$host, endPoint)
301 headers <- list(Authorization = paste("Bearer", private$token),
302 "Content-Type" = "application/json")
307 response <- private$REST$http$exec("DELETE", url, headers, body,
308 queryArgs, private$numRetries)
309 resource <- private$REST$httpParser$parseJSONResponse(response)
311 if(!is.null(resource$errors))
312 stop(resource$errors)
318 #' api_clients_list is a method defined in Arvados class.
327 #' @param clusterID List objects on a remote federated cluster instead of the current one.
328 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
329 api_clients_list = function(filters = NULL,
330 where = NULL, order = NULL, select = NULL,
331 distinct = NULL, limit = "100", offset = "0",
332 count = "exact", clusterID = NULL, bypassFederation = NULL)
334 endPoint <- stringr::str_interp("api_clients")
335 url <- paste0(private$host, endPoint)
336 headers <- list(Authorization = paste("Bearer", private$token),
337 "Content-Type" = "application/json")
338 queryArgs <- list(filters = filters, where = where,
339 order = order, select = select, distinct = distinct,
340 limit = limit, offset = offset, count = count,
341 clusterID = clusterID, bypassFederation = bypassFederation)
345 response <- private$REST$http$exec("GET", url, headers, body,
346 queryArgs, private$numRetries)
347 resource <- private$REST$httpParser$parseJSONResponse(response)
349 if(!is.null(resource$errors))
350 stop(resource$errors)
356 #' api_client_authorizations_get is a method defined in Arvados class.
357 #' @param uuid The UUID of the apiClientAuthorization in question.
358 api_client_authorizations_get = function(uuid)
360 endPoint <- stringr::str_interp("api_client_authorizations/${uuid}")
361 url <- paste0(private$host, endPoint)
362 headers <- list(Authorization = paste("Bearer", private$token),
363 "Content-Type" = "application/json")
368 response <- private$REST$http$exec("GET", url, headers, body,
369 queryArgs, private$numRetries)
370 resource <- private$REST$httpParser$parseJSONResponse(response)
372 if(!is.null(resource$errors))
373 stop(resource$errors)
379 #' api_client_authorizations_create is a method defined in Arvados class.
380 #' @param apiClientAuthorization apiClientAuthorization object.
381 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error on (ownerUUID, name) collision_
382 #' @param clusterID Create object on a remote federated cluster instead of the current one.
383 api_client_authorizations_create = function(apiClientAuthorization,
384 ensureUniqueName = "false", clusterID = NULL)
386 endPoint <- stringr::str_interp("api_client_authorizations")
387 url <- paste0(private$host, endPoint)
388 headers <- list(Authorization = paste("Bearer", private$token),
389 "Content-Type" = "application/json")
390 queryArgs <- list(ensureUniqueName = ensureUniqueName,
391 clusterID = clusterID)
393 if(length(apiClientAuthorization) > 0)
394 body <- jsonlite::toJSON(list(apiClientAuthorization = apiClientAuthorization),
399 response <- private$REST$http$exec("POST", url, headers, body,
400 queryArgs, private$numRetries)
401 resource <- private$REST$httpParser$parseJSONResponse(response)
403 if(!is.null(resource$errors))
404 stop(resource$errors)
410 #' api_client_authorizations_update is a method defined in Arvados class.
411 #' @param apiClientAuthorization apiClientAuthorization object.
412 #' @param uuid The UUID of the apiClientAuthorization in question.
413 api_client_authorizations_update = function(apiClientAuthorization, uuid)
415 endPoint <- stringr::str_interp("api_client_authorizations/${uuid}")
416 url <- paste0(private$host, endPoint)
417 headers <- list(Authorization = paste("Bearer", private$token),
418 "Content-Type" = "application/json")
421 if(length(apiClientAuthorization) > 0)
422 body <- jsonlite::toJSON(list(apiClientAuthorization = apiClientAuthorization),
427 response <- private$REST$http$exec("PUT", url, headers, body,
428 queryArgs, private$numRetries)
429 resource <- private$REST$httpParser$parseJSONResponse(response)
431 if(!is.null(resource$errors))
432 stop(resource$errors)
438 #' api_client_authorizations_delete is a method defined in Arvados class.
439 #' @param uuid The UUID of the apiClientAuthorization in question.
440 api_client_authorizations_delete = function(uuid)
442 endPoint <- stringr::str_interp("api_client_authorizations/${uuid}")
443 url <- paste0(private$host, endPoint)
444 headers <- list(Authorization = paste("Bearer", private$token),
445 "Content-Type" = "application/json")
450 response <- private$REST$http$exec("DELETE", url, headers, body,
451 queryArgs, private$numRetries)
452 resource <- private$REST$httpParser$parseJSONResponse(response)
454 if(!is.null(resource$errors))
455 stop(resource$errors)
461 #' api_client_authorizations_create_system_auth is a method defined in Arvados class.
462 #' @param apiClientID
464 api_client_authorizations_create_system_auth = function(apiClientID = NULL, scopes = NULL)
466 endPoint <- stringr::str_interp("api_client_authorizations/create_system_auth")
467 url <- paste0(private$host, endPoint)
468 headers <- list(Authorization = paste("Bearer", private$token),
469 "Content-Type" = "application/json")
470 queryArgs <- list(apiClientID = apiClientID,
475 response <- private$REST$http$exec("POST", url, headers, body,
476 queryArgs, private$numRetries)
477 resource <- private$REST$httpParser$parseJSONResponse(response)
479 if(!is.null(resource$errors))
480 stop(resource$errors)
486 #' api_client_authorizations_current is a method defined in Arvados class.
487 api_client_authorizations_current = function()
489 endPoint <- stringr::str_interp("api_client_authorizations/current")
490 url <- paste0(private$host, endPoint)
491 headers <- list(Authorization = paste("Bearer", private$token),
492 "Content-Type" = "application/json")
497 response <- private$REST$http$exec("GET", url, headers, body,
498 queryArgs, private$numRetries)
499 resource <- private$REST$httpParser$parseJSONResponse(response)
501 if(!is.null(resource$errors))
502 stop(resource$errors)
508 #' api_client_authorizations_list is a method defined in Arvados class.
517 #' @param clusterID List objects on a remote federated cluster instead of the current one.
518 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
519 api_client_authorizations_list = function(filters = NULL,
520 where = NULL, order = NULL, select = NULL,
521 distinct = NULL, limit = "100", offset = "0",
522 count = "exact", clusterID = NULL, bypassFederation = NULL)
524 endPoint <- stringr::str_interp("api_client_authorizations")
525 url <- paste0(private$host, endPoint)
526 headers <- list(Authorization = paste("Bearer", private$token),
527 "Content-Type" = "application/json")
528 queryArgs <- list(filters = filters, where = where,
529 order = order, select = select, distinct = distinct,
530 limit = limit, offset = offset, count = count,
531 clusterID = clusterID, bypassFederation = bypassFederation)
535 response <- private$REST$http$exec("GET", url, headers, body,
536 queryArgs, private$numRetries)
537 resource <- private$REST$httpParser$parseJSONResponse(response)
539 if(!is.null(resource$errors))
540 stop(resource$errors)
546 #' authorized_keys_get is a method defined in Arvados class.
547 #' @param uuid The UUID of the authorizedKey in question.
548 authorized_keys_get = function(uuid)
550 endPoint <- stringr::str_interp("authorized_keys/${uuid}")
551 url <- paste0(private$host, endPoint)
552 headers <- list(Authorization = paste("Bearer", private$token),
553 "Content-Type" = "application/json")
558 response <- private$REST$http$exec("GET", url, headers, body,
559 queryArgs, private$numRetries)
560 resource <- private$REST$httpParser$parseJSONResponse(response)
562 if(!is.null(resource$errors))
563 stop(resource$errors)
569 #' authorized_keys_create is a method defined in Arvados class.
570 #' @param authorizedKey authorizedKey object.
571 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
572 #' @param clusterID Create object on a remote federated cluster instead of the current one.
573 authorized_keys_create = function(authorizedKey,
574 ensureUniqueName = "false", clusterID = NULL)
576 endPoint <- stringr::str_interp("authorized_keys")
577 url <- paste0(private$host, endPoint)
578 headers <- list(Authorization = paste("Bearer", private$token),
579 "Content-Type" = "application/json")
580 queryArgs <- list(ensureUniqueName = ensureUniqueName,
581 clusterID = clusterID)
583 if(length(authorizedKey) > 0)
584 body <- jsonlite::toJSON(list(authorizedKey = authorizedKey),
589 response <- private$REST$http$exec("POST", url, headers, body,
590 queryArgs, private$numRetries)
591 resource <- private$REST$httpParser$parseJSONResponse(response)
593 if(!is.null(resource$errors))
594 stop(resource$errors)
600 #' authorized_keys_update is a method defined in Arvados class.
601 #' @param authorizedKey authorizedKey object.
602 #' @param uuid The UUID of the authorizedKey in question.
603 authorized_keys_update = function(authorizedKey, uuid)
605 endPoint <- stringr::str_interp("authorized_keys/${uuid}")
606 url <- paste0(private$host, endPoint)
607 headers <- list(Authorization = paste("Bearer", private$token),
608 "Content-Type" = "application/json")
611 if(length(authorizedKey) > 0)
612 body <- jsonlite::toJSON(list(authorizedKey = authorizedKey),
617 response <- private$REST$http$exec("PUT", url, headers, body,
618 queryArgs, private$numRetries)
619 resource <- private$REST$httpParser$parseJSONResponse(response)
621 if(!is.null(resource$errors))
622 stop(resource$errors)
628 #' authorized_keys_delete is a method defined in Arvados class.
629 #' @param uuid The UUID of the authorizedKey in question.
630 authorized_keys_delete = function(uuid)
632 endPoint <- stringr::str_interp("authorized_keys/${uuid}")
633 url <- paste0(private$host, endPoint)
634 headers <- list(Authorization = paste("Bearer", private$token),
635 "Content-Type" = "application/json")
640 response <- private$REST$http$exec("DELETE", url, headers, body,
641 queryArgs, private$numRetries)
642 resource <- private$REST$httpParser$parseJSONResponse(response)
644 if(!is.null(resource$errors))
645 stop(resource$errors)
651 #' authorized_keys_list is a method defined in Arvados class.
660 #' @param clusterID List objects on a remote federated cluster instead of the current one.
661 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
662 authorized_keys_list = function(filters = NULL,
663 where = NULL, order = NULL, select = NULL,
664 distinct = NULL, limit = "100", offset = "0",
665 count = "exact", clusterID = NULL, bypassFederation = NULL)
667 endPoint <- stringr::str_interp("authorized_keys")
668 url <- paste0(private$host, endPoint)
669 headers <- list(Authorization = paste("Bearer", private$token),
670 "Content-Type" = "application/json")
671 queryArgs <- list(filters = filters, where = where,
672 order = order, select = select, distinct = distinct,
673 limit = limit, offset = offset, count = count,
674 clusterID = clusterID, bypassFederation = bypassFederation)
678 response <- private$REST$http$exec("GET", url, headers, body,
679 queryArgs, private$numRetries)
680 resource <- private$REST$httpParser$parseJSONResponse(response)
682 if(!is.null(resource$errors))
683 stop(resource$errors)
689 #' collections_get is a method defined in Arvados class.
690 #' @param uuid The UUID of the Collection in question.
691 #' collection <- arv$collections_get(uuid = collectionUUID)
692 collections_get = function(uuid)
694 endPoint <- stringr::str_interp("collections/${uuid}")
695 url <- paste0(private$host, endPoint)
696 headers <- list(Authorization = paste("Bearer", private$token),
697 "Content-Type" = "application/json")
702 response <- private$REST$http$exec("GET", url, headers, body,
703 queryArgs, private$numRetries)
704 resource <- private$REST$httpParser$parseJSONResponse(response)
706 if(!is.null(resource$errors))
707 stop(resource$errors)
713 #' collections_create is a method defined in Arvados class that enables collections creation.
714 #' @param name Name of the collection.
715 #' @param description Description of the collection.
716 #' @param ownerUUID UUID of the maternal project to created one.
717 #' @param properties Properties of the collection.
718 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
719 #' @param clusterID Create object on a remote federated cluster instead of the current one.
721 #' Properties <- list() # should contain a list of new properties to be added
722 #' arv$collections_create(name = "collectionTitle", description = "collectionDescription", ownerUUID = "collectionOwner", properties = Properties)
723 collections_create = function(name, description, ownerUUID = NULL, properties = NULL, # name and description are obligatory
724 ensureUniqueName = "false", clusterID = NULL)
726 endPoint <- stringr::str_interp("collections")
727 url <- paste0(private$host, endPoint)
728 headers <- list(Authorization = paste("Bearer", private$token),
729 "Content-Type" = "application/json")
730 queryArgs <- list(ensureUniqueName = ensureUniqueName,
731 clusterID = clusterID)
733 collection <- list(name = name, description = description, owner_uuid = ownerUUID, properties = properties)
734 if(length(collection) > 0)
735 body <- jsonlite::toJSON(list(collection = collection),
740 response <- private$REST$http$exec("POST", url, headers, body,
741 queryArgs, private$numRetries)
742 resource <- private$REST$httpParser$parseJSONResponse(response)
744 if(!is.null(resource$errors)){
745 if(identical(sub('Entity:.*',"", resource$errors), "//railsapi.internal/arvados/v1/collections: 422 Unprocessable ")){
746 resource <- cat(format("A collection with the given name already exists in this projects. If you want to update it use collections_update() instead"))
748 stop(resource$errors)
756 #' collections_update is a method defined in Arvados class.
757 #' @param name New name of the collection.
758 #' @param description New description of the collection.
759 #' @param ownerUUID UUID of the maternal project to created one.
760 #' @param properties New list of properties of the collection.
761 #' @param uuid The UUID of the Collection in question.
763 #' collection <- arv$collections_update(name = "newCollectionTitle", description = "newCollectionDescription", ownerUUID = "collectionOwner", properties = NULL, uuid = "collectionUUID")
764 collections_update = function(name, description, ownerUUID = NULL, properties = NULL, uuid)
766 endPoint <- stringr::str_interp("collections/${uuid}")
767 url <- paste0(private$host, endPoint)
768 headers <- list(Authorization = paste("Bearer", private$token),
769 "Content-Type" = "application/json")
772 collection <- list(name = name, description = description, ownerUUID = ownerUUID, properties = properties)
773 if(length(collection) > 0)
774 body <- jsonlite::toJSON(list(collection = collection),
779 response <- private$REST$http$exec("PUT", url, headers, body,
780 queryArgs, private$numRetries)
781 resource <- private$REST$httpParser$parseJSONResponse(response)
783 if(!is.null(resource$errors))
784 stop(resource$errors)
790 #' collections_delete is a method defined in Arvados class.
791 #' @param uuid The UUID of the Collection in question.
793 #' arv$collection_delete(collectionUUID)
794 collections_delete = function(uuid)
796 endPoint <- stringr::str_interp("collections/${uuid}")
797 url <- paste0(private$host, endPoint)
798 headers <- list(Authorization = paste("Bearer", private$token),
799 "Content-Type" = "application/json")
804 response <- private$REST$http$exec("DELETE", url, headers, body,
805 queryArgs, private$numRetries)
806 resource <- private$REST$httpParser$parseJSONResponse(response)
808 if(!is.null(resource$errors))
809 stop(resource$errors)
815 #' collections_provenance is a method defined in Arvados class, it returns the collection by uuid.
816 #' @param uuid The UUID of the Collection in question.
818 #' collection <- arv$collections_provenance(collectionUUID)
819 collections_provenance = function(uuid)
821 endPoint <- stringr::str_interp("collections/${uuid}/provenance")
822 url <- paste0(private$host, endPoint)
823 headers <- list(Authorization = paste("Bearer", private$token),
824 "Content-Type" = "application/json")
829 response <- private$REST$http$exec("GET", url, headers, body,
830 queryArgs, private$numRetries)
831 resource <- private$REST$httpParser$parseJSONResponse(response)
833 if(!is.null(resource$errors))
834 stop(resource$errors)
840 #' collections_used_by is a method defined in Arvados class, it returns collection by portable_data_hash.
841 #' @param uuid The UUID of the Collection in question.
842 collections_used_by = function(uuid)
844 endPoint <- stringr::str_interp("collections/${uuid}/used_by")
845 url <- paste0(private$host, endPoint)
846 headers <- list(Authorization = paste("Bearer", private$token),
847 "Content-Type" = "application/json")
852 response <- private$REST$http$exec("GET", url, headers, body,
853 queryArgs, private$numRetries)
854 resource <- private$REST$httpParser$parseJSONResponse(response)
856 if(!is.null(resource$errors))
857 stop(resource$errors)
863 #' collections_trash is a method defined in Arvados class, it moves collection to trash.
864 #' @param uuid The UUID of the Collection in question.
866 #' arv$collections_trash(collectionUUID)
867 collections_trash = function(uuid)
869 endPoint <- stringr::str_interp("collections/${uuid}/trash")
870 url <- paste0(private$host, endPoint)
871 headers <- list(Authorization = paste("Bearer", private$token),
872 "Content-Type" = "application/json")
877 response <- private$REST$http$exec("POST", url, headers, body,
878 queryArgs, private$numRetries)
879 resource <- private$REST$httpParser$parseJSONResponse(response)
881 if(!is.null(resource$errors))
882 stop(resource$errors)
888 #' collections_untrash is a method defined in Arvados class, it moves collection from trash to project.
889 #' @param uuid The UUID of the Collection in question.
891 #' arv$collections_untrash(collectionUUID)
892 collections_untrash = function(uuid)
894 endPoint <- stringr::str_interp("collections/${uuid}/untrash")
895 url <- paste0(private$host, endPoint)
896 headers <- list(Authorization = paste("Bearer", private$token),
897 "Content-Type" = "application/json")
902 response <- private$REST$http$exec("POST", url, headers, body,
903 queryArgs, private$numRetries)
904 resource <- private$REST$httpParser$parseJSONResponse(response)
906 if(!is.null(resource$errors))
907 stop(resource$errors)
913 #' collections_list is a method defined in Arvados class.
922 #' @param clusterID List objects on a remote federated cluster instead of the current one.
923 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
924 #' @param includeTrash Include collections whose is_trashed attribute is true.
925 #' @param includeOldVersions Include past collection versions.
927 #' collectionList <- arv$collections_list(list(list("name", "=", "Example")))
928 collections_list = function(filters = NULL,
929 where = NULL, order = NULL, select = NULL,
930 distinct = NULL, limit = "100", offset = "0",
931 count = "exact", clusterID = NULL, bypassFederation = NULL,
932 includeTrash = NULL, includeOldVersions = NULL)
934 endPoint <- stringr::str_interp("collections")
935 url <- paste0(private$host, endPoint)
936 headers <- list(Authorization = paste("Bearer", private$token),
937 "Content-Type" = "application/json")
938 queryArgs <- list(filters = filters, where = where,
939 order = order, select = select, distinct = distinct,
940 limit = limit, offset = offset, count = count,
941 clusterID = clusterID, bypassFederation = bypassFederation,
942 includeTrash = includeTrash, includeOldVersions = includeOldVersions)
946 response <- private$REST$http$exec("GET", url, headers, body,
947 queryArgs, private$numRetries)
948 resource <- private$REST$httpParser$parseJSONResponse(response)
950 if(!is.null(resource$errors))
951 stop(resource$errors)
957 #' containers_get is a method defined in Arvados class.
958 #' @param uuid The UUID of the Container in question.
959 containers_get = function(uuid)
961 endPoint <- stringr::str_interp("containers/${uuid}")
962 url <- paste0(private$host, endPoint)
963 headers <- list(Authorization = paste("Bearer", private$token),
964 "Content-Type" = "application/json")
969 response <- private$REST$http$exec("GET", url, headers, body,
970 queryArgs, private$numRetries)
971 resource <- private$REST$httpParser$parseJSONResponse(response)
973 if(!is.null(resource$errors))
974 stop(resource$errors)
980 #' containers_create is a method defined in Arvados class.
981 #' @param container Container object.
982 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
983 #' @param clusterID Create object on a remote federated cluster instead of the current one.
984 containers_create = function(container, ensureUniqueName = "false",
987 endPoint <- stringr::str_interp("containers")
988 url <- paste0(private$host, endPoint)
989 headers <- list(Authorization = paste("Bearer", private$token),
990 "Content-Type" = "application/json")
991 queryArgs <- list(ensureUniqueName = ensureUniqueName,
992 clusterID = clusterID)
994 if(length(container) > 0)
995 body <- jsonlite::toJSON(list(container = container),
1000 response <- private$REST$http$exec("POST", url, headers, body,
1001 queryArgs, private$numRetries)
1002 resource <- private$REST$httpParser$parseJSONResponse(response)
1004 if(!is.null(resource$errors))
1005 stop(resource$errors)
1011 #' containers_update is a method defined in Arvados class.
1012 #' @param container Container object.
1013 #' @param uuid The UUID of the Container in question.
1014 containers_update = function(container, uuid)
1016 endPoint <- stringr::str_interp("containers/${uuid}")
1017 url <- paste0(private$host, endPoint)
1018 headers <- list(Authorization = paste("Bearer", private$token),
1019 "Content-Type" = "application/json")
1022 if(length(container) > 0)
1023 body <- jsonlite::toJSON(list(container = container),
1028 response <- private$REST$http$exec("PUT", url, headers, body,
1029 queryArgs, private$numRetries)
1030 resource <- private$REST$httpParser$parseJSONResponse(response)
1032 if(!is.null(resource$errors))
1033 stop(resource$errors)
1039 #' containers_delete is a method defined in Arvados class.
1040 #' @param uuid The UUID of the Container in question.
1041 containers_delete = function(uuid)
1043 endPoint <- stringr::str_interp("containers/${uuid}")
1044 url <- paste0(private$host, endPoint)
1045 headers <- list(Authorization = paste("Bearer", private$token),
1046 "Content-Type" = "application/json")
1051 response <- private$REST$http$exec("DELETE", url, headers, body,
1052 queryArgs, private$numRetries)
1053 resource <- private$REST$httpParser$parseJSONResponse(response)
1055 if(!is.null(resource$errors))
1056 stop(resource$errors)
1062 #' containers_auth is a method defined in Arvados class.
1063 #' @param uuid The UUID of the Container in question.
1064 containers_auth = function(uuid)
1066 endPoint <- stringr::str_interp("containers/${uuid}/auth")
1067 url <- paste0(private$host, endPoint)
1068 headers <- list(Authorization = paste("Bearer", private$token),
1069 "Content-Type" = "application/json")
1074 response <- private$REST$http$exec("GET", url, headers, body,
1075 queryArgs, private$numRetries)
1076 resource <- private$REST$httpParser$parseJSONResponse(response)
1078 if(!is.null(resource$errors))
1079 stop(resource$errors)
1085 #' containers_lock is a method defined in Arvados class.
1086 #' @param uuid The UUID of the Container in question.
1087 containers_lock = function(uuid)
1089 endPoint <- stringr::str_interp("containers/${uuid}/lock")
1090 url <- paste0(private$host, endPoint)
1091 headers <- list(Authorization = paste("Bearer", private$token),
1092 "Content-Type" = "application/json")
1097 response <- private$REST$http$exec("POST", url, headers, body,
1098 queryArgs, private$numRetries)
1099 resource <- private$REST$httpParser$parseJSONResponse(response)
1101 if(!is.null(resource$errors))
1102 stop(resource$errors)
1108 #' containers_unlock is a method defined in Arvados class.
1109 #' @param uuid The UUID of the Container in question.
1110 containers_unlock = function(uuid)
1112 endPoint <- stringr::str_interp("containers/${uuid}/unlock")
1113 url <- paste0(private$host, endPoint)
1114 headers <- list(Authorization = paste("Bearer", private$token),
1115 "Content-Type" = "application/json")
1120 response <- private$REST$http$exec("POST", url, headers, body,
1121 queryArgs, private$numRetries)
1122 resource <- private$REST$httpParser$parseJSONResponse(response)
1124 if(!is.null(resource$errors))
1125 stop(resource$errors)
1131 #' containers_secret_mounts is a method defined in Arvados class.
1132 #' @param uuid The UUID of the Container in question.
1133 containers_secret_mounts = function(uuid)
1135 endPoint <- stringr::str_interp("containers/${uuid}/secret_mounts")
1136 url <- paste0(private$host, endPoint)
1137 headers <- list(Authorization = paste("Bearer", private$token),
1138 "Content-Type" = "application/json")
1143 response <- private$REST$http$exec("GET", url, headers, body,
1144 queryArgs, private$numRetries)
1145 resource <- private$REST$httpParser$parseJSONResponse(response)
1147 if(!is.null(resource$errors))
1148 stop(resource$errors)
1154 #' containers_current is a method defined in Arvados class.
1155 containers_current = function()
1157 endPoint <- stringr::str_interp("containers/current")
1158 url <- paste0(private$host, endPoint)
1159 headers <- list(Authorization = paste("Bearer", private$token),
1160 "Content-Type" = "application/json")
1165 response <- private$REST$http$exec("GET", url, headers, body,
1166 queryArgs, private$numRetries)
1167 resource <- private$REST$httpParser$parseJSONResponse(response)
1169 if(!is.null(resource$errors))
1170 stop(resource$errors)
1176 #' containers_list is a method defined in Arvados class.
1185 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1186 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
1187 containers_list = function(filters = NULL,
1188 where = NULL, order = NULL, select = NULL,
1189 distinct = NULL, limit = "100", offset = "0",
1190 count = "exact", clusterID = NULL, bypassFederation = NULL)
1192 endPoint <- stringr::str_interp("containers")
1193 url <- paste0(private$host, endPoint)
1194 headers <- list(Authorization = paste("Bearer", private$token),
1195 "Content-Type" = "application/json")
1196 queryArgs <- list(filters = filters, where = where,
1197 order = order, select = select, distinct = distinct,
1198 limit = limit, offset = offset, count = count,
1199 clusterID = clusterID, bypassFederation = bypassFederation)
1203 response <- private$REST$http$exec("GET", url, headers, body,
1204 queryArgs, private$numRetries)
1205 resource <- private$REST$httpParser$parseJSONResponse(response)
1207 if(!is.null(resource$errors))
1208 stop(resource$errors)
1214 #' container_requests_get is a method defined in Arvados class.
1215 #' @param uuid The UUID of the containerRequest in question.
1216 container_requests_get = function(uuid)
1218 endPoint <- stringr::str_interp("container_requests/${uuid}")
1219 url <- paste0(private$host, endPoint)
1220 headers <- list(Authorization = paste("Bearer", private$token),
1221 "Content-Type" = "application/json")
1226 response <- private$REST$http$exec("GET", url, headers, body,
1227 queryArgs, private$numRetries)
1228 resource <- private$REST$httpParser$parseJSONResponse(response)
1230 if(!is.null(resource$errors))
1231 stop(resource$errors)
1237 #' container_requests_create is a method defined in Arvados class.
1238 #' @param containerRequest containerRequest object.
1239 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
1240 #' @param clusterID Create object on a remote federated cluster instead of the current one.
1241 container_requests_create = function(containerRequest,
1242 ensureUniqueName = "false", clusterID = NULL)
1244 endPoint <- stringr::str_interp("container_requests")
1245 url <- paste0(private$host, endPoint)
1246 headers <- list(Authorization = paste("Bearer", private$token),
1247 "Content-Type" = "application/json")
1248 queryArgs <- list(ensureUniqueName = ensureUniqueName,
1249 clusterID = clusterID)
1251 if(length(containerRequest) > 0)
1252 body <- jsonlite::toJSON(list(containerRequest = containerRequest),
1257 response <- private$REST$http$exec("POST", url, headers, body,
1258 queryArgs, private$numRetries)
1259 resource <- private$REST$httpParser$parseJSONResponse(response)
1261 if(!is.null(resource$errors))
1262 stop(resource$errors)
1268 #' container_requests_update is a method defined in Arvados class.
1269 #' @param containerRequest containerRequest object.
1270 #' @param uuid The UUID of the containerRequest in question.
1271 container_requests_update = function(containerRequest, uuid)
1273 endPoint <- stringr::str_interp("container_requests/${uuid}")
1274 url <- paste0(private$host, endPoint)
1275 headers <- list(Authorization = paste("Bearer", private$token),
1276 "Content-Type" = "application/json")
1279 if(length(containerRequest) > 0)
1280 body <- jsonlite::toJSON(list(containerRequest = containerRequest),
1285 response <- private$REST$http$exec("PUT", url, headers, body,
1286 queryArgs, private$numRetries)
1287 resource <- private$REST$httpParser$parseJSONResponse(response)
1289 if(!is.null(resource$errors))
1290 stop(resource$errors)
1296 #' container_requests_delete is a method defined in Arvados class.
1297 #' @param uuid The UUID of the containerRequest in question.
1298 container_requests_delete = function(uuid)
1300 endPoint <- stringr::str_interp("container_requests/${uuid}")
1301 url <- paste0(private$host, endPoint)
1302 headers <- list(Authorization = paste("Bearer", private$token),
1303 "Content-Type" = "application/json")
1308 response <- private$REST$http$exec("DELETE", url, headers, body,
1309 queryArgs, private$numRetries)
1310 resource <- private$REST$httpParser$parseJSONResponse(response)
1312 if(!is.null(resource$errors))
1313 stop(resource$errors)
1319 #' container_requests_list is a method defined in Arvados class.
1328 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1329 #' @param bypassFederation bypass federation behavior, list items from local instance database only
1330 #' @param includeTrash Include container requests whose owner project is trashed.
1331 container_requests_list = function(filters = NULL,
1332 where = NULL, order = NULL, select = NULL,
1333 distinct = NULL, limit = "100", offset = "0",
1334 count = "exact", clusterID = NULL, bypassFederation = NULL,
1335 includeTrash = NULL)
1337 endPoint <- stringr::str_interp("container_requests")
1338 url <- paste0(private$host, endPoint)
1339 headers <- list(Authorization = paste("Bearer", private$token),
1340 "Content-Type" = "application/json")
1341 queryArgs <- list(filters = filters, where = where,
1342 order = order, select = select, distinct = distinct,
1343 limit = limit, offset = offset, count = count,
1344 clusterID = clusterID, bypassFederation = bypassFederation,
1345 includeTrash = includeTrash)
1349 response <- private$REST$http$exec("GET", url, headers, body,
1350 queryArgs, private$numRetries)
1351 resource <- private$REST$httpParser$parseJSONResponse(response)
1353 if(!is.null(resource$errors))
1354 stop(resource$errors)
1360 #' groups_get is a method defined in Arvados class.
1361 #' @param uuid The UUID of the Group in question.
1362 groups_get = function(uuid)
1364 endPoint <- stringr::str_interp("groups/${uuid}")
1365 url <- paste0(private$host, endPoint)
1366 headers <- list(Authorization = paste("Bearer", private$token),
1367 "Content-Type" = "application/json")
1373 response <- private$REST$http$exec("GET", url, headers, body,
1374 queryArgs, private$numRetries)
1375 resource <- private$REST$httpParser$parseJSONResponse(response)
1377 if(!is.null(resource$errors))
1378 stop(resource$errors)
1384 #' groups_create is a method defined in Arvados class that supports project creation.
1385 #' @param group Group object.
1386 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
1387 #' @param clusterID Create object on a remote federated cluster instead of the current one.
1388 #' @param async Defer permissions update.
1389 groups_create = function(group, ensureUniqueName = "false",
1390 clusterID = NULL, async = "false")
1392 endPoint <- stringr::str_interp("groups")
1393 url <- paste0(private$host, endPoint)
1394 headers <- list(Authorization = paste("Bearer", private$token),
1395 "Content-Type" = "application/json")
1397 queryArgs <- list(ensureUniqueName = ensureUniqueName,
1398 clusterID = clusterID, async = async)
1400 if(length(group) > 0)
1401 body <- jsonlite::toJSON(list(group = group),
1406 response <- private$REST$http$exec("POST", url, headers, body,
1407 queryArgs, private$numRetries)
1409 resource <- private$REST$httpParser$parseJSONResponse(response)
1411 if(!is.null(resource$errors)){
1412 if (identical(sub('#.*', "", resource$errors), "//railsapi.internal/arvados/v1/groups: 422 Unprocessable Entity: ")) {
1413 #if (identical(sub('P.*', "", resource$errors), "//railsapi.internal/arvados/v1/groups: 422 Unprocessable Entity: #\u003cActiveRecord::RecordNotUnique: ")) {
1414 resource <- cat(format("Project of that name already exist. If you want to update it use project_update() instead"))
1416 stop(resource$errors)
1424 #' groups_update is a method defined in Arvados class.
1425 #' @param group Group object.
1426 #' @param uuid The UUID of the Group in question.
1427 #' @param async Defer permissions update.
1428 groups_update = function(group, uuid, async = "false")
1430 endPoint <- stringr::str_interp("groups/${uuid}")
1431 url <- paste0(private$host, endPoint)
1432 headers <- list(Authorization = paste("Bearer", private$token),
1433 "Content-Type" = "application/json")
1435 queryArgs <- list(async = async)
1437 if(length(group) > 0)
1438 body <- jsonlite::toJSON(list(group = group),
1443 response <- private$REST$http$exec("PUT", url, headers, body,
1444 queryArgs, private$numRetries)
1445 resource <- private$REST$httpParser$parseJSONResponse(response)
1447 if(!is.null(resource$errors))
1448 stop(resource$errors)
1454 #' groups_delete is a method defined in Arvados class.
1455 #' @param uuid The UUID of the Group in question.
1456 groups_delete = function(uuid)
1458 endPoint <- stringr::str_interp("groups/${uuid}")
1459 url <- paste0(private$host, endPoint)
1460 headers <- list(Authorization = paste("Bearer", private$token),
1461 "Content-Type" = "application/json")
1467 response <- private$REST$http$exec("DELETE", url, headers, body,
1468 queryArgs, private$numRetries)
1469 resource <- private$REST$httpParser$parseJSONResponse(response)
1471 if(!is.null(resource$errors))
1472 stop(resource$errors)
1474 dataTime <- gsub("T.*", "", resource$delete_at)
1475 cat("The content will be deleted permanently at", dataTime)
1481 #' groups_contents is a method defined in Arvados class.
1489 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1490 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
1491 #' @param includeTrash Include items whose is_trashed attribute is true.
1493 #' @param recursive Include contents from child groups recursively.
1494 #' @param include Include objects referred to by listed field in "included" (only ownerUUID).
1495 groups_contents = function(filters = NULL,
1496 where = NULL, order = NULL, distinct = NULL,
1497 limit = "100", offset = "0", count = "exact",
1498 clusterID = NULL, bypassFederation = NULL,
1499 includeTrash = NULL, uuid = NULL, recursive = NULL,
1502 endPoint <- stringr::str_interp("groups/contents")
1503 url <- paste0(private$host, endPoint)
1504 headers <- list(Authorization = paste("Bearer", private$token),
1505 "Content-Type" = "application/json")
1507 queryArgs <- list(filters = filters, where = where,
1508 order = order, distinct = distinct, limit = limit,
1509 offset = offset, count = count, clusterID = clusterID,
1510 bypassFederation = bypassFederation, includeTrash = includeTrash,
1511 uuid = uuid, recursive = recursive, include = include)
1515 response <- private$REST$http$exec("GET", url, headers, body,
1516 queryArgs, private$numRetries)
1517 resource <- private$REST$httpParser$parseJSONResponse(response)
1519 if(!is.null(resource$errors))
1520 stop(resource$errors)
1526 #' groups_shared is a method defined in Arvados class.
1535 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1536 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
1537 #' @param includeTrash Include items whose is_trashed attribute is true.
1539 groups_shared = function(filters = NULL,
1540 where = NULL, order = NULL, select = NULL,
1541 distinct = NULL, limit = "100", offset = "0",
1542 count = "exact", clusterID = NULL, bypassFederation = NULL,
1543 includeTrash = NULL, include = NULL)
1545 endPoint <- stringr::str_interp("groups/shared")
1546 url <- paste0(private$host, endPoint)
1547 headers <- list(Authorization = paste("Bearer", private$token),
1548 "Content-Type" = "application/json")
1550 queryArgs <- list(filters = filters, where = where,
1551 order = order, select = select, distinct = distinct,
1552 limit = limit, offset = offset, count = count,
1553 clusterID = clusterID, bypassFederation = bypassFederation,
1554 includeTrash = includeTrash, include = include)
1558 response <- private$REST$http$exec("GET", url, headers, body,
1559 queryArgs, private$numRetries)
1560 resource <- private$REST$httpParser$parseJSONResponse(response)
1562 if(!is.null(resource$errors))
1563 stop(resource$errors)
1569 #' groups_trash is a method defined in Arvados class.
1570 #' @param uuid The UUID of the Group in question.
1571 groups_trash = function(uuid)
1573 endPoint <- stringr::str_interp("groups/${uuid}/trash")
1574 url <- paste0(private$host, endPoint)
1575 headers <- list(Authorization = paste("Bearer", private$token),
1576 "Content-Type" = "application/json")
1582 response <- private$REST$http$exec("POST", url, headers, body,
1583 queryArgs, private$numRetries)
1584 resource <- private$REST$httpParser$parseJSONResponse(response)
1586 if(!is.null(resource$errors))
1587 stop(resource$errors)
1593 #' groups_untrash is a method defined in Arvados class.
1594 #' @param uuid The UUID of the Group in question.
1595 groups_untrash = function(uuid)
1597 endPoint <- stringr::str_interp("groups/${uuid}/untrash")
1598 url <- paste0(private$host, endPoint)
1599 headers <- list(Authorization = paste("Bearer", private$token),
1600 "Content-Type" = "application/json")
1606 response <- private$REST$http$exec("POST", url, headers, body,
1607 queryArgs, private$numRetries)
1608 resource <- private$REST$httpParser$parseJSONResponse(response)
1610 if(!is.null(resource$errors))
1611 stop(resource$errors)
1617 #' groups_list is a method defined in Arvados class.
1626 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1627 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
1628 #' @param includeTrash Include items whose is_trashed attribute is true.
1629 groups_list = function(filters = NULL, where = NULL,
1630 order = NULL, select = NULL, distinct = NULL,
1631 limit = "100", offset = "0", count = "exact",
1632 clusterID = NULL, bypassFederation = NULL,
1633 includeTrash = NULL)
1635 endPoint <- stringr::str_interp("groups")
1636 url <- paste0(private$host, endPoint)
1637 headers <- list(Authorization = paste("Bearer", private$token),
1638 "Content-Type" = "application/json")
1640 queryArgs <- list(filters = filters, where = where,
1641 order = order, select = select, distinct = distinct,
1642 limit = limit, offset = offset, count = count,
1643 clusterID = clusterID, bypassFederation = bypassFederation,
1644 includeTrash = includeTrash)
1648 response <- private$REST$http$exec("GET", url, headers, body,
1649 queryArgs, private$numRetries)
1650 resource <- private$REST$httpParser$parseJSONResponse(response)
1652 if(!is.null(resource$errors))
1653 stop(resource$errors)
1659 #' keep_services_get is a method defined in Arvados class.
1660 #' @param uuid The UUID of the keepService in question.
1661 keep_services_get = function(uuid)
1663 endPoint <- stringr::str_interp("keep_services/${uuid}")
1664 url <- paste0(private$host, endPoint)
1665 headers <- list(Authorization = paste("Bearer", private$token),
1666 "Content-Type" = "application/json")
1671 response <- private$REST$http$exec("GET", url, headers, body,
1672 queryArgs, private$numRetries)
1673 resource <- private$REST$httpParser$parseJSONResponse(response)
1675 if(!is.null(resource$errors))
1676 stop(resource$errors)
1682 #' keep_services_create is a method defined in Arvados class.
1683 #' @param keepService keepService object.
1684 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
1685 #' @param clusterID Create object on a remote federated cluster instead of the current one.
1686 keep_services_create = function(keepService,
1687 ensureUniqueName = "false", clusterID = NULL)
1689 endPoint <- stringr::str_interp("keep_services")
1690 url <- paste0(private$host, endPoint)
1691 headers <- list(Authorization = paste("Bearer", private$token),
1692 "Content-Type" = "application/json")
1693 queryArgs <- list(ensureUniqueName = ensureUniqueName,
1694 clusterID = clusterID)
1696 if(length(keepService) > 0)
1697 body <- jsonlite::toJSON(list(keepService = keepService),
1702 response <- private$REST$http$exec("POST", url, headers, body,
1703 queryArgs, private$numRetries)
1704 resource <- private$REST$httpParser$parseJSONResponse(response)
1706 if(!is.null(resource$errors))
1707 stop(resource$errors)
1713 #' keep_services_update is a method defined in Arvados class.
1714 #' @param keepService keepService object.
1715 #' @param uuid The UUID of the keepService in question.
1716 keep_services_update = function(keepService, uuid)
1718 endPoint <- stringr::str_interp("keep_services/${uuid}")
1719 url <- paste0(private$host, endPoint)
1720 headers <- list(Authorization = paste("Bearer", private$token),
1721 "Content-Type" = "application/json")
1724 if(length(keepService) > 0)
1725 body <- jsonlite::toJSON(list(keepService = keepService),
1730 response <- private$REST$http$exec("PUT", url, headers, body,
1731 queryArgs, private$numRetries)
1732 resource <- private$REST$httpParser$parseJSONResponse(response)
1734 if(!is.null(resource$errors))
1735 stop(resource$errors)
1741 #' keep_services_delete is a method defined in Arvados class.
1742 #' @param uuid The UUID of the keepService in question.
1743 keep_services_delete = function(uuid)
1745 endPoint <- stringr::str_interp("keep_services/${uuid}")
1746 url <- paste0(private$host, endPoint)
1747 headers <- list(Authorization = paste("Bearer", private$token),
1748 "Content-Type" = "application/json")
1753 response <- private$REST$http$exec("DELETE", url, headers, body,
1754 queryArgs, private$numRetries)
1755 resource <- private$REST$httpParser$parseJSONResponse(response)
1757 if(!is.null(resource$errors))
1758 stop(resource$errors)
1764 #' keep_services_accessible is a method defined in Arvados class.
1765 keep_services_accessible = function()
1767 endPoint <- stringr::str_interp("keep_services/accessible")
1768 url <- paste0(private$host, endPoint)
1769 headers <- list(Authorization = paste("Bearer", private$token),
1770 "Content-Type" = "application/json")
1775 response <- private$REST$http$exec("GET", url, headers, body,
1776 queryArgs, private$numRetries)
1777 resource <- private$REST$httpParser$parseJSONResponse(response)
1779 if(!is.null(resource$errors))
1780 stop(resource$errors)
1786 #' keep_services_list is a method defined in Arvados class.
1795 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1796 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
1797 keep_services_list = function(filters = NULL,
1798 where = NULL, order = NULL, select = NULL,
1799 distinct = NULL, limit = "100", offset = "0",
1800 count = "exact", clusterID = NULL, bypassFederation = NULL)
1802 endPoint <- stringr::str_interp("keep_services")
1803 url <- paste0(private$host, endPoint)
1804 headers <- list(Authorization = paste("Bearer", private$token),
1805 "Content-Type" = "application/json")
1806 queryArgs <- list(filters = filters, where = where,
1807 order = order, select = select, distinct = distinct,
1808 limit = limit, offset = offset, count = count,
1809 clusterID = clusterID, bypassFederation = bypassFederation)
1813 response <- private$REST$http$exec("GET", url, headers, body,
1814 queryArgs, private$numRetries)
1815 resource <- private$REST$httpParser$parseJSONResponse(response)
1817 if(!is.null(resource$errors))
1818 stop(resource$errors)
1824 #' project_permission_give is a method defined in Arvados class that enables sharing files with another users.
1825 #' @param type Possible options are can_read or can_write or can_manage.
1826 #' @param uuid The UUID of a project or a file.
1827 #' @param user The UUID of the person that gets the permission.
1829 #' arv$project_permission_give(type = "can_read", uuid = objectUUID, user = userUUID)
1830 project_permission_give = function(type, uuid, user)
1832 endPoint <- stringr::str_interp("links")
1833 url <- paste0(private$host, endPoint)
1834 headers <- list(Authorization = paste("Bearer", private$token),
1835 "Content-Type" = "application/json")
1838 # it is possible to make it as pasting a list to function, not a 3 arg. What's better?
1839 link <- list("link_class" = "permission", "name" = type, "head_uuid" = uuid, "tail_uuid" = user)
1841 if(length(link) > 0)
1842 body <- jsonlite::toJSON(list(link = link),
1847 response <- private$REST$http$exec("POST", url, headers, body,
1848 queryArgs, private$numRetries)
1849 resource <- private$REST$httpParser$parseJSONResponse(response)
1851 if(!is.null(resource$errors))
1852 stop(resource$errors)
1858 #' project_permission_refuse is a method defined in Arvados class that unables sharing files with another users.
1859 #' @param type Possible options are can_read or can_write or can_manage.
1860 #' @param uuid The UUID of a project or a file.
1861 #' @param user The UUID of a person that permissions are taken from.
1863 #' arv$project_permission_refuse(type = "can_read", uuid = objectUUID, user = userUUID)
1864 project_permission_refuse = function(type, uuid, user)
1866 examples <- self$links_list(list(list("head_uuid","=", uuid)))
1868 theUser <- examples[which(sapply(examples$items, "[[", "tail_uuid") == user)]
1869 theType <- theUser$items[which(sapply(theUser$items, "[[", "name") == type)]
1870 solution <- theType[which(sapply(theType, "[[", "link_class") == 'permission')]
1872 if (length(solution) == 0) {
1873 cat(format('No permission granted'))
1875 self$links_delete(solution[[1]]$uuid)
1881 #' project_permission_update is a method defined in Arvados class that enables updating permissions.
1882 #' @param typeNew New option like can_read or can_write or can_manage.
1883 #' @param typeOld Old option.
1884 #' @param uuid The UUID of a project or a file.
1885 #' @param user The UUID of the person that the permission is being updated.
1887 #' arv$project_permission_update(typeOld = "can_read", typeNew = "can_write", uuid = objectUUID, user = userUUID)
1888 project_permission_update = function(typeOld, typeNew, uuid, user)
1890 link <- list("name" = typeNew)
1892 examples <- self$links_list(list(list("head_uuid","=", uuid)))
1894 theUser <- examples[which(sapply(examples$items, "[[", "tail_uuid") == user)]
1895 theType <- theUser$items[which(sapply(theUser$items, "[[", "name") == typeOld)]
1896 solution <- theType[which(sapply(theType, "[[", "link_class") == 'permission')]
1898 if (length(solution) == 0) {
1899 cat(format('No permission granted'))
1901 self$links_update(link, solution[[1]]$uuid)
1906 #' project_permission_check is a method defined in Arvados class that enables checking file permissions.
1907 #' @param uuid The UUID of a project or a file.
1908 #' @param user The UUID of the person that the permission is being updated.
1909 #' @param type Possible options are can_read or can_write or can_manage.
1911 #' arv$project_permission_check(type = "can_read", uuid = objectUUID, user = userUUID)
1912 project_permission_check = function(uuid, user, type = NULL)
1914 examples <- self$links_list(list(list("head_uuid","=", uuid)))
1916 theUser <- examples[which(sapply(examples$items, "[[", "tail_uuid") == user)]
1918 if (length(type) == 0 ){
1921 theType <- theUser$items[which(sapply(theUser$items, "[[", "name") == type)]
1922 permisions <- theType[which(sapply(theType, "[[", "link_class") == 'permission')]
1923 print(permisions[[1]]$name)
1928 #' links_get is a method defined in Arvados class.
1929 #' @param uuid The UUID of the Link in question.
1930 links_get = function(uuid)
1932 endPoint <- stringr::str_interp("links/${uuid}")
1933 url <- paste0(private$host, endPoint)
1934 headers <- list(Authorization = paste("Bearer", private$token),
1935 "Content-Type" = "application/json")
1940 response <- private$REST$http$exec("GET", url, headers, body,
1941 queryArgs, private$numRetries)
1942 resource <- private$REST$httpParser$parseJSONResponse(response)
1944 if(!is.null(resource$errors))
1945 stop(resource$errors)
1951 #' links_create is a method defined in Arvados class.
1952 #' @param link Link object.
1953 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
1954 #' @param clusterID Create object on a remote federated cluster instead of the current one.
1955 links_create = function(link, ensureUniqueName = "false",
1958 endPoint <- stringr::str_interp("links")
1959 url <- paste0(private$host, endPoint)
1960 headers <- list(Authorization = paste("Bearer", private$token),
1961 "Content-Type" = "application/json")
1962 queryArgs <- list(ensureUniqueName = ensureUniqueName,
1963 clusterID = clusterID)
1965 if(length(link) > 0)
1966 body <- jsonlite::toJSON(list(link = link),
1971 response <- private$REST$http$exec("POST", url, headers, body,
1972 queryArgs, private$numRetries)
1973 resource <- private$REST$httpParser$parseJSONResponse(response)
1975 if(!is.null(resource$errors))
1976 stop(resource$errors)
1982 #' links_update is a method defined in Arvados class.
1983 #' @param link Link object.
1984 #' @param uuid The UUID of the Link in question.
1985 links_update = function(link, uuid, async = "false")
1987 endPoint <- stringr::str_interp("links/${uuid}")
1988 url <- paste0(private$host, endPoint)
1989 headers <- list(Authorization = paste("Bearer", private$token),
1990 "Content-Type" = "application/json")
1991 queryArgs <- list(async = async)
1993 if(length(link) > 0)
1994 body <- jsonlite::toJSON(list(link = link),
1999 response <- private$REST$http$exec("PUT", url, headers, body,
2000 queryArgs, private$numRetries)
2001 resource <- private$REST$httpParser$parseJSONResponse(response)
2003 if(!is.null(resource$errors))
2004 stop(resource$errors)
2010 #' links_delete is a method defined in Arvados class.
2011 #' @param uuid The UUID of the Link in question.
2012 links_delete = function(uuid)
2014 endPoint <- stringr::str_interp("links/${uuid}")
2015 url <- paste0(private$host, endPoint)
2016 headers <- list(Authorization = paste("Bearer", private$token),
2017 "Content-Type" = "application/json")
2022 response <- private$REST$http$exec("DELETE", url, headers, body,
2023 queryArgs, private$numRetries)
2024 resource <- private$REST$httpParser$parseJSONResponse(response)
2026 if(!is.null(resource$errors))
2027 stop(resource$errors)
2033 #' links_list is a method defined in Arvados class.
2042 #' @param clusterID List objects on a remote federated cluster instead of the current one.
2043 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
2044 links_list = function(filters = NULL, where = NULL,
2045 order = NULL, select = NULL, distinct = NULL,
2046 limit = "100", offset = "0", count = "exact",
2047 clusterID = NULL, bypassFederation = NULL)
2049 endPoint <- stringr::str_interp("links")
2050 url <- paste0(private$host, endPoint)
2051 headers <- list(Authorization = paste("Bearer", private$token),
2052 "Content-Type" = "application/json")
2053 queryArgs <- list(filters = filters, where = where,
2054 order = order, select = select, distinct = distinct,
2055 limit = limit, offset = offset, count = count,
2056 clusterID = clusterID, bypassFederation = bypassFederation)
2060 response <- private$REST$http$exec("GET", url, headers, body,
2061 queryArgs, private$numRetries)
2062 resource <- private$REST$httpParser$parseJSONResponse(response)
2064 if(!is.null(resource$errors))
2065 stop(resource$errors)
2071 #' links_get_permissions is a method defined in Arvados class.
2072 #' @param uuid The UUID of the Log in question.
2073 links_get_permissions = function(uuid)
2075 endPoint <- stringr::str_interp("permissions/${uuid}")
2076 url <- paste0(private$host, endPoint)
2077 headers <- list(Authorization = paste("Bearer", private$token),
2078 "Content-Type" = "application/json")
2083 response <- private$REST$http$exec("GET", url, headers, body,
2084 queryArgs, private$numRetries)
2085 resource <- private$REST$httpParser$parseJSONResponse(response)
2087 if(!is.null(resource$errors))
2088 stop(resource$errors)
2094 #' logs_get is a method defined in Arvados class.
2095 #' @param uuid The UUID of the Log in question.
2096 logs_get = function(uuid)
2098 endPoint <- stringr::str_interp("logs/${uuid}")
2099 url <- paste0(private$host, endPoint)
2100 headers <- list(Authorization = paste("Bearer", private$token),
2101 "Content-Type" = "application/json")
2106 response <- private$REST$http$exec("GET", url, headers, body,
2107 queryArgs, private$numRetries)
2108 resource <- private$REST$httpParser$parseJSONResponse(response)
2110 if(!is.null(resource$errors))
2111 stop(resource$errors)
2117 #' logs_create is a method defined in Arvados class.
2118 #' @param log Log object.
2119 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2120 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2121 logs_create = function(log, ensureUniqueName = "false",
2124 endPoint <- stringr::str_interp("logs")
2125 url <- paste0(private$host, endPoint)
2126 headers <- list(Authorization = paste("Bearer", private$token),
2127 "Content-Type" = "application/json")
2128 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2129 clusterID = clusterID)
2132 body <- jsonlite::toJSON(list(log = log),
2137 response <- private$REST$http$exec("POST", url, headers, body,
2138 queryArgs, private$numRetries)
2139 resource <- private$REST$httpParser$parseJSONResponse(response)
2141 if(!is.null(resource$errors))
2142 stop(resource$errors)
2148 #' logs_update is a method defined in Arvados class.
2149 #' @param log Log object.
2150 #' @param uuid The UUID of the Log in question.
2151 logs_update = function(log, uuid)
2153 endPoint <- stringr::str_interp("logs/${uuid}")
2154 url <- paste0(private$host, endPoint)
2155 headers <- list(Authorization = paste("Bearer", private$token),
2156 "Content-Type" = "application/json")
2160 body <- jsonlite::toJSON(list(log = log),
2165 response <- private$REST$http$exec("PUT", url, headers, body,
2166 queryArgs, private$numRetries)
2167 resource <- private$REST$httpParser$parseJSONResponse(response)
2169 if(!is.null(resource$errors))
2170 stop(resource$errors)
2176 #' logs_delete is a method defined in Arvados class.
2177 #' @param uuid The UUID of the Log in question.
2178 logs_delete = function(uuid)
2180 endPoint <- stringr::str_interp("logs/${uuid}")
2181 url <- paste0(private$host, endPoint)
2182 headers <- list(Authorization = paste("Bearer", private$token),
2183 "Content-Type" = "application/json")
2188 response <- private$REST$http$exec("DELETE", url, headers, body,
2189 queryArgs, private$numRetries)
2190 resource <- private$REST$httpParser$parseJSONResponse(response)
2192 if(!is.null(resource$errors))
2193 stop(resource$errors)
2199 #' logs_list is a method defined in Arvados class.
2208 #' @param clusterID List objects on a remote federated cluster instead of the current one.
2209 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
2210 logs_list = function(filters = NULL, where = NULL,
2211 order = NULL, select = NULL, distinct = NULL,
2212 limit = "100", offset = "0", count = "exact",
2213 clusterID = NULL, bypassFederation = NULL)
2215 endPoint <- stringr::str_interp("logs")
2216 url <- paste0(private$host, endPoint)
2217 headers <- list(Authorization = paste("Bearer", private$token),
2218 "Content-Type" = "application/json")
2219 queryArgs <- list(filters = filters, where = where,
2220 order = order, select = select, distinct = distinct,
2221 limit = limit, offset = offset, count = count,
2222 clusterID = clusterID, bypassFederation = bypassFederation)
2226 response <- private$REST$http$exec("GET", url, headers, body,
2227 queryArgs, private$numRetries)
2228 resource <- private$REST$httpParser$parseJSONResponse(response)
2230 if(!is.null(resource$errors))
2231 stop(resource$errors)
2237 #' users_get is a method defined in Arvados class.
2238 #' @param uuid The UUID of the User in question.
2239 users_get = function(uuid)
2241 endPoint <- stringr::str_interp("users/${uuid}")
2242 url <- paste0(private$host, endPoint)
2243 headers <- list(Authorization = paste("Bearer", private$token),
2244 "Content-Type" = "application/json")
2249 response <- private$REST$http$exec("GET", url, headers, body,
2250 queryArgs, private$numRetries)
2251 resource <- private$REST$httpParser$parseJSONResponse(response)
2253 if(!is.null(resource$errors))
2254 stop(resource$errors)
2260 #' users_create is a method defined in Arvados class.
2261 #' @param user User object.
2262 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2263 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2264 users_create = function(user, ensureUniqueName = "false",
2267 endPoint <- stringr::str_interp("users")
2268 url <- paste0(private$host, endPoint)
2269 headers <- list(Authorization = paste("Bearer", private$token),
2270 "Content-Type" = "application/json")
2271 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2272 clusterID = clusterID)
2274 if(length(user) > 0)
2275 body <- jsonlite::toJSON(list(user = user),
2280 response <- private$REST$http$exec("POST", url, headers, body,
2281 queryArgs, private$numRetries)
2282 resource <- private$REST$httpParser$parseJSONResponse(response)
2284 if(!is.null(resource$errors))
2285 stop(resource$errors)
2291 #' users_update is a method defined in Arvados class.
2292 #' @param user User object.
2293 #' @param uuid The UUID of the User in question.
2294 #' @param bypassFederation
2295 users_update = function(user, uuid, bypassFederation = NULL)
2297 endPoint <- stringr::str_interp("users/${uuid}")
2298 url <- paste0(private$host, endPoint)
2299 headers <- list(Authorization = paste("Bearer", private$token),
2300 "Content-Type" = "application/json")
2301 queryArgs <- list(bypassFederation = bypassFederation)
2303 if(length(user) > 0)
2304 body <- jsonlite::toJSON(list(user = user),
2309 response <- private$REST$http$exec("PUT", url, headers, body,
2310 queryArgs, private$numRetries)
2311 resource <- private$REST$httpParser$parseJSONResponse(response)
2313 if(!is.null(resource$errors))
2314 stop(resource$errors)
2320 #' users_delete is a method defined in Arvados class.
2321 #' @param uuid The UUID of the User in question.
2322 users_delete = function(uuid)
2324 endPoint <- stringr::str_interp("users/${uuid}")
2325 url <- paste0(private$host, endPoint)
2326 headers <- list(Authorization = paste("Bearer", private$token),
2327 "Content-Type" = "application/json")
2332 response <- private$REST$http$exec("DELETE", url, headers, body,
2333 queryArgs, private$numRetries)
2334 resource <- private$REST$httpParser$parseJSONResponse(response)
2336 if(!is.null(resource$errors))
2337 stop(resource$errors)
2343 #' users_current is a method defined in Arvados class.
2344 users_current = function()
2346 endPoint <- stringr::str_interp("users/current")
2347 url <- paste0(private$host, endPoint)
2348 headers <- list(Authorization = paste("Bearer", private$token),
2349 "Content-Type" = "application/json")
2354 response <- private$REST$http$exec("GET", url, headers, body,
2355 queryArgs, private$numRetries)
2356 resource <- private$REST$httpParser$parseJSONResponse(response)
2358 if(!is.null(resource$errors))
2359 stop(resource$errors)
2365 #' users_system is a method defined in Arvados class.
2366 users_system = function()
2368 endPoint <- stringr::str_interp("users/system")
2369 url <- paste0(private$host, endPoint)
2370 headers <- list(Authorization = paste("Bearer", private$token),
2371 "Content-Type" = "application/json")
2376 response <- private$REST$http$exec("GET", url, headers, body,
2377 queryArgs, private$numRetries)
2378 resource <- private$REST$httpParser$parseJSONResponse(response)
2380 if(!is.null(resource$errors))
2381 stop(resource$errors)
2387 #' users_activate is a method defined in Arvados class.
2388 #' @param uuid The UUID of the User in question.
2389 users_activate = function(uuid)
2391 endPoint <- stringr::str_interp("users/${uuid}/activate")
2392 url <- paste0(private$host, endPoint)
2393 headers <- list(Authorization = paste("Bearer", private$token),
2394 "Content-Type" = "application/json")
2399 response <- private$REST$http$exec("POST", url, headers, body,
2400 queryArgs, private$numRetries)
2401 resource <- private$REST$httpParser$parseJSONResponse(response)
2403 if(!is.null(resource$errors))
2404 stop(resource$errors)
2410 #' users_setup is a method defined in Arvados class.
2415 #' @param send_notification_email
2416 users_setup = function(uuid = NULL, user = NULL,
2417 repo_name = NULL, vm_uuid = NULL, send_notification_email = "false")
2419 endPoint <- stringr::str_interp("users/setup")
2420 url <- paste0(private$host, endPoint)
2421 headers <- list(Authorization = paste("Bearer", private$token),
2422 "Content-Type" = "application/json")
2423 queryArgs <- list(uuid = uuid, user = user,
2424 repo_name = repo_name, vm_uuid = vm_uuid,
2425 send_notification_email = send_notification_email)
2429 response <- private$REST$http$exec("POST", url, headers, body,
2430 queryArgs, private$numRetries)
2431 resource <- private$REST$httpParser$parseJSONResponse(response)
2433 if(!is.null(resource$errors))
2434 stop(resource$errors)
2440 #' users_unsetup is a method defined in Arvados class.
2441 #' @param uuid The UUID of the User in question.
2442 users_unsetup = function(uuid)
2444 endPoint <- stringr::str_interp("users/${uuid}/unsetup")
2445 url <- paste0(private$host, endPoint)
2446 headers <- list(Authorization = paste("Bearer", private$token),
2447 "Content-Type" = "application/json")
2452 response <- private$REST$http$exec("POST", url, headers, body,
2453 queryArgs, private$numRetries)
2454 resource <- private$REST$httpParser$parseJSONResponse(response)
2456 if(!is.null(resource$errors))
2457 stop(resource$errors)
2463 #' users_merge is a method defined in Arvados class.
2464 #' @param newOwnerUUID
2465 #' @param newUserToken
2466 #' @param redirectToNewUser
2467 #' @param oldUserUUID
2468 #' @param newUserUUID
2469 users_merge = function(newOwnerUUID, newUserToken = NULL,
2470 redirectToNewUser = NULL, oldUserUUID = NULL,
2473 endPoint <- stringr::str_interp("users/merge")
2474 url <- paste0(private$host, endPoint)
2475 headers <- list(Authorization = paste("Bearer", private$token),
2476 "Content-Type" = "application/json")
2477 queryArgs <- list(newOwnerUUID = newOwnerUUID,
2478 newUserToken = newUserToken, redirectToNewUser = redirectToNewUser,
2479 oldUserUUID = oldUserUUID, newUserUUID = newUserUUID)
2483 response <- private$REST$http$exec("POST", url, headers, body,
2484 queryArgs, private$numRetries)
2485 resource <- private$REST$httpParser$parseJSONResponse(response)
2487 if(!is.null(resource$errors))
2488 stop(resource$errors)
2494 #' users_list is a method defined in Arvados class.
2503 #' @param clusterID List objects on a remote federated cluster instead of the current one.
2504 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
2505 users_list = function(filters = NULL, where = NULL,
2506 order = NULL, select = NULL, distinct = NULL,
2507 limit = "100", offset = "0", count = "exact",
2508 clusterID = NULL, bypassFederation = NULL)
2510 endPoint <- stringr::str_interp("users")
2511 url <- paste0(private$host, endPoint)
2512 headers <- list(Authorization = paste("Bearer", private$token),
2513 "Content-Type" = "application/json")
2514 queryArgs <- list(filters = filters, where = where,
2515 order = order, select = select, distinct = distinct,
2516 limit = limit, offset = offset, count = count,
2517 clusterID = clusterID, bypassFederation = bypassFederation)
2521 response <- private$REST$http$exec("GET", url, headers, body,
2522 queryArgs, private$numRetries)
2523 resource <- private$REST$httpParser$parseJSONResponse(response)
2525 if(!is.null(resource$errors))
2526 stop(resource$errors)
2532 #' repositories_get is a method defined in Arvados class.
2533 #' @param uuid The UUID of the Repository in question.
2534 repositories_get = function(uuid)
2536 endPoint <- stringr::str_interp("repositories/${uuid}")
2537 url <- paste0(private$host, endPoint)
2538 headers <- list(Authorization = paste("Bearer", private$token),
2539 "Content-Type" = "application/json")
2544 response <- private$REST$http$exec("GET", url, headers, body,
2545 queryArgs, private$numRetries)
2546 resource <- private$REST$httpParser$parseJSONResponse(response)
2548 if(!is.null(resource$errors))
2549 stop(resource$errors)
2555 #' repositories_create is a method defined in Arvados class.
2556 #' @param repository Repository object.
2557 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2558 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2559 repositories_create = function(repository,
2560 ensureUniqueName = "false", clusterID = NULL)
2562 endPoint <- stringr::str_interp("repositories")
2563 url <- paste0(private$host, endPoint)
2564 headers <- list(Authorization = paste("Bearer", private$token),
2565 "Content-Type" = "application/json")
2566 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2567 clusterID = clusterID)
2569 if(length(repository) > 0)
2570 body <- jsonlite::toJSON(list(repository = repository),
2575 response <- private$REST$http$exec("POST", url, headers, body,
2576 queryArgs, private$numRetries)
2577 resource <- private$REST$httpParser$parseJSONResponse(response)
2579 if(!is.null(resource$errors))
2580 stop(resource$errors)
2586 #' repositories_update is a method defined in Arvados class.
2587 #' @param repository Repository object.
2588 #' @param uuid The UUID of the Repository in question.
2589 repositories_update = function(repository, uuid)
2591 endPoint <- stringr::str_interp("repositories/${uuid}")
2592 url <- paste0(private$host, endPoint)
2593 headers <- list(Authorization = paste("Bearer", private$token),
2594 "Content-Type" = "application/json")
2597 if(length(repository) > 0)
2598 body <- jsonlite::toJSON(list(repository = repository),
2603 response <- private$REST$http$exec("PUT", url, headers, body,
2604 queryArgs, private$numRetries)
2605 resource <- private$REST$httpParser$parseJSONResponse(response)
2607 if(!is.null(resource$errors))
2608 stop(resource$errors)
2614 #' repositories_delete is a method defined in Arvados class.
2615 #' @param uuid The UUID of the Repository in question.
2616 repositories_delete = function(uuid)
2618 endPoint <- stringr::str_interp("repositories/${uuid}")
2619 url <- paste0(private$host, endPoint)
2620 headers <- list(Authorization = paste("Bearer", private$token),
2621 "Content-Type" = "application/json")
2626 response <- private$REST$http$exec("DELETE", url, headers, body,
2627 queryArgs, private$numRetries)
2628 resource <- private$REST$httpParser$parseJSONResponse(response)
2630 if(!is.null(resource$errors))
2631 stop(resource$errors)
2637 #' repositories_get_all_permissions is a method defined in Arvados class.
2638 repositories_get_all_permissions = function()
2640 endPoint <- stringr::str_interp("repositories/get_all_permissions")
2641 url <- paste0(private$host, endPoint)
2642 headers <- list(Authorization = paste("Bearer", private$token),
2643 "Content-Type" = "application/json")
2648 response <- private$REST$http$exec("GET", url, headers, body,
2649 queryArgs, private$numRetries)
2650 resource <- private$REST$httpParser$parseJSONResponse(response)
2652 if(!is.null(resource$errors))
2653 stop(resource$errors)
2659 #' repositories_list is a method defined in Arvados class.
2668 #' @param clusterID List objects on a remote federated cluster instead of the current one.
2669 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
2670 repositories_list = function(filters = NULL,
2671 where = NULL, order = NULL, select = NULL,
2672 distinct = NULL, limit = "100", offset = "0",
2673 count = "exact", clusterID = NULL, bypassFederation = NULL)
2675 endPoint <- stringr::str_interp("repositories")
2676 url <- paste0(private$host, endPoint)
2677 headers <- list(Authorization = paste("Bearer", private$token),
2678 "Content-Type" = "application/json")
2679 queryArgs <- list(filters = filters, where = where,
2680 order = order, select = select, distinct = distinct,
2681 limit = limit, offset = offset, count = count,
2682 clusterID = clusterID, bypassFederation = bypassFederation)
2686 response <- private$REST$http$exec("GET", url, headers, body,
2687 queryArgs, private$numRetries)
2688 resource <- private$REST$httpParser$parseJSONResponse(response)
2690 if(!is.null(resource$errors))
2691 stop(resource$errors)
2697 #' virtual_machines_get is a method defined in Arvados class.
2698 #' @param uuid The UUID of the virtualMachine in question.
2699 virtual_machines_get = function(uuid)
2701 endPoint <- stringr::str_interp("virtual_machines/${uuid}")
2702 url <- paste0(private$host, endPoint)
2703 headers <- list(Authorization = paste("Bearer", private$token),
2704 "Content-Type" = "application/json")
2709 response <- private$REST$http$exec("GET", url, headers, body,
2710 queryArgs, private$numRetries)
2711 resource <- private$REST$httpParser$parseJSONResponse(response)
2713 if(!is.null(resource$errors))
2714 stop(resource$errors)
2720 #' virtual_machines_create is a method defined in Arvados class.
2721 #' @param virtualMachine virtualMachine object.
2722 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2723 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2724 virtual_machines_create = function(virtualMachine,
2725 ensureUniqueName = "false", clusterID = NULL)
2727 endPoint <- stringr::str_interp("virtual_machines")
2728 url <- paste0(private$host, endPoint)
2729 headers <- list(Authorization = paste("Bearer", private$token),
2730 "Content-Type" = "application/json")
2731 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2732 clusterID = clusterID)
2734 if(length(virtualMachine) > 0)
2735 body <- jsonlite::toJSON(list(virtualMachine = virtualMachine),
2740 response <- private$REST$http$exec("POST", url, headers, body,
2741 queryArgs, private$numRetries)
2742 resource <- private$REST$httpParser$parseJSONResponse(response)
2744 if(!is.null(resource$errors))
2745 stop(resource$errors)
2751 #' virtual_machines_update is a method defined in Arvados class.
2752 #' @param virtualMachine virtualMachine object.
2753 #' @param uuid The UUID of the virtualMachine in question.
2754 virtual_machines_update = function(virtualMachine, uuid)
2756 endPoint <- stringr::str_interp("virtual_machines/${uuid}")
2757 url <- paste0(private$host, endPoint)
2758 headers <- list(Authorization = paste("Bearer", private$token),
2759 "Content-Type" = "application/json")
2762 if(length(virtualMachine) > 0)
2763 body <- jsonlite::toJSON(list(virtualMachine = virtualMachine),
2768 response <- private$REST$http$exec("PUT", url, headers, body,
2769 queryArgs, private$numRetries)
2770 resource <- private$REST$httpParser$parseJSONResponse(response)
2772 if(!is.null(resource$errors))
2773 stop(resource$errors)
2779 #' virtual_machines_delete is a method defined in Arvados class.
2780 #' @param uuid The UUID of the virtualMachine in question.
2781 virtual_machines_delete = function(uuid)
2783 endPoint <- stringr::str_interp("virtual_machines/${uuid}")
2784 url <- paste0(private$host, endPoint)
2785 headers <- list(Authorization = paste("Bearer", private$token),
2786 "Content-Type" = "application/json")
2791 response <- private$REST$http$exec("DELETE", url, headers, body,
2792 queryArgs, private$numRetries)
2793 resource <- private$REST$httpParser$parseJSONResponse(response)
2795 if(!is.null(resource$errors))
2796 stop(resource$errors)
2802 #' virtual_machines_logins is a method defined in Arvados class.
2803 #' @param uuid The UUID of the virtualMachine in question.
2804 virtual_machines_logins = function(uuid)
2806 endPoint <- stringr::str_interp("virtual_machines/${uuid}/logins")
2807 url <- paste0(private$host, endPoint)
2808 headers <- list(Authorization = paste("Bearer", private$token),
2809 "Content-Type" = "application/json")
2814 response <- private$REST$http$exec("GET", url, headers, body,
2815 queryArgs, private$numRetries)
2816 resource <- private$REST$httpParser$parseJSONResponse(response)
2818 if(!is.null(resource$errors))
2819 stop(resource$errors)
2825 #' virtual_machines_get_all_logins is a method defined in Arvados class.
2826 virtual_machines_get_all_logins = function()
2828 endPoint <- stringr::str_interp("virtual_machines/get_all_logins")
2829 url <- paste0(private$host, endPoint)
2830 headers <- list(Authorization = paste("Bearer", private$token),
2831 "Content-Type" = "application/json")
2836 response <- private$REST$http$exec("GET", url, headers, body,
2837 queryArgs, private$numRetries)
2838 resource <- private$REST$httpParser$parseJSONResponse(response)
2840 if(!is.null(resource$errors))
2841 stop(resource$errors)
2847 #' virtual_machines_list is a method defined in Arvados class.
2856 #' @param clusterID List objects on a remote federated cluster instead of the current one.
2857 #' @param bypassFederation bypass federation behavior, list items from local instance database only
2858 virtual_machines_list = function(filters = NULL,
2859 where = NULL, order = NULL, select = NULL,
2860 distinct = NULL, limit = "100", offset = "0",
2861 count = "exact", clusterID = NULL, bypassFederation = NULL)
2863 endPoint <- stringr::str_interp("virtual_machines")
2864 url <- paste0(private$host, endPoint)
2865 headers <- list(Authorization = paste("Bearer", private$token),
2866 "Content-Type" = "application/json")
2867 queryArgs <- list(filters = filters, where = where,
2868 order = order, select = select, distinct = distinct,
2869 limit = limit, offset = offset, count = count,
2870 clusterID = clusterID, bypassFederation = bypassFederation)
2874 response <- private$REST$http$exec("GET", url, headers, body,
2875 queryArgs, private$numRetries)
2876 resource <- private$REST$httpParser$parseJSONResponse(response)
2878 if(!is.null(resource$errors))
2879 stop(resource$errors)
2885 #' workflows_get is a method defined in Arvados class.
2886 #' @param uuid The UUID of the Workflow in question.
2887 workflows_get = function(uuid)
2889 endPoint <- stringr::str_interp("workflows/${uuid}")
2890 url <- paste0(private$host, endPoint)
2891 headers <- list(Authorization = paste("Bearer", private$token),
2892 "Content-Type" = "application/json")
2897 response <- private$REST$http$exec("GET", url, headers, body,
2898 queryArgs, private$numRetries)
2899 resource <- private$REST$httpParser$parseJSONResponse(response)
2901 if(!is.null(resource$errors))
2902 stop(resource$errors)
2908 #' workflows_create is a method defined in Arvados class.
2909 #' @param workflow Workflow object.
2910 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2911 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2912 workflows_create = function(workflow, ensureUniqueName = "false",
2915 endPoint <- stringr::str_interp("workflows")
2916 url <- paste0(private$host, endPoint)
2917 headers <- list(Authorization = paste("Bearer", private$token),
2918 "Content-Type" = "application/json")
2919 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2920 clusterID = clusterID)
2922 if(length(workflow) > 0)
2923 body <- jsonlite::toJSON(list(workflow = workflow),
2928 response <- private$REST$http$exec("POST", url, headers, body,
2929 queryArgs, private$numRetries)
2930 resource <- private$REST$httpParser$parseJSONResponse(response)
2932 if(!is.null(resource$errors))
2933 stop(resource$errors)
2939 #' workflows_update is a method defined in Arvados class.
2940 #' @param workflow Workflow object.
2941 #' @param uuid The UUID of the Workflow in question.
2942 workflows_update = function(workflow, uuid)
2944 endPoint <- stringr::str_interp("workflows/${uuid}")
2945 url <- paste0(private$host, endPoint)
2946 headers <- list(Authorization = paste("Bearer", private$token),
2947 "Content-Type" = "application/json")
2950 if(length(workflow) > 0)
2951 body <- jsonlite::toJSON(list(workflow = workflow),
2956 response <- private$REST$http$exec("PUT", url, headers, body,
2957 queryArgs, private$numRetries)
2958 resource <- private$REST$httpParser$parseJSONResponse(response)
2960 if(!is.null(resource$errors))
2961 stop(resource$errors)
2967 #' workflows_delete is a method defined in Arvados class.
2968 #' @param uuid The UUID of the Workflow in question.
2969 workflows_delete = function(uuid)
2971 endPoint <- stringr::str_interp("workflows/${uuid}")
2972 url <- paste0(private$host, endPoint)
2973 headers <- list(Authorization = paste("Bearer", private$token),
2974 "Content-Type" = "application/json")
2979 response <- private$REST$http$exec("DELETE", url, headers, body,
2980 queryArgs, private$numRetries)
2981 resource <- private$REST$httpParser$parseJSONResponse(response)
2983 if(!is.null(resource$errors))
2984 stop(resource$errors)
2990 #' workflows_list is a method defined in Arvados class.
2999 #' @param clusterID List objects on a remote federated cluster instead of the current one.
3000 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
3001 workflows_list = function(filters = NULL,
3002 where = NULL, order = NULL, select = NULL,
3003 distinct = NULL, limit = "100", offset = "0",
3004 count = "exact", clusterID = NULL, bypassFederation = NULL)
3006 endPoint <- stringr::str_interp("workflows")
3007 url <- paste0(private$host, endPoint)
3008 headers <- list(Authorization = paste("Bearer", private$token),
3009 "Content-Type" = "application/json")
3010 queryArgs <- list(filters = filters, where = where,
3011 order = order, select = select, distinct = distinct,
3012 limit = limit, offset = offset, count = count,
3013 clusterID = clusterID, bypassFederation = bypassFederation)
3017 response <- private$REST$http$exec("GET", url, headers, body,
3018 queryArgs, private$numRetries)
3019 resource <- private$REST$httpParser$parseJSONResponse(response)
3021 if(!is.null(resource$errors))
3022 stop(resource$errors)
3028 #' user_agreements_get is a method defined in Arvados class.
3029 #' @param uuid The UUID of the userAgreement in question.
3030 user_agreements_get = function(uuid)
3032 endPoint <- stringr::str_interp("user_agreements/${uuid}")
3033 url <- paste0(private$host, endPoint)
3034 headers <- list(Authorization = paste("Bearer", private$token),
3035 "Content-Type" = "application/json")
3040 response <- private$REST$http$exec("GET", url, headers, body,
3041 queryArgs, private$numRetries)
3042 resource <- private$REST$httpParser$parseJSONResponse(response)
3044 if(!is.null(resource$errors))
3045 stop(resource$errors)
3051 #' user_agreements_create is a method defined in Arvados class.
3052 #' @param userAgreement userAgreement object.
3053 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
3054 #' @param clusterID Create object on a remote federated cluster instead of the current one.
3055 user_agreements_create = function(userAgreement,
3056 ensureUniqueName = "false", clusterID = NULL)
3058 endPoint <- stringr::str_interp("user_agreements")
3059 url <- paste0(private$host, endPoint)
3060 headers <- list(Authorization = paste("Bearer", private$token),
3061 "Content-Type" = "application/json")
3062 queryArgs <- list(ensureUniqueName = ensureUniqueName,
3063 clusterID = clusterID)
3065 if(length(userAgreement) > 0)
3066 body <- jsonlite::toJSON(list(userAgreement = userAgreement),
3071 response <- private$REST$http$exec("POST", url, headers, body,
3072 queryArgs, private$numRetries)
3073 resource <- private$REST$httpParser$parseJSONResponse(response)
3075 if(!is.null(resource$errors))
3076 stop(resource$errors)
3082 #' user_agreements_update is a method defined in Arvados class.
3083 #' @param userAgreement userAgreement object.
3084 #' @param uuid The UUID of the userAgreement in question.
3085 user_agreements_update = function(userAgreement, uuid)
3087 endPoint <- stringr::str_interp("user_agreements/${uuid}")
3088 url <- paste0(private$host, endPoint)
3089 headers <- list(Authorization = paste("Bearer", private$token),
3090 "Content-Type" = "application/json")
3093 if(length(userAgreement) > 0)
3094 body <- jsonlite::toJSON(list(userAgreement = userAgreement),
3099 response <- private$REST$http$exec("PUT", url, headers, body,
3100 queryArgs, private$numRetries)
3101 resource <- private$REST$httpParser$parseJSONResponse(response)
3103 if(!is.null(resource$errors))
3104 stop(resource$errors)
3110 #' user_agreements_delete is a method defined in Arvados class.
3111 #' @param uuid The UUID of the userAgreement in question.
3112 user_agreements_delete = function(uuid)
3114 endPoint <- stringr::str_interp("user_agreements/${uuid}")
3115 url <- paste0(private$host, endPoint)
3116 headers <- list(Authorization = paste("Bearer", private$token),
3117 "Content-Type" = "application/json")
3122 response <- private$REST$http$exec("DELETE", url, headers, body,
3123 queryArgs, private$numRetries)
3124 resource <- private$REST$httpParser$parseJSONResponse(response)
3126 if(!is.null(resource$errors))
3127 stop(resource$errors)
3133 #' user_agreements_signatures is a method defined in Arvados class.
3134 user_agreements_signatures = function()
3136 endPoint <- stringr::str_interp("user_agreements/signatures")
3137 url <- paste0(private$host, endPoint)
3138 headers <- list(Authorization = paste("Bearer", private$token),
3139 "Content-Type" = "application/json")
3144 response <- private$REST$http$exec("GET", url, headers, body,
3145 queryArgs, private$numRetries)
3146 resource <- private$REST$httpParser$parseJSONResponse(response)
3148 if(!is.null(resource$errors))
3149 stop(resource$errors)
3155 #' user_agreements_sign is a method defined in Arvados class.
3156 user_agreements_sign = function()
3158 endPoint <- stringr::str_interp("user_agreements/sign")
3159 url <- paste0(private$host, endPoint)
3160 headers <- list(Authorization = paste("Bearer", private$token),
3161 "Content-Type" = "application/json")
3166 response <- private$REST$http$exec("POST", url, headers, body,
3167 queryArgs, private$numRetries)
3168 resource <- private$REST$httpParser$parseJSONResponse(response)
3170 if(!is.null(resource$errors))
3171 stop(resource$errors)
3177 #' user_agreements_list is a method defined in Arvados class.
3186 #' @param clusterID List objects on a remote federated cluster instead of the current one.
3187 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
3188 user_agreements_list = function(filters = NULL,
3189 where = NULL, order = NULL, select = NULL,
3190 distinct = NULL, limit = "100", offset = "0",
3191 count = "exact", clusterID = NULL, bypassFederation = NULL)
3193 endPoint <- stringr::str_interp("user_agreements")
3194 url <- paste0(private$host, endPoint)
3195 headers <- list(Authorization = paste("Bearer", private$token),
3196 "Content-Type" = "application/json")
3197 queryArgs <- list(filters = filters, where = where,
3198 order = order, select = select, distinct = distinct,
3199 limit = limit, offset = offset, count = count,
3200 clusterID = clusterID, bypassFederation = bypassFederation)
3204 response <- private$REST$http$exec("GET", url, headers, body,
3205 queryArgs, private$numRetries)
3206 resource <- private$REST$httpParser$parseJSONResponse(response)
3208 if(!is.null(resource$errors))
3209 stop(resource$errors)
3215 #' user_agreements_new is a method defined in Arvados class.
3216 user_agreements_new = function()
3218 endPoint <- stringr::str_interp("user_agreements/new")
3219 url <- paste0(private$host, endPoint)
3220 headers <- list(Authorization = paste("Bearer", private$token),
3221 "Content-Type" = "application/json")
3226 response <- private$REST$http$exec("GET", url, headers, body,
3227 queryArgs, private$numRetries)
3228 resource <- private$REST$httpParser$parseJSONResponse(response)
3230 if(!is.null(resource$errors))
3231 stop(resource$errors)
3237 #' configs_get is a method defined in Arvados class.
3238 configs_get = function()
3240 endPoint <- stringr::str_interp("config")
3241 url <- paste0(private$host, endPoint)
3242 headers <- list(Authorization = paste("Bearer", private$token),
3243 "Content-Type" = "application/json")
3248 response <- private$REST$http$exec("GET", url, headers, body,
3249 queryArgs, private$numRetries)
3250 resource <- private$REST$httpParser$parseJSONResponse(response)
3252 if(!is.null(resource$errors))
3253 stop(resource$errors)
3258 getHostName = function() private$host,
3259 getToken = function() private$token,
3260 setRESTService = function(newREST) private$REST <- newREST,
3261 getRESTService = function() private$REST