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.
55 #' arv$project_exist(uuid = "projectUUID")
57 project_exist = function(uuid)
59 proj <- self$project_list(list(list("uuid", '=', uuid)))
60 value <- length(proj$items)
70 #' project_get returns the demanded project.
71 #' @param uuid The UUID of the Group in question.
74 #' project <- arv$project_get(uuid = 'projectUUID')
76 project_get = function(uuid)
82 #' project_create creates a new project of a given name and description.
83 #' @param name Name of the project.
84 #' @param description Description of the project.
85 #' @param ownerUUID The UUID of the maternal project to created one.
86 #' @param properties List of the properties of the project.
87 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
90 #' Properties <- list() # should contain a list of new properties to be added
91 #' new_project <- arv$project_create(name = "project name", description = "project description", owner_uuid = "project UUID", properties = NULL, ensureUniqueName = "false")
93 project_create = function(name, description, ownerUUID, properties = NULL, ensureUniqueName = "false")
95 group <- list(name = name, description = description, owner_uuid = ownerUUID, properties = properties)
96 group <- c("group_class" = "project", group)
97 self$groups_create(group, ensureUniqueName = ensureUniqueName)
101 #' 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.
102 #' @param listProperties List of new properties.
103 #' @param uuid The UUID of a project or a file.
106 #' Properties <- list() # should contain a list of new properties to be added
107 #' arv$project_properties_set(Properties, uuid)
109 project_properties_set = function(listProperties, uuid)
111 group <- c("group_class" = "project", list("properties" = listProperties))
112 self$groups_update(group, uuid)
117 #' project_properties_append is a method defined in Arvados class that enables appending properties. Allows to add new properties.
118 #' @param properties List of new properties.
119 #' @param uuid The UUID of a project or a file.
122 #' newProperties <- list() # should contain a list of new properties to be added
123 #' arv$project_properties_append(properties = newProperties, uuid)
125 project_properties_append = function(properties, uuid)
127 proj <- self$project_list(list(list('uuid', '=', uuid)))
128 projProp <- proj$items[[1]]$properties
130 newListOfProperties <- c(projProp, properties)
131 uniqueProperties <- unique(unlist(newListOfProperties))
132 newListOfProperties <- suppressWarnings(newListOfProperties[which(newListOfProperties == uniqueProperties)])
134 group <- c("group_class" = "project", list("properties" = newListOfProperties))
135 self$groups_update(group, uuid);
140 #' project_properties_get is a method defined in Arvados class that returns properties.
141 #' @param uuid The UUID of a project or a file.
144 #' arv$project_properties_get(projectUUID)
146 project_properties_get = function(uuid)
148 proj <- self$project_list(list(list('uuid', '=', uuid)))
149 proj$items[[1]]$properties
153 #' project_properties_delete is a method defined in Arvados class that deletes list of properties.
154 #' @param oneProp Property to be deleted.
155 #' @param uuid The UUID of a project or a file.
158 #' Properties <- list() # should contain a list of new properties to be added
159 #' arv$project_properties_delete(Properties, projectUUID)
161 project_properties_delete = function(oneProp, uuid)
163 proj <- self$project_list(list(list('uuid', '=', uuid))) # find project
164 projProp <- proj$items[[1]]$properties
165 for (i in 1:length(projProp)){
166 solution <- identical(projProp[i],oneProp)
167 if (solution == TRUE) {
168 projProp <- projProp[names(projProp) != names(oneProp)]
169 self$project_properties_set(projProp, uuid)
175 #' project_update enables updating project. New name, description and properties may be given.
176 #' @param ... Feature to be updated (name, description, properties).
177 #' @param uuid The UUID of a project in question.
180 #' newProperties <- list() # should contain a list of new properties to be added
181 #' arv$project_update(name = "new project name", properties = newProperties, uuid = projectUUID)
183 project_update = function(..., uuid) {
185 for (i in 1:length(vec))
187 if (names(vec[i]) == 'properties') {
188 solution <- self$project_properties_append(vec$properties, uuid = uuid)
191 vecNew <- vec[names(vec) != "properties"]
192 vecNew <- c("group_class" = "project", vecNew)
193 z <- self$groups_update(vecNew, uuid)
197 #' project_list enables listing project by its name, uuid, properties, permissions.
205 #' @param includeTrash Include items whose is_trashed attribute is true.
206 #' @param uuid The UUID of a project in question.
207 #' @param recursive Include contents from child groups recursively.
210 #' listOfprojects <- arv$project_list(list(list("owner_uuid", "=", projectUUID))) # Sample query which show projects within the project of a given UUID
212 project_list = function(filters = NULL, where = NULL,
213 order = NULL, select = NULL, distinct = NULL,
214 limit = "100", offset = "0", count = "exact",
217 filters[[length(filters) + 1]] <- list("group_class", "=", "project")
218 self$groups_list(filters, where, order, select, distinct,
219 limit, offset, count, includeTrash)
223 #' project_delete trashes project of a given uuid. It can be restored from trash or deleted permanently.
224 #' @param uuid The UUID of the Group in question.
227 #' arv$project_delete(uuid = 'projectUUID')
229 project_delete = function(uuid)
231 self$groups_delete(uuid)
235 #' api_clients_get is a method defined in Arvados class.
236 #' @param uuid The UUID of the apiClient in question.
237 api_clients_get = function(uuid)
239 endPoint <- stringr::str_interp("api_clients/${uuid}")
240 url <- paste0(private$host, endPoint)
241 headers <- list(Authorization = paste("Bearer", private$token),
242 "Content-Type" = "application/json")
247 response <- private$REST$http$exec("GET", url, headers, body,
248 queryArgs, private$numRetries)
249 resource <- private$REST$httpParser$parseJSONResponse(response)
251 if(!is.null(resource$errors))
252 stop(resource$errors)
258 #' api_clients_create is a method defined in Arvados class.
259 #' @param apiClient apiClient object.
260 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
261 #' @param clusterID Create object on a remote federated cluster instead of the current one.
262 api_clients_create = function(apiClient,
263 ensureUniqueName = "false", clusterID = NULL)
265 endPoint <- stringr::str_interp("api_clients")
266 url <- paste0(private$host, endPoint)
267 headers <- list(Authorization = paste("Bearer", private$token),
268 "Content-Type" = "application/json")
269 queryArgs <- list(ensureUniqueName = ensureUniqueName,
270 clusterID = clusterID)
272 if(length(apiClient) > 0)
273 body <- jsonlite::toJSON(list(apiClient = apiClient),
278 response <- private$REST$http$exec("POST", url, headers, body,
279 queryArgs, private$numRetries)
280 resource <- private$REST$httpParser$parseJSONResponse(response)
282 if(!is.null(resource$errors))
283 stop(resource$errors)
289 #' api_clients_update is a method defined in Arvados class.
290 #' @param apiClient apiClient object.
291 #' @param uuid The UUID of the apiClient in question.
292 api_clients_update = function(apiClient, uuid)
294 endPoint <- stringr::str_interp("api_clients/${uuid}")
295 url <- paste0(private$host, endPoint)
296 headers <- list(Authorization = paste("Bearer", private$token),
297 "Content-Type" = "application/json")
300 if(length(apiClient) > 0)
301 body <- jsonlite::toJSON(list(apiClient = apiClient),
306 response <- private$REST$http$exec("PUT", url, headers, body,
307 queryArgs, private$numRetries)
308 resource <- private$REST$httpParser$parseJSONResponse(response)
310 if(!is.null(resource$errors))
311 stop(resource$errors)
317 #' api_clients_delete is a method defined in Arvados class.
318 #' @param uuid The UUID of the apiClient in question.
319 api_clients_delete = function(uuid)
321 endPoint <- stringr::str_interp("api_clients/${uuid}")
322 url <- paste0(private$host, endPoint)
323 headers <- list(Authorization = paste("Bearer", private$token),
324 "Content-Type" = "application/json")
329 response <- private$REST$http$exec("DELETE", url, headers, body,
330 queryArgs, private$numRetries)
331 resource <- private$REST$httpParser$parseJSONResponse(response)
333 if(!is.null(resource$errors))
334 stop(resource$errors)
340 #' api_clients_list is a method defined in Arvados class.
349 #' @param clusterID List objects on a remote federated cluster instead of the current one.
350 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
351 api_clients_list = function(filters = NULL,
352 where = NULL, order = NULL, select = NULL,
353 distinct = NULL, limit = "100", offset = "0",
354 count = "exact", clusterID = NULL, bypassFederation = NULL)
356 endPoint <- stringr::str_interp("api_clients")
357 url <- paste0(private$host, endPoint)
358 headers <- list(Authorization = paste("Bearer", private$token),
359 "Content-Type" = "application/json")
360 queryArgs <- list(filters = filters, where = where,
361 order = order, select = select, distinct = distinct,
362 limit = limit, offset = offset, count = count,
363 clusterID = clusterID, bypassFederation = bypassFederation)
367 response <- private$REST$http$exec("GET", url, headers, body,
368 queryArgs, private$numRetries)
369 resource <- private$REST$httpParser$parseJSONResponse(response)
371 if(!is.null(resource$errors))
372 stop(resource$errors)
378 #' api_client_authorizations_get is a method defined in Arvados class.
379 #' @param uuid The UUID of the apiClientAuthorization in question.
380 api_client_authorizations_get = function(uuid)
382 endPoint <- stringr::str_interp("api_client_authorizations/${uuid}")
383 url <- paste0(private$host, endPoint)
384 headers <- list(Authorization = paste("Bearer", private$token),
385 "Content-Type" = "application/json")
390 response <- private$REST$http$exec("GET", url, headers, body,
391 queryArgs, private$numRetries)
392 resource <- private$REST$httpParser$parseJSONResponse(response)
394 if(!is.null(resource$errors))
395 stop(resource$errors)
401 #' api_client_authorizations_create is a method defined in Arvados class.
402 #' @param apiClientAuthorization apiClientAuthorization object.
403 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error on (ownerUUID, name) collision_
404 #' @param clusterID Create object on a remote federated cluster instead of the current one.
405 api_client_authorizations_create = function(apiClientAuthorization,
406 ensureUniqueName = "false", clusterID = NULL)
408 endPoint <- stringr::str_interp("api_client_authorizations")
409 url <- paste0(private$host, endPoint)
410 headers <- list(Authorization = paste("Bearer", private$token),
411 "Content-Type" = "application/json")
412 queryArgs <- list(ensureUniqueName = ensureUniqueName,
413 clusterID = clusterID)
415 if(length(apiClientAuthorization) > 0)
416 body <- jsonlite::toJSON(list(apiClientAuthorization = apiClientAuthorization),
421 response <- private$REST$http$exec("POST", url, headers, body,
422 queryArgs, private$numRetries)
423 resource <- private$REST$httpParser$parseJSONResponse(response)
425 if(!is.null(resource$errors))
426 stop(resource$errors)
432 #' api_client_authorizations_update is a method defined in Arvados class.
433 #' @param apiClientAuthorization apiClientAuthorization object.
434 #' @param uuid The UUID of the apiClientAuthorization in question.
435 api_client_authorizations_update = function(apiClientAuthorization, uuid)
437 endPoint <- stringr::str_interp("api_client_authorizations/${uuid}")
438 url <- paste0(private$host, endPoint)
439 headers <- list(Authorization = paste("Bearer", private$token),
440 "Content-Type" = "application/json")
443 if(length(apiClientAuthorization) > 0)
444 body <- jsonlite::toJSON(list(apiClientAuthorization = apiClientAuthorization),
449 response <- private$REST$http$exec("PUT", url, headers, body,
450 queryArgs, private$numRetries)
451 resource <- private$REST$httpParser$parseJSONResponse(response)
453 if(!is.null(resource$errors))
454 stop(resource$errors)
460 #' api_client_authorizations_delete is a method defined in Arvados class.
461 #' @param uuid The UUID of the apiClientAuthorization in question.
462 api_client_authorizations_delete = function(uuid)
464 endPoint <- stringr::str_interp("api_client_authorizations/${uuid}")
465 url <- paste0(private$host, endPoint)
466 headers <- list(Authorization = paste("Bearer", private$token),
467 "Content-Type" = "application/json")
472 response <- private$REST$http$exec("DELETE", url, headers, body,
473 queryArgs, private$numRetries)
474 resource <- private$REST$httpParser$parseJSONResponse(response)
476 if(!is.null(resource$errors))
477 stop(resource$errors)
483 #' api_client_authorizations_create_system_auth is a method defined in Arvados class.
484 #' @param apiClientID
486 api_client_authorizations_create_system_auth = function(apiClientID = NULL, scopes = NULL)
488 endPoint <- stringr::str_interp("api_client_authorizations/create_system_auth")
489 url <- paste0(private$host, endPoint)
490 headers <- list(Authorization = paste("Bearer", private$token),
491 "Content-Type" = "application/json")
492 queryArgs <- list(apiClientID = apiClientID,
497 response <- private$REST$http$exec("POST", 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_current is a method defined in Arvados class.
509 api_client_authorizations_current = function()
511 endPoint <- stringr::str_interp("api_client_authorizations/current")
512 url <- paste0(private$host, endPoint)
513 headers <- list(Authorization = paste("Bearer", private$token),
514 "Content-Type" = "application/json")
519 response <- private$REST$http$exec("GET", url, headers, body,
520 queryArgs, private$numRetries)
521 resource <- private$REST$httpParser$parseJSONResponse(response)
523 if(!is.null(resource$errors))
524 stop(resource$errors)
530 #' api_client_authorizations_list is a method defined in Arvados class.
539 #' @param clusterID List objects on a remote federated cluster instead of the current one.
540 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
541 api_client_authorizations_list = function(filters = NULL,
542 where = NULL, order = NULL, select = NULL,
543 distinct = NULL, limit = "100", offset = "0",
544 count = "exact", clusterID = NULL, bypassFederation = NULL)
546 endPoint <- stringr::str_interp("api_client_authorizations")
547 url <- paste0(private$host, endPoint)
548 headers <- list(Authorization = paste("Bearer", private$token),
549 "Content-Type" = "application/json")
550 queryArgs <- list(filters = filters, where = where,
551 order = order, select = select, distinct = distinct,
552 limit = limit, offset = offset, count = count,
553 clusterID = clusterID, bypassFederation = bypassFederation)
557 response <- private$REST$http$exec("GET", url, headers, body,
558 queryArgs, private$numRetries)
559 resource <- private$REST$httpParser$parseJSONResponse(response)
561 if(!is.null(resource$errors))
562 stop(resource$errors)
568 #' authorized_keys_get is a method defined in Arvados class.
569 #' @param uuid The UUID of the authorizedKey in question.
570 authorized_keys_get = function(uuid)
572 endPoint <- stringr::str_interp("authorized_keys/${uuid}")
573 url <- paste0(private$host, endPoint)
574 headers <- list(Authorization = paste("Bearer", private$token),
575 "Content-Type" = "application/json")
580 response <- private$REST$http$exec("GET", url, headers, body,
581 queryArgs, private$numRetries)
582 resource <- private$REST$httpParser$parseJSONResponse(response)
584 if(!is.null(resource$errors))
585 stop(resource$errors)
591 #' authorized_keys_create is a method defined in Arvados class.
592 #' @param authorizedKey authorizedKey object.
593 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
594 #' @param clusterID Create object on a remote federated cluster instead of the current one.
595 authorized_keys_create = function(authorizedKey,
596 ensureUniqueName = "false", clusterID = NULL)
598 endPoint <- stringr::str_interp("authorized_keys")
599 url <- paste0(private$host, endPoint)
600 headers <- list(Authorization = paste("Bearer", private$token),
601 "Content-Type" = "application/json")
602 queryArgs <- list(ensureUniqueName = ensureUniqueName,
603 clusterID = clusterID)
605 if(length(authorizedKey) > 0)
606 body <- jsonlite::toJSON(list(authorizedKey = authorizedKey),
611 response <- private$REST$http$exec("POST", url, headers, body,
612 queryArgs, private$numRetries)
613 resource <- private$REST$httpParser$parseJSONResponse(response)
615 if(!is.null(resource$errors))
616 stop(resource$errors)
622 #' authorized_keys_update is a method defined in Arvados class.
623 #' @param authorizedKey authorizedKey object.
624 #' @param uuid The UUID of the authorizedKey in question.
625 authorized_keys_update = function(authorizedKey, uuid)
627 endPoint <- stringr::str_interp("authorized_keys/${uuid}")
628 url <- paste0(private$host, endPoint)
629 headers <- list(Authorization = paste("Bearer", private$token),
630 "Content-Type" = "application/json")
633 if(length(authorizedKey) > 0)
634 body <- jsonlite::toJSON(list(authorizedKey = authorizedKey),
639 response <- private$REST$http$exec("PUT", url, headers, body,
640 queryArgs, private$numRetries)
641 resource <- private$REST$httpParser$parseJSONResponse(response)
643 if(!is.null(resource$errors))
644 stop(resource$errors)
650 #' authorized_keys_delete is a method defined in Arvados class.
651 #' @param uuid The UUID of the authorizedKey in question.
652 authorized_keys_delete = function(uuid)
654 endPoint <- stringr::str_interp("authorized_keys/${uuid}")
655 url <- paste0(private$host, endPoint)
656 headers <- list(Authorization = paste("Bearer", private$token),
657 "Content-Type" = "application/json")
662 response <- private$REST$http$exec("DELETE", url, headers, body,
663 queryArgs, private$numRetries)
664 resource <- private$REST$httpParser$parseJSONResponse(response)
666 if(!is.null(resource$errors))
667 stop(resource$errors)
673 #' authorized_keys_list is a method defined in Arvados class.
682 #' @param clusterID List objects on a remote federated cluster instead of the current one.
683 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
684 authorized_keys_list = function(filters = NULL,
685 where = NULL, order = NULL, select = NULL,
686 distinct = NULL, limit = "100", offset = "0",
687 count = "exact", clusterID = NULL, bypassFederation = NULL)
689 endPoint <- stringr::str_interp("authorized_keys")
690 url <- paste0(private$host, endPoint)
691 headers <- list(Authorization = paste("Bearer", private$token),
692 "Content-Type" = "application/json")
693 queryArgs <- list(filters = filters, where = where,
694 order = order, select = select, distinct = distinct,
695 limit = limit, offset = offset, count = count,
696 clusterID = clusterID, bypassFederation = bypassFederation)
700 response <- private$REST$http$exec("GET", url, headers, body,
701 queryArgs, private$numRetries)
702 resource <- private$REST$httpParser$parseJSONResponse(response)
704 if(!is.null(resource$errors))
705 stop(resource$errors)
711 #' collections_get is a method defined in Arvados class.
712 #' @param uuid The UUID of the Collection in question.
715 #' collection <- arv$collections_get(uuid = collectionUUID)
717 collections_get = function(uuid)
719 endPoint <- stringr::str_interp("collections/${uuid}")
720 url <- paste0(private$host, endPoint)
721 headers <- list(Authorization = paste("Bearer", private$token),
722 "Content-Type" = "application/json")
727 response <- private$REST$http$exec("GET", url, headers, body,
728 queryArgs, private$numRetries)
729 resource <- private$REST$httpParser$parseJSONResponse(response)
731 if(!is.null(resource$errors))
732 stop(resource$errors)
738 #' collections_create is a method defined in Arvados class that enables collections creation.
739 #' @param name Name of the collection.
740 #' @param description Description of the collection.
741 #' @param ownerUUID UUID of the maternal project to created one.
742 #' @param properties Properties of the collection.
743 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
744 #' @param clusterID Create object on a remote federated cluster instead of the current one.
747 #' Properties <- list() # should contain a list of new properties to be added
748 #' arv$collections_create(name = "collectionTitle", description = "collectionDescription", ownerUUID = "collectionOwner", properties = Properties)
750 collections_create = function(name, description, ownerUUID = NULL, properties = NULL, # name and description are obligatory
751 ensureUniqueName = "false", clusterID = NULL)
753 endPoint <- stringr::str_interp("collections")
754 url <- paste0(private$host, endPoint)
755 headers <- list(Authorization = paste("Bearer", private$token),
756 "Content-Type" = "application/json")
757 queryArgs <- list(ensureUniqueName = ensureUniqueName,
758 clusterID = clusterID)
760 collection <- list(name = name, description = description, owner_uuid = ownerUUID, properties = properties)
761 if(length(collection) > 0)
762 body <- jsonlite::toJSON(list(collection = collection),
767 response <- private$REST$http$exec("POST", url, headers, body,
768 queryArgs, private$numRetries)
769 resource <- private$REST$httpParser$parseJSONResponse(response)
771 if(!is.null(resource$errors)){
772 if(identical(sub('Entity:.*',"", resource$errors), "//railsapi.internal/arvados/v1/collections: 422 Unprocessable ")){
773 resource <- cat(format("A collection with the given name already exists in this projects. If you want to update it use collections_update() instead"))
775 stop(resource$errors)
783 #' collections_update is a method defined in Arvados class.
784 #' @param name New name of the collection.
785 #' @param description New description of the collection.
786 #' @param ownerUUID UUID of the maternal project to created one.
787 #' @param properties New list of properties of the collection.
788 #' @param uuid The UUID of the Collection in question.
791 #' collection <- arv$collections_update(name = "newCollectionTitle", description = "newCollectionDescription", ownerUUID = "collectionOwner", properties = NULL, uuid = "collectionUUID")
793 collections_update = function(name, description, ownerUUID = NULL, properties = NULL, uuid)
795 endPoint <- stringr::str_interp("collections/${uuid}")
796 url <- paste0(private$host, endPoint)
797 headers <- list(Authorization = paste("Bearer", private$token),
798 "Content-Type" = "application/json")
801 collection <- list(name = name, description = description, ownerUUID = ownerUUID, properties = properties)
802 if(length(collection) > 0)
803 body <- jsonlite::toJSON(list(collection = collection),
808 response <- private$REST$http$exec("PUT", url, headers, body,
809 queryArgs, private$numRetries)
810 resource <- private$REST$httpParser$parseJSONResponse(response)
812 if(!is.null(resource$errors))
813 stop(resource$errors)
819 #' collections_delete is a method defined in Arvados class.
820 #' @param uuid The UUID of the Collection in question.
823 #' arv$collection_delete(collectionUUID)
825 collections_delete = function(uuid)
827 endPoint <- stringr::str_interp("collections/${uuid}")
828 url <- paste0(private$host, endPoint)
829 headers <- list(Authorization = paste("Bearer", private$token),
830 "Content-Type" = "application/json")
835 response <- private$REST$http$exec("DELETE", url, headers, body,
836 queryArgs, private$numRetries)
837 resource <- private$REST$httpParser$parseJSONResponse(response)
839 if(!is.null(resource$errors))
840 stop(resource$errors)
846 #' collections_provenance is a method defined in Arvados class, it returns the collection by uuid.
847 #' @param uuid The UUID of the Collection in question.
850 #' collection <- arv$collections_provenance(collectionUUID)
852 collections_provenance = function(uuid)
854 endPoint <- stringr::str_interp("collections/${uuid}/provenance")
855 url <- paste0(private$host, endPoint)
856 headers <- list(Authorization = paste("Bearer", private$token),
857 "Content-Type" = "application/json")
862 response <- private$REST$http$exec("GET", url, headers, body,
863 queryArgs, private$numRetries)
864 resource <- private$REST$httpParser$parseJSONResponse(response)
866 if(!is.null(resource$errors))
867 stop(resource$errors)
873 #' collections_used_by is a method defined in Arvados class, it returns collection by portable_data_hash.
874 #' @param uuid The UUID of the Collection in question.
875 collections_used_by = function(uuid)
877 endPoint <- stringr::str_interp("collections/${uuid}/used_by")
878 url <- paste0(private$host, endPoint)
879 headers <- list(Authorization = paste("Bearer", private$token),
880 "Content-Type" = "application/json")
885 response <- private$REST$http$exec("GET", url, headers, body,
886 queryArgs, private$numRetries)
887 resource <- private$REST$httpParser$parseJSONResponse(response)
889 if(!is.null(resource$errors))
890 stop(resource$errors)
896 #' collections_trash is a method defined in Arvados class, it moves collection to trash.
897 #' @param uuid The UUID of the Collection in question.
900 #' arv$collections_trash(collectionUUID)
902 collections_trash = function(uuid)
904 endPoint <- stringr::str_interp("collections/${uuid}/trash")
905 url <- paste0(private$host, endPoint)
906 headers <- list(Authorization = paste("Bearer", private$token),
907 "Content-Type" = "application/json")
912 response <- private$REST$http$exec("POST", url, headers, body,
913 queryArgs, private$numRetries)
914 resource <- private$REST$httpParser$parseJSONResponse(response)
916 if(!is.null(resource$errors))
917 stop(resource$errors)
923 #' collections_untrash is a method defined in Arvados class, it moves collection from trash to project.
924 #' @param uuid The UUID of the Collection in question.
927 #' arv$collections_untrash(collectionUUID)
929 collections_untrash = function(uuid)
931 endPoint <- stringr::str_interp("collections/${uuid}/untrash")
932 url <- paste0(private$host, endPoint)
933 headers <- list(Authorization = paste("Bearer", private$token),
934 "Content-Type" = "application/json")
939 response <- private$REST$http$exec("POST", url, headers, body,
940 queryArgs, private$numRetries)
941 resource <- private$REST$httpParser$parseJSONResponse(response)
943 if(!is.null(resource$errors))
944 stop(resource$errors)
950 #' collections_list is a method defined in Arvados class.
959 #' @param clusterID List objects on a remote federated cluster instead of the current one.
960 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
961 #' @param includeTrash Include collections whose is_trashed attribute is true.
962 #' @param includeOldVersions Include past collection versions.
965 #' collectionList <- arv$collections_list(list(list("name", "=", "Example")))
967 collections_list = function(filters = NULL,
968 where = NULL, order = NULL, select = NULL,
969 distinct = NULL, limit = "100", offset = "0",
970 count = "exact", clusterID = NULL, bypassFederation = NULL,
971 includeTrash = NULL, includeOldVersions = NULL)
973 endPoint <- stringr::str_interp("collections")
974 url <- paste0(private$host, endPoint)
975 headers <- list(Authorization = paste("Bearer", private$token),
976 "Content-Type" = "application/json")
977 queryArgs <- list(filters = filters, where = where,
978 order = order, select = select, distinct = distinct,
979 limit = limit, offset = offset, count = count,
980 clusterID = clusterID, bypassFederation = bypassFederation,
981 includeTrash = includeTrash, includeOldVersions = includeOldVersions)
985 response <- private$REST$http$exec("GET", url, headers, body,
986 queryArgs, private$numRetries)
987 resource <- private$REST$httpParser$parseJSONResponse(response)
989 if(!is.null(resource$errors))
990 stop(resource$errors)
996 #' containers_get is a method defined in Arvados class.
997 #' @param uuid The UUID of the Container in question.
998 containers_get = function(uuid)
1000 endPoint <- stringr::str_interp("containers/${uuid}")
1001 url <- paste0(private$host, endPoint)
1002 headers <- list(Authorization = paste("Bearer", private$token),
1003 "Content-Type" = "application/json")
1008 response <- private$REST$http$exec("GET", url, headers, body,
1009 queryArgs, private$numRetries)
1010 resource <- private$REST$httpParser$parseJSONResponse(response)
1012 if(!is.null(resource$errors))
1013 stop(resource$errors)
1019 #' containers_create is a method defined in Arvados class.
1020 #' @param container Container object.
1021 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
1022 #' @param clusterID Create object on a remote federated cluster instead of the current one.
1023 containers_create = function(container, ensureUniqueName = "false",
1026 endPoint <- stringr::str_interp("containers")
1027 url <- paste0(private$host, endPoint)
1028 headers <- list(Authorization = paste("Bearer", private$token),
1029 "Content-Type" = "application/json")
1030 queryArgs <- list(ensureUniqueName = ensureUniqueName,
1031 clusterID = clusterID)
1033 if(length(container) > 0)
1034 body <- jsonlite::toJSON(list(container = container),
1039 response <- private$REST$http$exec("POST", url, headers, body,
1040 queryArgs, private$numRetries)
1041 resource <- private$REST$httpParser$parseJSONResponse(response)
1043 if(!is.null(resource$errors))
1044 stop(resource$errors)
1050 #' containers_update is a method defined in Arvados class.
1051 #' @param container Container object.
1052 #' @param uuid The UUID of the Container in question.
1053 containers_update = function(container, uuid)
1055 endPoint <- stringr::str_interp("containers/${uuid}")
1056 url <- paste0(private$host, endPoint)
1057 headers <- list(Authorization = paste("Bearer", private$token),
1058 "Content-Type" = "application/json")
1061 if(length(container) > 0)
1062 body <- jsonlite::toJSON(list(container = container),
1067 response <- private$REST$http$exec("PUT", url, headers, body,
1068 queryArgs, private$numRetries)
1069 resource <- private$REST$httpParser$parseJSONResponse(response)
1071 if(!is.null(resource$errors))
1072 stop(resource$errors)
1078 #' containers_delete is a method defined in Arvados class.
1079 #' @param uuid The UUID of the Container in question.
1080 containers_delete = function(uuid)
1082 endPoint <- stringr::str_interp("containers/${uuid}")
1083 url <- paste0(private$host, endPoint)
1084 headers <- list(Authorization = paste("Bearer", private$token),
1085 "Content-Type" = "application/json")
1090 response <- private$REST$http$exec("DELETE", url, headers, body,
1091 queryArgs, private$numRetries)
1092 resource <- private$REST$httpParser$parseJSONResponse(response)
1094 if(!is.null(resource$errors))
1095 stop(resource$errors)
1101 #' containers_auth is a method defined in Arvados class.
1102 #' @param uuid The UUID of the Container in question.
1103 containers_auth = function(uuid)
1105 endPoint <- stringr::str_interp("containers/${uuid}/auth")
1106 url <- paste0(private$host, endPoint)
1107 headers <- list(Authorization = paste("Bearer", private$token),
1108 "Content-Type" = "application/json")
1113 response <- private$REST$http$exec("GET", url, headers, body,
1114 queryArgs, private$numRetries)
1115 resource <- private$REST$httpParser$parseJSONResponse(response)
1117 if(!is.null(resource$errors))
1118 stop(resource$errors)
1124 #' containers_lock is a method defined in Arvados class.
1125 #' @param uuid The UUID of the Container in question.
1126 containers_lock = function(uuid)
1128 endPoint <- stringr::str_interp("containers/${uuid}/lock")
1129 url <- paste0(private$host, endPoint)
1130 headers <- list(Authorization = paste("Bearer", private$token),
1131 "Content-Type" = "application/json")
1136 response <- private$REST$http$exec("POST", url, headers, body,
1137 queryArgs, private$numRetries)
1138 resource <- private$REST$httpParser$parseJSONResponse(response)
1140 if(!is.null(resource$errors))
1141 stop(resource$errors)
1147 #' containers_unlock is a method defined in Arvados class.
1148 #' @param uuid The UUID of the Container in question.
1149 containers_unlock = function(uuid)
1151 endPoint <- stringr::str_interp("containers/${uuid}/unlock")
1152 url <- paste0(private$host, endPoint)
1153 headers <- list(Authorization = paste("Bearer", private$token),
1154 "Content-Type" = "application/json")
1159 response <- private$REST$http$exec("POST", url, headers, body,
1160 queryArgs, private$numRetries)
1161 resource <- private$REST$httpParser$parseJSONResponse(response)
1163 if(!is.null(resource$errors))
1164 stop(resource$errors)
1170 #' containers_secret_mounts is a method defined in Arvados class.
1171 #' @param uuid The UUID of the Container in question.
1172 containers_secret_mounts = function(uuid)
1174 endPoint <- stringr::str_interp("containers/${uuid}/secret_mounts")
1175 url <- paste0(private$host, endPoint)
1176 headers <- list(Authorization = paste("Bearer", private$token),
1177 "Content-Type" = "application/json")
1182 response <- private$REST$http$exec("GET", url, headers, body,
1183 queryArgs, private$numRetries)
1184 resource <- private$REST$httpParser$parseJSONResponse(response)
1186 if(!is.null(resource$errors))
1187 stop(resource$errors)
1193 #' containers_current is a method defined in Arvados class.
1194 containers_current = function()
1196 endPoint <- stringr::str_interp("containers/current")
1197 url <- paste0(private$host, endPoint)
1198 headers <- list(Authorization = paste("Bearer", private$token),
1199 "Content-Type" = "application/json")
1204 response <- private$REST$http$exec("GET", url, headers, body,
1205 queryArgs, private$numRetries)
1206 resource <- private$REST$httpParser$parseJSONResponse(response)
1208 if(!is.null(resource$errors))
1209 stop(resource$errors)
1215 #' containers_list is a method defined in Arvados class.
1224 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1225 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
1226 containers_list = function(filters = NULL,
1227 where = NULL, order = NULL, select = NULL,
1228 distinct = NULL, limit = "100", offset = "0",
1229 count = "exact", clusterID = NULL, bypassFederation = NULL)
1231 endPoint <- stringr::str_interp("containers")
1232 url <- paste0(private$host, endPoint)
1233 headers <- list(Authorization = paste("Bearer", private$token),
1234 "Content-Type" = "application/json")
1235 queryArgs <- list(filters = filters, where = where,
1236 order = order, select = select, distinct = distinct,
1237 limit = limit, offset = offset, count = count,
1238 clusterID = clusterID, bypassFederation = bypassFederation)
1242 response <- private$REST$http$exec("GET", url, headers, body,
1243 queryArgs, private$numRetries)
1244 resource <- private$REST$httpParser$parseJSONResponse(response)
1246 if(!is.null(resource$errors))
1247 stop(resource$errors)
1253 #' container_requests_get is a method defined in Arvados class.
1254 #' @param uuid The UUID of the containerRequest in question.
1255 container_requests_get = function(uuid)
1257 endPoint <- stringr::str_interp("container_requests/${uuid}")
1258 url <- paste0(private$host, endPoint)
1259 headers <- list(Authorization = paste("Bearer", private$token),
1260 "Content-Type" = "application/json")
1265 response <- private$REST$http$exec("GET", url, headers, body,
1266 queryArgs, private$numRetries)
1267 resource <- private$REST$httpParser$parseJSONResponse(response)
1269 if(!is.null(resource$errors))
1270 stop(resource$errors)
1276 #' container_requests_create is a method defined in Arvados class.
1277 #' @param containerRequest containerRequest object.
1278 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
1279 #' @param clusterID Create object on a remote federated cluster instead of the current one.
1280 container_requests_create = function(containerRequest,
1281 ensureUniqueName = "false", clusterID = NULL)
1283 endPoint <- stringr::str_interp("container_requests")
1284 url <- paste0(private$host, endPoint)
1285 headers <- list(Authorization = paste("Bearer", private$token),
1286 "Content-Type" = "application/json")
1287 queryArgs <- list(ensureUniqueName = ensureUniqueName,
1288 clusterID = clusterID)
1290 if(length(containerRequest) > 0)
1291 body <- jsonlite::toJSON(list(containerRequest = containerRequest),
1296 response <- private$REST$http$exec("POST", url, headers, body,
1297 queryArgs, private$numRetries)
1298 resource <- private$REST$httpParser$parseJSONResponse(response)
1300 if(!is.null(resource$errors))
1301 stop(resource$errors)
1307 #' container_requests_update is a method defined in Arvados class.
1308 #' @param containerRequest containerRequest object.
1309 #' @param uuid The UUID of the containerRequest in question.
1310 container_requests_update = function(containerRequest, uuid)
1312 endPoint <- stringr::str_interp("container_requests/${uuid}")
1313 url <- paste0(private$host, endPoint)
1314 headers <- list(Authorization = paste("Bearer", private$token),
1315 "Content-Type" = "application/json")
1318 if(length(containerRequest) > 0)
1319 body <- jsonlite::toJSON(list(containerRequest = containerRequest),
1324 response <- private$REST$http$exec("PUT", url, headers, body,
1325 queryArgs, private$numRetries)
1326 resource <- private$REST$httpParser$parseJSONResponse(response)
1328 if(!is.null(resource$errors))
1329 stop(resource$errors)
1335 #' container_requests_delete is a method defined in Arvados class.
1336 #' @param uuid The UUID of the containerRequest in question.
1337 container_requests_delete = function(uuid)
1339 endPoint <- stringr::str_interp("container_requests/${uuid}")
1340 url <- paste0(private$host, endPoint)
1341 headers <- list(Authorization = paste("Bearer", private$token),
1342 "Content-Type" = "application/json")
1347 response <- private$REST$http$exec("DELETE", url, headers, body,
1348 queryArgs, private$numRetries)
1349 resource <- private$REST$httpParser$parseJSONResponse(response)
1351 if(!is.null(resource$errors))
1352 stop(resource$errors)
1358 #' container_requests_list is a method defined in Arvados class.
1367 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1368 #' @param bypassFederation bypass federation behavior, list items from local instance database only
1369 #' @param includeTrash Include container requests whose owner project is trashed.
1370 container_requests_list = function(filters = NULL,
1371 where = NULL, order = NULL, select = NULL,
1372 distinct = NULL, limit = "100", offset = "0",
1373 count = "exact", clusterID = NULL, bypassFederation = NULL,
1374 includeTrash = NULL)
1376 endPoint <- stringr::str_interp("container_requests")
1377 url <- paste0(private$host, endPoint)
1378 headers <- list(Authorization = paste("Bearer", private$token),
1379 "Content-Type" = "application/json")
1380 queryArgs <- list(filters = filters, where = where,
1381 order = order, select = select, distinct = distinct,
1382 limit = limit, offset = offset, count = count,
1383 clusterID = clusterID, bypassFederation = bypassFederation,
1384 includeTrash = includeTrash)
1388 response <- private$REST$http$exec("GET", url, headers, body,
1389 queryArgs, private$numRetries)
1390 resource <- private$REST$httpParser$parseJSONResponse(response)
1392 if(!is.null(resource$errors))
1393 stop(resource$errors)
1399 #' groups_get is a method defined in Arvados class.
1400 #' @param uuid The UUID of the Group in question.
1401 groups_get = function(uuid)
1403 endPoint <- stringr::str_interp("groups/${uuid}")
1404 url <- paste0(private$host, endPoint)
1405 headers <- list(Authorization = paste("Bearer", private$token),
1406 "Content-Type" = "application/json")
1412 response <- private$REST$http$exec("GET", url, headers, body,
1413 queryArgs, private$numRetries)
1414 resource <- private$REST$httpParser$parseJSONResponse(response)
1416 if(!is.null(resource$errors))
1417 stop(resource$errors)
1423 #' groups_create is a method defined in Arvados class that supports project creation.
1424 #' @param group Group object.
1425 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
1426 #' @param clusterID Create object on a remote federated cluster instead of the current one.
1427 #' @param async Defer permissions update.
1428 groups_create = function(group, ensureUniqueName = "false",
1429 clusterID = NULL, async = "false")
1431 endPoint <- stringr::str_interp("groups")
1432 url <- paste0(private$host, endPoint)
1433 headers <- list(Authorization = paste("Bearer", private$token),
1434 "Content-Type" = "application/json")
1436 queryArgs <- list(ensureUniqueName = ensureUniqueName,
1437 clusterID = clusterID, async = async)
1439 if(length(group) > 0)
1440 body <- jsonlite::toJSON(list(group = group),
1445 response <- private$REST$http$exec("POST", url, headers, body,
1446 queryArgs, private$numRetries)
1448 resource <- private$REST$httpParser$parseJSONResponse(response)
1450 if(!is.null(resource$errors)){
1451 if (identical(sub('#.*', "", resource$errors), "//railsapi.internal/arvados/v1/groups: 422 Unprocessable Entity: ")) {
1452 #if (identical(sub('P.*', "", resource$errors), "//railsapi.internal/arvados/v1/groups: 422 Unprocessable Entity: #\u003cActiveRecord::RecordNotUnique: ")) {
1453 resource <- cat(format("Project of that name already exist. If you want to update it use project_update() instead"))
1455 stop(resource$errors)
1463 #' groups_update is a method defined in Arvados class.
1464 #' @param group Group object.
1465 #' @param uuid The UUID of the Group in question.
1466 #' @param async Defer permissions update.
1467 groups_update = function(group, uuid, async = "false")
1469 endPoint <- stringr::str_interp("groups/${uuid}")
1470 url <- paste0(private$host, endPoint)
1471 headers <- list(Authorization = paste("Bearer", private$token),
1472 "Content-Type" = "application/json")
1474 queryArgs <- list(async = async)
1476 if(length(group) > 0)
1477 body <- jsonlite::toJSON(list(group = group),
1482 response <- private$REST$http$exec("PUT", url, headers, body,
1483 queryArgs, private$numRetries)
1484 resource <- private$REST$httpParser$parseJSONResponse(response)
1486 if(!is.null(resource$errors))
1487 stop(resource$errors)
1493 #' groups_delete is a method defined in Arvados class.
1494 #' @param uuid The UUID of the Group in question.
1495 groups_delete = function(uuid)
1497 endPoint <- stringr::str_interp("groups/${uuid}")
1498 url <- paste0(private$host, endPoint)
1499 headers <- list(Authorization = paste("Bearer", private$token),
1500 "Content-Type" = "application/json")
1506 response <- private$REST$http$exec("DELETE", url, headers, body,
1507 queryArgs, private$numRetries)
1508 resource <- private$REST$httpParser$parseJSONResponse(response)
1510 if(!is.null(resource$errors))
1511 stop(resource$errors)
1513 dataTime <- gsub("T.*", "", resource$delete_at)
1514 cat("The content will be deleted permanently at", dataTime)
1520 #' groups_contents is a method defined in Arvados class.
1528 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1529 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
1530 #' @param includeTrash Include items whose is_trashed attribute is true.
1532 #' @param recursive Include contents from child groups recursively.
1533 #' @param include Include objects referred to by listed field in "included" (only ownerUUID).
1534 groups_contents = function(filters = NULL,
1535 where = NULL, order = NULL, distinct = NULL,
1536 limit = "100", offset = "0", count = "exact",
1537 clusterID = NULL, bypassFederation = NULL,
1538 includeTrash = NULL, uuid = NULL, recursive = NULL,
1541 endPoint <- stringr::str_interp("groups/contents")
1542 url <- paste0(private$host, endPoint)
1543 headers <- list(Authorization = paste("Bearer", private$token),
1544 "Content-Type" = "application/json")
1546 queryArgs <- list(filters = filters, where = where,
1547 order = order, distinct = distinct, limit = limit,
1548 offset = offset, count = count, clusterID = clusterID,
1549 bypassFederation = bypassFederation, includeTrash = includeTrash,
1550 uuid = uuid, recursive = recursive, include = include)
1554 response <- private$REST$http$exec("GET", url, headers, body,
1555 queryArgs, private$numRetries)
1556 resource <- private$REST$httpParser$parseJSONResponse(response)
1558 if(!is.null(resource$errors))
1559 stop(resource$errors)
1565 #' groups_shared is a method defined in Arvados class.
1574 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1575 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
1576 #' @param includeTrash Include items whose is_trashed attribute is true.
1578 groups_shared = function(filters = NULL,
1579 where = NULL, order = NULL, select = NULL,
1580 distinct = NULL, limit = "100", offset = "0",
1581 count = "exact", clusterID = NULL, bypassFederation = NULL,
1582 includeTrash = NULL, include = NULL)
1584 endPoint <- stringr::str_interp("groups/shared")
1585 url <- paste0(private$host, endPoint)
1586 headers <- list(Authorization = paste("Bearer", private$token),
1587 "Content-Type" = "application/json")
1589 queryArgs <- list(filters = filters, where = where,
1590 order = order, select = select, distinct = distinct,
1591 limit = limit, offset = offset, count = count,
1592 clusterID = clusterID, bypassFederation = bypassFederation,
1593 includeTrash = includeTrash, include = include)
1597 response <- private$REST$http$exec("GET", url, headers, body,
1598 queryArgs, private$numRetries)
1599 resource <- private$REST$httpParser$parseJSONResponse(response)
1601 if(!is.null(resource$errors))
1602 stop(resource$errors)
1608 #' groups_trash is a method defined in Arvados class.
1609 #' @param uuid The UUID of the Group in question.
1610 groups_trash = function(uuid)
1612 endPoint <- stringr::str_interp("groups/${uuid}/trash")
1613 url <- paste0(private$host, endPoint)
1614 headers <- list(Authorization = paste("Bearer", private$token),
1615 "Content-Type" = "application/json")
1621 response <- private$REST$http$exec("POST", url, headers, body,
1622 queryArgs, private$numRetries)
1623 resource <- private$REST$httpParser$parseJSONResponse(response)
1625 if(!is.null(resource$errors))
1626 stop(resource$errors)
1632 #' groups_untrash is a method defined in Arvados class.
1633 #' @param uuid The UUID of the Group in question.
1634 groups_untrash = function(uuid)
1636 endPoint <- stringr::str_interp("groups/${uuid}/untrash")
1637 url <- paste0(private$host, endPoint)
1638 headers <- list(Authorization = paste("Bearer", private$token),
1639 "Content-Type" = "application/json")
1645 response <- private$REST$http$exec("POST", url, headers, body,
1646 queryArgs, private$numRetries)
1647 resource <- private$REST$httpParser$parseJSONResponse(response)
1649 if(!is.null(resource$errors))
1650 stop(resource$errors)
1656 #' groups_list is a method defined in Arvados class.
1665 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1666 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
1667 #' @param includeTrash Include items whose is_trashed attribute is true.
1668 groups_list = function(filters = NULL, where = NULL,
1669 order = NULL, select = NULL, distinct = NULL,
1670 limit = "100", offset = "0", count = "exact",
1671 clusterID = NULL, bypassFederation = NULL,
1672 includeTrash = NULL)
1674 endPoint <- stringr::str_interp("groups")
1675 url <- paste0(private$host, endPoint)
1676 headers <- list(Authorization = paste("Bearer", private$token),
1677 "Content-Type" = "application/json")
1679 queryArgs <- list(filters = filters, where = where,
1680 order = order, select = select, distinct = distinct,
1681 limit = limit, offset = offset, count = count,
1682 clusterID = clusterID, bypassFederation = bypassFederation,
1683 includeTrash = includeTrash)
1687 response <- private$REST$http$exec("GET", url, headers, body,
1688 queryArgs, private$numRetries)
1689 resource <- private$REST$httpParser$parseJSONResponse(response)
1691 if(!is.null(resource$errors))
1692 stop(resource$errors)
1698 #' keep_services_get is a method defined in Arvados class.
1699 #' @param uuid The UUID of the keepService in question.
1700 keep_services_get = function(uuid)
1702 endPoint <- stringr::str_interp("keep_services/${uuid}")
1703 url <- paste0(private$host, endPoint)
1704 headers <- list(Authorization = paste("Bearer", private$token),
1705 "Content-Type" = "application/json")
1710 response <- private$REST$http$exec("GET", url, headers, body,
1711 queryArgs, private$numRetries)
1712 resource <- private$REST$httpParser$parseJSONResponse(response)
1714 if(!is.null(resource$errors))
1715 stop(resource$errors)
1721 #' keep_services_create is a method defined in Arvados class.
1722 #' @param keepService keepService object.
1723 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
1724 #' @param clusterID Create object on a remote federated cluster instead of the current one.
1725 keep_services_create = function(keepService,
1726 ensureUniqueName = "false", clusterID = NULL)
1728 endPoint <- stringr::str_interp("keep_services")
1729 url <- paste0(private$host, endPoint)
1730 headers <- list(Authorization = paste("Bearer", private$token),
1731 "Content-Type" = "application/json")
1732 queryArgs <- list(ensureUniqueName = ensureUniqueName,
1733 clusterID = clusterID)
1735 if(length(keepService) > 0)
1736 body <- jsonlite::toJSON(list(keepService = keepService),
1741 response <- private$REST$http$exec("POST", url, headers, body,
1742 queryArgs, private$numRetries)
1743 resource <- private$REST$httpParser$parseJSONResponse(response)
1745 if(!is.null(resource$errors))
1746 stop(resource$errors)
1752 #' keep_services_update is a method defined in Arvados class.
1753 #' @param keepService keepService object.
1754 #' @param uuid The UUID of the keepService in question.
1755 keep_services_update = function(keepService, uuid)
1757 endPoint <- stringr::str_interp("keep_services/${uuid}")
1758 url <- paste0(private$host, endPoint)
1759 headers <- list(Authorization = paste("Bearer", private$token),
1760 "Content-Type" = "application/json")
1763 if(length(keepService) > 0)
1764 body <- jsonlite::toJSON(list(keepService = keepService),
1769 response <- private$REST$http$exec("PUT", url, headers, body,
1770 queryArgs, private$numRetries)
1771 resource <- private$REST$httpParser$parseJSONResponse(response)
1773 if(!is.null(resource$errors))
1774 stop(resource$errors)
1780 #' keep_services_delete is a method defined in Arvados class.
1781 #' @param uuid The UUID of the keepService in question.
1782 keep_services_delete = function(uuid)
1784 endPoint <- stringr::str_interp("keep_services/${uuid}")
1785 url <- paste0(private$host, endPoint)
1786 headers <- list(Authorization = paste("Bearer", private$token),
1787 "Content-Type" = "application/json")
1792 response <- private$REST$http$exec("DELETE", url, headers, body,
1793 queryArgs, private$numRetries)
1794 resource <- private$REST$httpParser$parseJSONResponse(response)
1796 if(!is.null(resource$errors))
1797 stop(resource$errors)
1803 #' keep_services_accessible is a method defined in Arvados class.
1804 keep_services_accessible = function()
1806 endPoint <- stringr::str_interp("keep_services/accessible")
1807 url <- paste0(private$host, endPoint)
1808 headers <- list(Authorization = paste("Bearer", private$token),
1809 "Content-Type" = "application/json")
1814 response <- private$REST$http$exec("GET", url, headers, body,
1815 queryArgs, private$numRetries)
1816 resource <- private$REST$httpParser$parseJSONResponse(response)
1818 if(!is.null(resource$errors))
1819 stop(resource$errors)
1825 #' keep_services_list is a method defined in Arvados class.
1834 #' @param clusterID List objects on a remote federated cluster instead of the current one.
1835 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
1836 keep_services_list = function(filters = NULL,
1837 where = NULL, order = NULL, select = NULL,
1838 distinct = NULL, limit = "100", offset = "0",
1839 count = "exact", clusterID = NULL, bypassFederation = NULL)
1841 endPoint <- stringr::str_interp("keep_services")
1842 url <- paste0(private$host, endPoint)
1843 headers <- list(Authorization = paste("Bearer", private$token),
1844 "Content-Type" = "application/json")
1845 queryArgs <- list(filters = filters, where = where,
1846 order = order, select = select, distinct = distinct,
1847 limit = limit, offset = offset, count = count,
1848 clusterID = clusterID, bypassFederation = bypassFederation)
1852 response <- private$REST$http$exec("GET", url, headers, body,
1853 queryArgs, private$numRetries)
1854 resource <- private$REST$httpParser$parseJSONResponse(response)
1856 if(!is.null(resource$errors))
1857 stop(resource$errors)
1863 #' project_permission_give is a method defined in Arvados class that enables sharing files with another users.
1864 #' @param type Possible options are can_read or can_write or can_manage.
1865 #' @param uuid The UUID of a project or a file.
1866 #' @param user The UUID of the person that gets the permission.
1869 #' arv$project_permission_give(type = "can_read", uuid = objectUUID, user = userUUID)
1871 project_permission_give = function(type, uuid, user)
1873 endPoint <- stringr::str_interp("links")
1874 url <- paste0(private$host, endPoint)
1875 headers <- list(Authorization = paste("Bearer", private$token),
1876 "Content-Type" = "application/json")
1879 # it is possible to make it as pasting a list to function, not a 3 arg. What's better?
1880 link <- list("link_class" = "permission", "name" = type, "head_uuid" = uuid, "tail_uuid" = user)
1882 if(length(link) > 0)
1883 body <- jsonlite::toJSON(list(link = link),
1888 response <- private$REST$http$exec("POST", url, headers, body,
1889 queryArgs, private$numRetries)
1890 resource <- private$REST$httpParser$parseJSONResponse(response)
1892 if(!is.null(resource$errors))
1893 stop(resource$errors)
1899 #' project_permission_refuse is a method defined in Arvados class that unables sharing files with another users.
1900 #' @param type Possible options are can_read or can_write or can_manage.
1901 #' @param uuid The UUID of a project or a file.
1902 #' @param user The UUID of a person that permissions are taken from.
1905 #' arv$project_permission_refuse(type = "can_read", uuid = objectUUID, user = userUUID)
1907 project_permission_refuse = function(type, uuid, user)
1909 examples <- self$links_list(list(list("head_uuid","=", uuid)))
1911 theUser <- examples[which(sapply(examples$items, "[[", "tail_uuid") == user)]
1912 theType <- theUser$items[which(sapply(theUser$items, "[[", "name") == type)]
1913 solution <- theType[which(sapply(theType, "[[", "link_class") == 'permission')]
1915 if (length(solution) == 0) {
1916 cat(format('No permission granted'))
1918 self$links_delete(solution[[1]]$uuid)
1924 #' project_permission_update is a method defined in Arvados class that enables updating permissions.
1925 #' @param typeNew New option like can_read or can_write or can_manage.
1926 #' @param typeOld Old option.
1927 #' @param uuid The UUID of a project or a file.
1928 #' @param user The UUID of the person that the permission is being updated.
1931 #' arv$project_permission_update(typeOld = "can_read", typeNew = "can_write", uuid = objectUUID, user = userUUID)
1933 project_permission_update = function(typeOld, typeNew, uuid, user)
1935 link <- list("name" = typeNew)
1937 examples <- self$links_list(list(list("head_uuid","=", uuid)))
1939 theUser <- examples[which(sapply(examples$items, "[[", "tail_uuid") == user)]
1940 theType <- theUser$items[which(sapply(theUser$items, "[[", "name") == typeOld)]
1941 solution <- theType[which(sapply(theType, "[[", "link_class") == 'permission')]
1943 if (length(solution) == 0) {
1944 cat(format('No permission granted'))
1946 self$links_update(link, solution[[1]]$uuid)
1951 #' project_permission_check is a method defined in Arvados class that enables checking file permissions.
1952 #' @param uuid The UUID of a project or a file.
1953 #' @param user The UUID of the person that the permission is being updated.
1954 #' @param type Possible options are can_read or can_write or can_manage.
1957 #' arv$project_permission_check(type = "can_read", uuid = objectUUID, user = userUUID)
1959 project_permission_check = function(uuid, user, type = NULL)
1961 examples <- self$links_list(list(list("head_uuid","=", uuid)))
1963 theUser <- examples[which(sapply(examples$items, "[[", "tail_uuid") == user)]
1965 if (length(type) == 0 ){
1968 theType <- theUser$items[which(sapply(theUser$items, "[[", "name") == type)]
1969 permisions <- theType[which(sapply(theType, "[[", "link_class") == 'permission')]
1970 print(permisions[[1]]$name)
1975 #' links_get is a method defined in Arvados class.
1976 #' @param uuid The UUID of the Link in question.
1977 links_get = function(uuid)
1979 endPoint <- stringr::str_interp("links/${uuid}")
1980 url <- paste0(private$host, endPoint)
1981 headers <- list(Authorization = paste("Bearer", private$token),
1982 "Content-Type" = "application/json")
1987 response <- private$REST$http$exec("GET", url, headers, body,
1988 queryArgs, private$numRetries)
1989 resource <- private$REST$httpParser$parseJSONResponse(response)
1991 if(!is.null(resource$errors))
1992 stop(resource$errors)
1998 #' links_create is a method defined in Arvados class.
1999 #' @param link Link object.
2000 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2001 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2002 links_create = function(link, ensureUniqueName = "false",
2005 endPoint <- stringr::str_interp("links")
2006 url <- paste0(private$host, endPoint)
2007 headers <- list(Authorization = paste("Bearer", private$token),
2008 "Content-Type" = "application/json")
2009 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2010 clusterID = clusterID)
2012 if(length(link) > 0)
2013 body <- jsonlite::toJSON(list(link = link),
2018 response <- private$REST$http$exec("POST", url, headers, body,
2019 queryArgs, private$numRetries)
2020 resource <- private$REST$httpParser$parseJSONResponse(response)
2022 if(!is.null(resource$errors))
2023 stop(resource$errors)
2029 #' links_update is a method defined in Arvados class.
2030 #' @param link Link object.
2031 #' @param uuid The UUID of the Link in question.
2032 links_update = function(link, uuid, async = "false")
2034 endPoint <- stringr::str_interp("links/${uuid}")
2035 url <- paste0(private$host, endPoint)
2036 headers <- list(Authorization = paste("Bearer", private$token),
2037 "Content-Type" = "application/json")
2038 queryArgs <- list(async = async)
2040 if(length(link) > 0)
2041 body <- jsonlite::toJSON(list(link = link),
2046 response <- private$REST$http$exec("PUT", url, headers, body,
2047 queryArgs, private$numRetries)
2048 resource <- private$REST$httpParser$parseJSONResponse(response)
2050 if(!is.null(resource$errors))
2051 stop(resource$errors)
2057 #' links_delete is a method defined in Arvados class.
2058 #' @param uuid The UUID of the Link in question.
2059 links_delete = function(uuid)
2061 endPoint <- stringr::str_interp("links/${uuid}")
2062 url <- paste0(private$host, endPoint)
2063 headers <- list(Authorization = paste("Bearer", private$token),
2064 "Content-Type" = "application/json")
2069 response <- private$REST$http$exec("DELETE", url, headers, body,
2070 queryArgs, private$numRetries)
2071 resource <- private$REST$httpParser$parseJSONResponse(response)
2073 if(!is.null(resource$errors))
2074 stop(resource$errors)
2080 #' links_list is a method defined in Arvados class.
2089 #' @param clusterID List objects on a remote federated cluster instead of the current one.
2090 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
2091 links_list = function(filters = NULL, where = NULL,
2092 order = NULL, select = NULL, distinct = NULL,
2093 limit = "100", offset = "0", count = "exact",
2094 clusterID = NULL, bypassFederation = NULL)
2096 endPoint <- stringr::str_interp("links")
2097 url <- paste0(private$host, endPoint)
2098 headers <- list(Authorization = paste("Bearer", private$token),
2099 "Content-Type" = "application/json")
2100 queryArgs <- list(filters = filters, where = where,
2101 order = order, select = select, distinct = distinct,
2102 limit = limit, offset = offset, count = count,
2103 clusterID = clusterID, bypassFederation = bypassFederation)
2107 response <- private$REST$http$exec("GET", url, headers, body,
2108 queryArgs, private$numRetries)
2109 resource <- private$REST$httpParser$parseJSONResponse(response)
2111 if(!is.null(resource$errors))
2112 stop(resource$errors)
2118 #' links_get_permissions is a method defined in Arvados class.
2119 #' @param uuid The UUID of the Log in question.
2120 links_get_permissions = function(uuid)
2122 endPoint <- stringr::str_interp("permissions/${uuid}")
2123 url <- paste0(private$host, endPoint)
2124 headers <- list(Authorization = paste("Bearer", private$token),
2125 "Content-Type" = "application/json")
2130 response <- private$REST$http$exec("GET", url, headers, body,
2131 queryArgs, private$numRetries)
2132 resource <- private$REST$httpParser$parseJSONResponse(response)
2134 if(!is.null(resource$errors))
2135 stop(resource$errors)
2141 #' logs_get is a method defined in Arvados class.
2142 #' @param uuid The UUID of the Log in question.
2143 logs_get = function(uuid)
2145 endPoint <- stringr::str_interp("logs/${uuid}")
2146 url <- paste0(private$host, endPoint)
2147 headers <- list(Authorization = paste("Bearer", private$token),
2148 "Content-Type" = "application/json")
2153 response <- private$REST$http$exec("GET", url, headers, body,
2154 queryArgs, private$numRetries)
2155 resource <- private$REST$httpParser$parseJSONResponse(response)
2157 if(!is.null(resource$errors))
2158 stop(resource$errors)
2164 #' logs_create is a method defined in Arvados class.
2165 #' @param log Log object.
2166 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2167 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2168 logs_create = function(log, ensureUniqueName = "false",
2171 endPoint <- stringr::str_interp("logs")
2172 url <- paste0(private$host, endPoint)
2173 headers <- list(Authorization = paste("Bearer", private$token),
2174 "Content-Type" = "application/json")
2175 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2176 clusterID = clusterID)
2179 body <- jsonlite::toJSON(list(log = log),
2184 response <- private$REST$http$exec("POST", url, headers, body,
2185 queryArgs, private$numRetries)
2186 resource <- private$REST$httpParser$parseJSONResponse(response)
2188 if(!is.null(resource$errors))
2189 stop(resource$errors)
2195 #' logs_update is a method defined in Arvados class.
2196 #' @param log Log object.
2197 #' @param uuid The UUID of the Log in question.
2198 logs_update = function(log, uuid)
2200 endPoint <- stringr::str_interp("logs/${uuid}")
2201 url <- paste0(private$host, endPoint)
2202 headers <- list(Authorization = paste("Bearer", private$token),
2203 "Content-Type" = "application/json")
2207 body <- jsonlite::toJSON(list(log = log),
2212 response <- private$REST$http$exec("PUT", url, headers, body,
2213 queryArgs, private$numRetries)
2214 resource <- private$REST$httpParser$parseJSONResponse(response)
2216 if(!is.null(resource$errors))
2217 stop(resource$errors)
2223 #' logs_delete is a method defined in Arvados class.
2224 #' @param uuid The UUID of the Log in question.
2225 logs_delete = function(uuid)
2227 endPoint <- stringr::str_interp("logs/${uuid}")
2228 url <- paste0(private$host, endPoint)
2229 headers <- list(Authorization = paste("Bearer", private$token),
2230 "Content-Type" = "application/json")
2235 response <- private$REST$http$exec("DELETE", url, headers, body,
2236 queryArgs, private$numRetries)
2237 resource <- private$REST$httpParser$parseJSONResponse(response)
2239 if(!is.null(resource$errors))
2240 stop(resource$errors)
2246 #' logs_list is a method defined in Arvados class.
2255 #' @param clusterID List objects on a remote federated cluster instead of the current one.
2256 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
2257 logs_list = function(filters = NULL, where = NULL,
2258 order = NULL, select = NULL, distinct = NULL,
2259 limit = "100", offset = "0", count = "exact",
2260 clusterID = NULL, bypassFederation = NULL)
2262 endPoint <- stringr::str_interp("logs")
2263 url <- paste0(private$host, endPoint)
2264 headers <- list(Authorization = paste("Bearer", private$token),
2265 "Content-Type" = "application/json")
2266 queryArgs <- list(filters = filters, where = where,
2267 order = order, select = select, distinct = distinct,
2268 limit = limit, offset = offset, count = count,
2269 clusterID = clusterID, bypassFederation = bypassFederation)
2273 response <- private$REST$http$exec("GET", url, headers, body,
2274 queryArgs, private$numRetries)
2275 resource <- private$REST$httpParser$parseJSONResponse(response)
2277 if(!is.null(resource$errors))
2278 stop(resource$errors)
2284 #' users_get is a method defined in Arvados class.
2285 #' @param uuid The UUID of the User in question.
2286 users_get = function(uuid)
2288 endPoint <- stringr::str_interp("users/${uuid}")
2289 url <- paste0(private$host, endPoint)
2290 headers <- list(Authorization = paste("Bearer", private$token),
2291 "Content-Type" = "application/json")
2296 response <- private$REST$http$exec("GET", url, headers, body,
2297 queryArgs, private$numRetries)
2298 resource <- private$REST$httpParser$parseJSONResponse(response)
2300 if(!is.null(resource$errors))
2301 stop(resource$errors)
2307 #' users_create is a method defined in Arvados class.
2308 #' @param user User object.
2309 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2310 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2311 users_create = function(user, ensureUniqueName = "false",
2314 endPoint <- stringr::str_interp("users")
2315 url <- paste0(private$host, endPoint)
2316 headers <- list(Authorization = paste("Bearer", private$token),
2317 "Content-Type" = "application/json")
2318 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2319 clusterID = clusterID)
2321 if(length(user) > 0)
2322 body <- jsonlite::toJSON(list(user = user),
2327 response <- private$REST$http$exec("POST", url, headers, body,
2328 queryArgs, private$numRetries)
2329 resource <- private$REST$httpParser$parseJSONResponse(response)
2331 if(!is.null(resource$errors))
2332 stop(resource$errors)
2338 #' users_update is a method defined in Arvados class.
2339 #' @param user User object.
2340 #' @param uuid The UUID of the User in question.
2341 #' @param bypassFederation
2342 users_update = function(user, uuid, bypassFederation = NULL)
2344 endPoint <- stringr::str_interp("users/${uuid}")
2345 url <- paste0(private$host, endPoint)
2346 headers <- list(Authorization = paste("Bearer", private$token),
2347 "Content-Type" = "application/json")
2348 queryArgs <- list(bypassFederation = bypassFederation)
2350 if(length(user) > 0)
2351 body <- jsonlite::toJSON(list(user = user),
2356 response <- private$REST$http$exec("PUT", url, headers, body,
2357 queryArgs, private$numRetries)
2358 resource <- private$REST$httpParser$parseJSONResponse(response)
2360 if(!is.null(resource$errors))
2361 stop(resource$errors)
2367 #' users_delete is a method defined in Arvados class.
2368 #' @param uuid The UUID of the User in question.
2369 users_delete = function(uuid)
2371 endPoint <- stringr::str_interp("users/${uuid}")
2372 url <- paste0(private$host, endPoint)
2373 headers <- list(Authorization = paste("Bearer", private$token),
2374 "Content-Type" = "application/json")
2379 response <- private$REST$http$exec("DELETE", url, headers, body,
2380 queryArgs, private$numRetries)
2381 resource <- private$REST$httpParser$parseJSONResponse(response)
2383 if(!is.null(resource$errors))
2384 stop(resource$errors)
2390 #' users_current is a method defined in Arvados class.
2391 users_current = function()
2393 endPoint <- stringr::str_interp("users/current")
2394 url <- paste0(private$host, endPoint)
2395 headers <- list(Authorization = paste("Bearer", private$token),
2396 "Content-Type" = "application/json")
2401 response <- private$REST$http$exec("GET", url, headers, body,
2402 queryArgs, private$numRetries)
2403 resource <- private$REST$httpParser$parseJSONResponse(response)
2405 if(!is.null(resource$errors))
2406 stop(resource$errors)
2412 #' users_system is a method defined in Arvados class.
2413 users_system = function()
2415 endPoint <- stringr::str_interp("users/system")
2416 url <- paste0(private$host, endPoint)
2417 headers <- list(Authorization = paste("Bearer", private$token),
2418 "Content-Type" = "application/json")
2423 response <- private$REST$http$exec("GET", url, headers, body,
2424 queryArgs, private$numRetries)
2425 resource <- private$REST$httpParser$parseJSONResponse(response)
2427 if(!is.null(resource$errors))
2428 stop(resource$errors)
2434 #' users_activate is a method defined in Arvados class.
2435 #' @param uuid The UUID of the User in question.
2436 users_activate = function(uuid)
2438 endPoint <- stringr::str_interp("users/${uuid}/activate")
2439 url <- paste0(private$host, endPoint)
2440 headers <- list(Authorization = paste("Bearer", private$token),
2441 "Content-Type" = "application/json")
2446 response <- private$REST$http$exec("POST", url, headers, body,
2447 queryArgs, private$numRetries)
2448 resource <- private$REST$httpParser$parseJSONResponse(response)
2450 if(!is.null(resource$errors))
2451 stop(resource$errors)
2457 #' users_setup is a method defined in Arvados class.
2462 #' @param send_notification_email
2463 users_setup = function(uuid = NULL, user = NULL,
2464 repo_name = NULL, vm_uuid = NULL, send_notification_email = "false")
2466 endPoint <- stringr::str_interp("users/setup")
2467 url <- paste0(private$host, endPoint)
2468 headers <- list(Authorization = paste("Bearer", private$token),
2469 "Content-Type" = "application/json")
2470 queryArgs <- list(uuid = uuid, user = user,
2471 repo_name = repo_name, vm_uuid = vm_uuid,
2472 send_notification_email = send_notification_email)
2476 response <- private$REST$http$exec("POST", url, headers, body,
2477 queryArgs, private$numRetries)
2478 resource <- private$REST$httpParser$parseJSONResponse(response)
2480 if(!is.null(resource$errors))
2481 stop(resource$errors)
2487 #' users_unsetup is a method defined in Arvados class.
2488 #' @param uuid The UUID of the User in question.
2489 users_unsetup = function(uuid)
2491 endPoint <- stringr::str_interp("users/${uuid}/unsetup")
2492 url <- paste0(private$host, endPoint)
2493 headers <- list(Authorization = paste("Bearer", private$token),
2494 "Content-Type" = "application/json")
2499 response <- private$REST$http$exec("POST", url, headers, body,
2500 queryArgs, private$numRetries)
2501 resource <- private$REST$httpParser$parseJSONResponse(response)
2503 if(!is.null(resource$errors))
2504 stop(resource$errors)
2510 #' users_merge is a method defined in Arvados class.
2511 #' @param newOwnerUUID
2512 #' @param newUserToken
2513 #' @param redirectToNewUser
2514 #' @param oldUserUUID
2515 #' @param newUserUUID
2516 users_merge = function(newOwnerUUID, newUserToken = NULL,
2517 redirectToNewUser = NULL, oldUserUUID = NULL,
2520 endPoint <- stringr::str_interp("users/merge")
2521 url <- paste0(private$host, endPoint)
2522 headers <- list(Authorization = paste("Bearer", private$token),
2523 "Content-Type" = "application/json")
2524 queryArgs <- list(newOwnerUUID = newOwnerUUID,
2525 newUserToken = newUserToken, redirectToNewUser = redirectToNewUser,
2526 oldUserUUID = oldUserUUID, newUserUUID = newUserUUID)
2530 response <- private$REST$http$exec("POST", url, headers, body,
2531 queryArgs, private$numRetries)
2532 resource <- private$REST$httpParser$parseJSONResponse(response)
2534 if(!is.null(resource$errors))
2535 stop(resource$errors)
2541 #' users_list is a method defined in Arvados class.
2550 #' @param clusterID List objects on a remote federated cluster instead of the current one.
2551 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
2552 users_list = function(filters = NULL, where = NULL,
2553 order = NULL, select = NULL, distinct = NULL,
2554 limit = "100", offset = "0", count = "exact",
2555 clusterID = NULL, bypassFederation = NULL)
2557 endPoint <- stringr::str_interp("users")
2558 url <- paste0(private$host, endPoint)
2559 headers <- list(Authorization = paste("Bearer", private$token),
2560 "Content-Type" = "application/json")
2561 queryArgs <- list(filters = filters, where = where,
2562 order = order, select = select, distinct = distinct,
2563 limit = limit, offset = offset, count = count,
2564 clusterID = clusterID, bypassFederation = bypassFederation)
2568 response <- private$REST$http$exec("GET", url, headers, body,
2569 queryArgs, private$numRetries)
2570 resource <- private$REST$httpParser$parseJSONResponse(response)
2572 if(!is.null(resource$errors))
2573 stop(resource$errors)
2579 #' repositories_get is a method defined in Arvados class.
2580 #' @param uuid The UUID of the Repository in question.
2581 repositories_get = function(uuid)
2583 endPoint <- stringr::str_interp("repositories/${uuid}")
2584 url <- paste0(private$host, endPoint)
2585 headers <- list(Authorization = paste("Bearer", private$token),
2586 "Content-Type" = "application/json")
2591 response <- private$REST$http$exec("GET", url, headers, body,
2592 queryArgs, private$numRetries)
2593 resource <- private$REST$httpParser$parseJSONResponse(response)
2595 if(!is.null(resource$errors))
2596 stop(resource$errors)
2602 #' repositories_create is a method defined in Arvados class.
2603 #' @param repository Repository object.
2604 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2605 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2606 repositories_create = function(repository,
2607 ensureUniqueName = "false", clusterID = NULL)
2609 endPoint <- stringr::str_interp("repositories")
2610 url <- paste0(private$host, endPoint)
2611 headers <- list(Authorization = paste("Bearer", private$token),
2612 "Content-Type" = "application/json")
2613 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2614 clusterID = clusterID)
2616 if(length(repository) > 0)
2617 body <- jsonlite::toJSON(list(repository = repository),
2622 response <- private$REST$http$exec("POST", url, headers, body,
2623 queryArgs, private$numRetries)
2624 resource <- private$REST$httpParser$parseJSONResponse(response)
2626 if(!is.null(resource$errors))
2627 stop(resource$errors)
2633 #' repositories_update is a method defined in Arvados class.
2634 #' @param repository Repository object.
2635 #' @param uuid The UUID of the Repository in question.
2636 repositories_update = function(repository, uuid)
2638 endPoint <- stringr::str_interp("repositories/${uuid}")
2639 url <- paste0(private$host, endPoint)
2640 headers <- list(Authorization = paste("Bearer", private$token),
2641 "Content-Type" = "application/json")
2644 if(length(repository) > 0)
2645 body <- jsonlite::toJSON(list(repository = repository),
2650 response <- private$REST$http$exec("PUT", url, headers, body,
2651 queryArgs, private$numRetries)
2652 resource <- private$REST$httpParser$parseJSONResponse(response)
2654 if(!is.null(resource$errors))
2655 stop(resource$errors)
2661 #' repositories_delete is a method defined in Arvados class.
2662 #' @param uuid The UUID of the Repository in question.
2663 repositories_delete = function(uuid)
2665 endPoint <- stringr::str_interp("repositories/${uuid}")
2666 url <- paste0(private$host, endPoint)
2667 headers <- list(Authorization = paste("Bearer", private$token),
2668 "Content-Type" = "application/json")
2673 response <- private$REST$http$exec("DELETE", url, headers, body,
2674 queryArgs, private$numRetries)
2675 resource <- private$REST$httpParser$parseJSONResponse(response)
2677 if(!is.null(resource$errors))
2678 stop(resource$errors)
2684 #' repositories_get_all_permissions is a method defined in Arvados class.
2685 repositories_get_all_permissions = function()
2687 endPoint <- stringr::str_interp("repositories/get_all_permissions")
2688 url <- paste0(private$host, endPoint)
2689 headers <- list(Authorization = paste("Bearer", private$token),
2690 "Content-Type" = "application/json")
2695 response <- private$REST$http$exec("GET", url, headers, body,
2696 queryArgs, private$numRetries)
2697 resource <- private$REST$httpParser$parseJSONResponse(response)
2699 if(!is.null(resource$errors))
2700 stop(resource$errors)
2706 #' repositories_list is a method defined in Arvados class.
2715 #' @param clusterID List objects on a remote federated cluster instead of the current one.
2716 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
2717 repositories_list = function(filters = NULL,
2718 where = NULL, order = NULL, select = NULL,
2719 distinct = NULL, limit = "100", offset = "0",
2720 count = "exact", clusterID = NULL, bypassFederation = NULL)
2722 endPoint <- stringr::str_interp("repositories")
2723 url <- paste0(private$host, endPoint)
2724 headers <- list(Authorization = paste("Bearer", private$token),
2725 "Content-Type" = "application/json")
2726 queryArgs <- list(filters = filters, where = where,
2727 order = order, select = select, distinct = distinct,
2728 limit = limit, offset = offset, count = count,
2729 clusterID = clusterID, bypassFederation = bypassFederation)
2733 response <- private$REST$http$exec("GET", url, headers, body,
2734 queryArgs, private$numRetries)
2735 resource <- private$REST$httpParser$parseJSONResponse(response)
2737 if(!is.null(resource$errors))
2738 stop(resource$errors)
2744 #' virtual_machines_get is a method defined in Arvados class.
2745 #' @param uuid The UUID of the virtualMachine in question.
2746 virtual_machines_get = function(uuid)
2748 endPoint <- stringr::str_interp("virtual_machines/${uuid}")
2749 url <- paste0(private$host, endPoint)
2750 headers <- list(Authorization = paste("Bearer", private$token),
2751 "Content-Type" = "application/json")
2756 response <- private$REST$http$exec("GET", url, headers, body,
2757 queryArgs, private$numRetries)
2758 resource <- private$REST$httpParser$parseJSONResponse(response)
2760 if(!is.null(resource$errors))
2761 stop(resource$errors)
2767 #' virtual_machines_create is a method defined in Arvados class.
2768 #' @param virtualMachine virtualMachine object.
2769 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2770 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2771 virtual_machines_create = function(virtualMachine,
2772 ensureUniqueName = "false", clusterID = NULL)
2774 endPoint <- stringr::str_interp("virtual_machines")
2775 url <- paste0(private$host, endPoint)
2776 headers <- list(Authorization = paste("Bearer", private$token),
2777 "Content-Type" = "application/json")
2778 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2779 clusterID = clusterID)
2781 if(length(virtualMachine) > 0)
2782 body <- jsonlite::toJSON(list(virtualMachine = virtualMachine),
2787 response <- private$REST$http$exec("POST", url, headers, body,
2788 queryArgs, private$numRetries)
2789 resource <- private$REST$httpParser$parseJSONResponse(response)
2791 if(!is.null(resource$errors))
2792 stop(resource$errors)
2798 #' virtual_machines_update is a method defined in Arvados class.
2799 #' @param virtualMachine virtualMachine object.
2800 #' @param uuid The UUID of the virtualMachine in question.
2801 virtual_machines_update = function(virtualMachine, uuid)
2803 endPoint <- stringr::str_interp("virtual_machines/${uuid}")
2804 url <- paste0(private$host, endPoint)
2805 headers <- list(Authorization = paste("Bearer", private$token),
2806 "Content-Type" = "application/json")
2809 if(length(virtualMachine) > 0)
2810 body <- jsonlite::toJSON(list(virtualMachine = virtualMachine),
2815 response <- private$REST$http$exec("PUT", url, headers, body,
2816 queryArgs, private$numRetries)
2817 resource <- private$REST$httpParser$parseJSONResponse(response)
2819 if(!is.null(resource$errors))
2820 stop(resource$errors)
2826 #' virtual_machines_delete is a method defined in Arvados class.
2827 #' @param uuid The UUID of the virtualMachine in question.
2828 virtual_machines_delete = function(uuid)
2830 endPoint <- stringr::str_interp("virtual_machines/${uuid}")
2831 url <- paste0(private$host, endPoint)
2832 headers <- list(Authorization = paste("Bearer", private$token),
2833 "Content-Type" = "application/json")
2838 response <- private$REST$http$exec("DELETE", url, headers, body,
2839 queryArgs, private$numRetries)
2840 resource <- private$REST$httpParser$parseJSONResponse(response)
2842 if(!is.null(resource$errors))
2843 stop(resource$errors)
2849 #' virtual_machines_logins is a method defined in Arvados class.
2850 #' @param uuid The UUID of the virtualMachine in question.
2851 virtual_machines_logins = function(uuid)
2853 endPoint <- stringr::str_interp("virtual_machines/${uuid}/logins")
2854 url <- paste0(private$host, endPoint)
2855 headers <- list(Authorization = paste("Bearer", private$token),
2856 "Content-Type" = "application/json")
2861 response <- private$REST$http$exec("GET", url, headers, body,
2862 queryArgs, private$numRetries)
2863 resource <- private$REST$httpParser$parseJSONResponse(response)
2865 if(!is.null(resource$errors))
2866 stop(resource$errors)
2872 #' virtual_machines_get_all_logins is a method defined in Arvados class.
2873 virtual_machines_get_all_logins = function()
2875 endPoint <- stringr::str_interp("virtual_machines/get_all_logins")
2876 url <- paste0(private$host, endPoint)
2877 headers <- list(Authorization = paste("Bearer", private$token),
2878 "Content-Type" = "application/json")
2883 response <- private$REST$http$exec("GET", url, headers, body,
2884 queryArgs, private$numRetries)
2885 resource <- private$REST$httpParser$parseJSONResponse(response)
2887 if(!is.null(resource$errors))
2888 stop(resource$errors)
2894 #' virtual_machines_list is a method defined in Arvados class.
2903 #' @param clusterID List objects on a remote federated cluster instead of the current one.
2904 #' @param bypassFederation bypass federation behavior, list items from local instance database only
2905 virtual_machines_list = function(filters = NULL,
2906 where = NULL, order = NULL, select = NULL,
2907 distinct = NULL, limit = "100", offset = "0",
2908 count = "exact", clusterID = NULL, bypassFederation = NULL)
2910 endPoint <- stringr::str_interp("virtual_machines")
2911 url <- paste0(private$host, endPoint)
2912 headers <- list(Authorization = paste("Bearer", private$token),
2913 "Content-Type" = "application/json")
2914 queryArgs <- list(filters = filters, where = where,
2915 order = order, select = select, distinct = distinct,
2916 limit = limit, offset = offset, count = count,
2917 clusterID = clusterID, bypassFederation = bypassFederation)
2921 response <- private$REST$http$exec("GET", url, headers, body,
2922 queryArgs, private$numRetries)
2923 resource <- private$REST$httpParser$parseJSONResponse(response)
2925 if(!is.null(resource$errors))
2926 stop(resource$errors)
2932 #' workflows_get is a method defined in Arvados class.
2933 #' @param uuid The UUID of the Workflow in question.
2934 workflows_get = function(uuid)
2936 endPoint <- stringr::str_interp("workflows/${uuid}")
2937 url <- paste0(private$host, endPoint)
2938 headers <- list(Authorization = paste("Bearer", private$token),
2939 "Content-Type" = "application/json")
2944 response <- private$REST$http$exec("GET", url, headers, body,
2945 queryArgs, private$numRetries)
2946 resource <- private$REST$httpParser$parseJSONResponse(response)
2948 if(!is.null(resource$errors))
2949 stop(resource$errors)
2955 #' workflows_create is a method defined in Arvados class.
2956 #' @param workflow Workflow object.
2957 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
2958 #' @param clusterID Create object on a remote federated cluster instead of the current one.
2959 workflows_create = function(workflow, ensureUniqueName = "false",
2962 endPoint <- stringr::str_interp("workflows")
2963 url <- paste0(private$host, endPoint)
2964 headers <- list(Authorization = paste("Bearer", private$token),
2965 "Content-Type" = "application/json")
2966 queryArgs <- list(ensureUniqueName = ensureUniqueName,
2967 clusterID = clusterID)
2969 if(length(workflow) > 0)
2970 body <- jsonlite::toJSON(list(workflow = workflow),
2975 response <- private$REST$http$exec("POST", url, headers, body,
2976 queryArgs, private$numRetries)
2977 resource <- private$REST$httpParser$parseJSONResponse(response)
2979 if(!is.null(resource$errors))
2980 stop(resource$errors)
2986 #' workflows_update is a method defined in Arvados class.
2987 #' @param workflow Workflow object.
2988 #' @param uuid The UUID of the Workflow in question.
2989 workflows_update = function(workflow, uuid)
2991 endPoint <- stringr::str_interp("workflows/${uuid}")
2992 url <- paste0(private$host, endPoint)
2993 headers <- list(Authorization = paste("Bearer", private$token),
2994 "Content-Type" = "application/json")
2997 if(length(workflow) > 0)
2998 body <- jsonlite::toJSON(list(workflow = workflow),
3003 response <- private$REST$http$exec("PUT", url, headers, body,
3004 queryArgs, private$numRetries)
3005 resource <- private$REST$httpParser$parseJSONResponse(response)
3007 if(!is.null(resource$errors))
3008 stop(resource$errors)
3014 #' workflows_delete is a method defined in Arvados class.
3015 #' @param uuid The UUID of the Workflow in question.
3016 workflows_delete = function(uuid)
3018 endPoint <- stringr::str_interp("workflows/${uuid}")
3019 url <- paste0(private$host, endPoint)
3020 headers <- list(Authorization = paste("Bearer", private$token),
3021 "Content-Type" = "application/json")
3026 response <- private$REST$http$exec("DELETE", url, headers, body,
3027 queryArgs, private$numRetries)
3028 resource <- private$REST$httpParser$parseJSONResponse(response)
3030 if(!is.null(resource$errors))
3031 stop(resource$errors)
3037 #' workflows_list is a method defined in Arvados class.
3046 #' @param clusterID List objects on a remote federated cluster instead of the current one.
3047 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
3048 workflows_list = function(filters = NULL,
3049 where = NULL, order = NULL, select = NULL,
3050 distinct = NULL, limit = "100", offset = "0",
3051 count = "exact", clusterID = NULL, bypassFederation = NULL)
3053 endPoint <- stringr::str_interp("workflows")
3054 url <- paste0(private$host, endPoint)
3055 headers <- list(Authorization = paste("Bearer", private$token),
3056 "Content-Type" = "application/json")
3057 queryArgs <- list(filters = filters, where = where,
3058 order = order, select = select, distinct = distinct,
3059 limit = limit, offset = offset, count = count,
3060 clusterID = clusterID, bypassFederation = bypassFederation)
3064 response <- private$REST$http$exec("GET", url, headers, body,
3065 queryArgs, private$numRetries)
3066 resource <- private$REST$httpParser$parseJSONResponse(response)
3068 if(!is.null(resource$errors))
3069 stop(resource$errors)
3075 #' user_agreements_get is a method defined in Arvados class.
3076 #' @param uuid The UUID of the userAgreement in question.
3077 user_agreements_get = function(uuid)
3079 endPoint <- stringr::str_interp("user_agreements/${uuid}")
3080 url <- paste0(private$host, endPoint)
3081 headers <- list(Authorization = paste("Bearer", private$token),
3082 "Content-Type" = "application/json")
3087 response <- private$REST$http$exec("GET", url, headers, body,
3088 queryArgs, private$numRetries)
3089 resource <- private$REST$httpParser$parseJSONResponse(response)
3091 if(!is.null(resource$errors))
3092 stop(resource$errors)
3098 #' user_agreements_create is a method defined in Arvados class.
3099 #' @param userAgreement userAgreement object.
3100 #' @param ensureUniqueName Adjust name to ensure uniqueness instead of returning an error.
3101 #' @param clusterID Create object on a remote federated cluster instead of the current one.
3102 user_agreements_create = function(userAgreement,
3103 ensureUniqueName = "false", clusterID = NULL)
3105 endPoint <- stringr::str_interp("user_agreements")
3106 url <- paste0(private$host, endPoint)
3107 headers <- list(Authorization = paste("Bearer", private$token),
3108 "Content-Type" = "application/json")
3109 queryArgs <- list(ensureUniqueName = ensureUniqueName,
3110 clusterID = clusterID)
3112 if(length(userAgreement) > 0)
3113 body <- jsonlite::toJSON(list(userAgreement = userAgreement),
3118 response <- private$REST$http$exec("POST", url, headers, body,
3119 queryArgs, private$numRetries)
3120 resource <- private$REST$httpParser$parseJSONResponse(response)
3122 if(!is.null(resource$errors))
3123 stop(resource$errors)
3129 #' user_agreements_update is a method defined in Arvados class.
3130 #' @param userAgreement userAgreement object.
3131 #' @param uuid The UUID of the userAgreement in question.
3132 user_agreements_update = function(userAgreement, uuid)
3134 endPoint <- stringr::str_interp("user_agreements/${uuid}")
3135 url <- paste0(private$host, endPoint)
3136 headers <- list(Authorization = paste("Bearer", private$token),
3137 "Content-Type" = "application/json")
3140 if(length(userAgreement) > 0)
3141 body <- jsonlite::toJSON(list(userAgreement = userAgreement),
3146 response <- private$REST$http$exec("PUT", url, headers, body,
3147 queryArgs, private$numRetries)
3148 resource <- private$REST$httpParser$parseJSONResponse(response)
3150 if(!is.null(resource$errors))
3151 stop(resource$errors)
3157 #' user_agreements_delete is a method defined in Arvados class.
3158 #' @param uuid The UUID of the userAgreement in question.
3159 user_agreements_delete = function(uuid)
3161 endPoint <- stringr::str_interp("user_agreements/${uuid}")
3162 url <- paste0(private$host, endPoint)
3163 headers <- list(Authorization = paste("Bearer", private$token),
3164 "Content-Type" = "application/json")
3169 response <- private$REST$http$exec("DELETE", url, headers, body,
3170 queryArgs, private$numRetries)
3171 resource <- private$REST$httpParser$parseJSONResponse(response)
3173 if(!is.null(resource$errors))
3174 stop(resource$errors)
3180 #' user_agreements_signatures is a method defined in Arvados class.
3181 user_agreements_signatures = function()
3183 endPoint <- stringr::str_interp("user_agreements/signatures")
3184 url <- paste0(private$host, endPoint)
3185 headers <- list(Authorization = paste("Bearer", private$token),
3186 "Content-Type" = "application/json")
3191 response <- private$REST$http$exec("GET", url, headers, body,
3192 queryArgs, private$numRetries)
3193 resource <- private$REST$httpParser$parseJSONResponse(response)
3195 if(!is.null(resource$errors))
3196 stop(resource$errors)
3202 #' user_agreements_sign is a method defined in Arvados class.
3203 user_agreements_sign = function()
3205 endPoint <- stringr::str_interp("user_agreements/sign")
3206 url <- paste0(private$host, endPoint)
3207 headers <- list(Authorization = paste("Bearer", private$token),
3208 "Content-Type" = "application/json")
3213 response <- private$REST$http$exec("POST", url, headers, body,
3214 queryArgs, private$numRetries)
3215 resource <- private$REST$httpParser$parseJSONResponse(response)
3217 if(!is.null(resource$errors))
3218 stop(resource$errors)
3224 #' user_agreements_list is a method defined in Arvados class.
3233 #' @param clusterID List objects on a remote federated cluster instead of the current one.
3234 #' @param bypassFederation Bypass federation behavior, list items from local instance database only.
3235 user_agreements_list = function(filters = NULL,
3236 where = NULL, order = NULL, select = NULL,
3237 distinct = NULL, limit = "100", offset = "0",
3238 count = "exact", clusterID = NULL, bypassFederation = NULL)
3240 endPoint <- stringr::str_interp("user_agreements")
3241 url <- paste0(private$host, endPoint)
3242 headers <- list(Authorization = paste("Bearer", private$token),
3243 "Content-Type" = "application/json")
3244 queryArgs <- list(filters = filters, where = where,
3245 order = order, select = select, distinct = distinct,
3246 limit = limit, offset = offset, count = count,
3247 clusterID = clusterID, bypassFederation = bypassFederation)
3251 response <- private$REST$http$exec("GET", url, headers, body,
3252 queryArgs, private$numRetries)
3253 resource <- private$REST$httpParser$parseJSONResponse(response)
3255 if(!is.null(resource$errors))
3256 stop(resource$errors)
3262 #' user_agreements_new is a method defined in Arvados class.
3263 user_agreements_new = function()
3265 endPoint <- stringr::str_interp("user_agreements/new")
3266 url <- paste0(private$host, endPoint)
3267 headers <- list(Authorization = paste("Bearer", private$token),
3268 "Content-Type" = "application/json")
3273 response <- private$REST$http$exec("GET", url, headers, body,
3274 queryArgs, private$numRetries)
3275 resource <- private$REST$httpParser$parseJSONResponse(response)
3277 if(!is.null(resource$errors))
3278 stop(resource$errors)
3284 #' configs_get is a method defined in Arvados class.
3285 configs_get = function()
3287 endPoint <- stringr::str_interp("config")
3288 url <- paste0(private$host, endPoint)
3289 headers <- list(Authorization = paste("Bearer", private$token),
3290 "Content-Type" = "application/json")
3295 response <- private$REST$http$exec("GET", url, headers, body,
3296 queryArgs, private$numRetries)
3297 resource <- private$REST$httpParser$parseJSONResponse(response)
3299 if(!is.null(resource$errors))
3300 stop(resource$errors)
3305 getHostName = function() private$host,
3306 getToken = function() private$token,
3307 setRESTService = function(newREST) private$REST <- newREST,
3308 getRESTService = function() private$REST