Added listAll utility function which will always fetch all resources.
authorFuad Muhic <fmuhic@capeannenterprises.com>
Tue, 13 Mar 2018 14:28:47 +0000 (15:28 +0100)
committerFuad Muhic <fmuhic@capeannenterprises.com>
Tue, 13 Mar 2018 14:28:47 +0000 (15:28 +0100)
Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic@capeannenterprises.com>

30 files changed:
sdk/R/NAMESPACE
sdk/R/R/Arvados.R
sdk/R/R/RESTService.R
sdk/R/R/autoGenAPI.R
sdk/R/R/util.R
sdk/R/man/api_client_authorizations.create.Rd
sdk/R/man/api_client_authorizations.update.Rd
sdk/R/man/api_clients.create.Rd
sdk/R/man/api_clients.update.Rd
sdk/R/man/authorized_keys.create.Rd
sdk/R/man/authorized_keys.update.Rd
sdk/R/man/container_requests.create.Rd
sdk/R/man/container_requests.update.Rd
sdk/R/man/job_tasks.create.Rd
sdk/R/man/job_tasks.update.Rd
sdk/R/man/keep_disks.create.Rd
sdk/R/man/keep_disks.update.Rd
sdk/R/man/keep_services.create.Rd
sdk/R/man/keep_services.update.Rd
sdk/R/man/listAll.Rd [new file with mode: 0644]
sdk/R/man/pipeline_instances.create.Rd
sdk/R/man/pipeline_instances.update.Rd
sdk/R/man/pipeline_templates.create.Rd
sdk/R/man/pipeline_templates.update.Rd
sdk/R/man/user_agreements.create.Rd
sdk/R/man/user_agreements.update.Rd
sdk/R/man/virtual_machines.create.Rd
sdk/R/man/virtual_machines.update.Rd
sdk/R/tests/testthat/test-RESTService.R
sdk/R/tests/testthat/test-util.R

index de906aa28a0e7ed7d0a59f2eab0dae2e5eb01497..1cc676875a49f4b6c0783ea8223927d06a4e232a 100644 (file)
@@ -8,3 +8,4 @@ export(ArvadosFile)
 export(Collection)
 export(Subcollection)
 export(generateAPI)
+export(listAll)
index b2b40efabd734833a65bd3d7537791a7ec6eb8b6..c629a70ca0cb2cef31c790c32f88fc8486045c33 100644 (file)
@@ -2464,8 +2464,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -2489,7 +2489,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(user) > 0)
                                body <- jsonlite::toJSON(list(user = user), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -2513,7 +2513,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(user) > 0)
                                body <- jsonlite::toJSON(list(user = user), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -2615,8 +2615,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(user = user, openid_prefix = openid_prefix,
-                               repo_name = repo_name, vm_uuid = vm_uuid,
-                               send_notification_email = send_notification_email)
+                                                         repo_name = repo_name, vm_uuid = vm_uuid,
+                                                         send_notification_email = send_notification_email)
                        
                        body <- NULL
                        
@@ -2679,8 +2679,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -2764,8 +2764,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -2790,7 +2790,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(apiclientauthorization) > 0)
                                body <- jsonlite::toJSON(list(apiclientauthorization = apiclientauthorization), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -2814,7 +2814,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(apiclientauthorization) > 0)
                                body <- jsonlite::toJSON(list(apiclientauthorization = apiclientauthorization), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -2855,7 +2855,7 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(api_client_id = api_client_id,
-                               scopes = scopes)
+                                                         scopes = scopes)
                        
                        body <- NULL
                        
@@ -2899,8 +2899,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -2984,8 +2984,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -3009,7 +3009,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(apiclient) > 0)
                                body <- jsonlite::toJSON(list(apiclient = apiclient), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -3033,7 +3033,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(apiclient) > 0)
                                body <- jsonlite::toJSON(list(apiclient = apiclient), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -3077,8 +3077,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -3162,8 +3162,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -3188,7 +3188,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(containerrequest) > 0)
                                body <- jsonlite::toJSON(list(containerrequest = containerrequest), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -3212,7 +3212,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(containerrequest) > 0)
                                body <- jsonlite::toJSON(list(containerrequest = containerrequest), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -3256,8 +3256,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -3341,8 +3341,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -3367,7 +3367,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(authorizedkey) > 0)
                                body <- jsonlite::toJSON(list(authorizedkey = authorizedkey), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -3391,7 +3391,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(authorizedkey) > 0)
                                body <- jsonlite::toJSON(list(authorizedkey = authorizedkey), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -3435,8 +3435,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -3520,9 +3520,9 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count,
-                               include_trash = include_trash)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count,
+                                                         include_trash = include_trash)
                        
                        body <- NULL
                        
@@ -3546,7 +3546,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(collection) > 0)
                                body <- jsonlite::toJSON(list(collection = collection), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -3570,7 +3570,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(collection) > 0)
                                body <- jsonlite::toJSON(list(collection = collection), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -3694,9 +3694,9 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count,
-                               include_trash = include_trash)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count,
+                                                         include_trash = include_trash)
                        
                        body <- NULL
                        
@@ -3780,8 +3780,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -3805,7 +3805,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(container) > 0)
                                body <- jsonlite::toJSON(list(container = container), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -3829,7 +3829,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(container) > 0)
                                body <- jsonlite::toJSON(list(container = container), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -3953,8 +3953,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4037,8 +4037,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4062,7 +4062,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(human) > 0)
                                body <- jsonlite::toJSON(list(human = human), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -4086,7 +4086,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(human) > 0)
                                body <- jsonlite::toJSON(list(human = human), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -4129,8 +4129,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4214,8 +4214,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4239,7 +4239,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(jobtask) > 0)
                                body <- jsonlite::toJSON(list(jobtask = jobtask), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -4263,7 +4263,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(jobtask) > 0)
                                body <- jsonlite::toJSON(list(jobtask = jobtask), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -4307,8 +4307,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4391,8 +4391,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4416,7 +4416,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(link) > 0)
                                body <- jsonlite::toJSON(list(link = link), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -4440,7 +4440,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(link) > 0)
                                body <- jsonlite::toJSON(list(link = link), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -4483,8 +4483,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4587,8 +4587,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4611,13 +4611,13 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(ensure_unique_name = ensure_unique_name,
-                               find_or_create = find_or_create, filters = filters,
-                               minimum_script_version = minimum_script_version,
-                               exclude_script_versions = exclude_script_versions)
+                                                         find_or_create = find_or_create, filters = filters,
+                                                         minimum_script_version = minimum_script_version,
+                                                         exclude_script_versions = exclude_script_versions)
                        
                        if(length(job) > 0)
                                body <- jsonlite::toJSON(list(job = job), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -4641,7 +4641,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(job) > 0)
                                body <- jsonlite::toJSON(list(job = job), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -4684,8 +4684,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4768,8 +4768,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4853,8 +4853,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -4878,7 +4878,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(keepdisk) > 0)
                                body <- jsonlite::toJSON(list(keepdisk = keepdisk), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -4902,7 +4902,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(keepdisk) > 0)
                                body <- jsonlite::toJSON(list(keepdisk = keepdisk), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -4945,9 +4945,9 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(uuid = uuid, ping_secret = ping_secret,
-                               node_uuid = node_uuid, filesystem_uuid = filesystem_uuid,
-                               service_host = service_host, service_port = service_port,
-                               service_ssl_flag = service_ssl_flag)
+                                                         node_uuid = node_uuid, filesystem_uuid = filesystem_uuid,
+                                                         service_host = service_host, service_port = service_port,
+                                                         service_ssl_flag = service_ssl_flag)
                        
                        body <- NULL
                        
@@ -4971,8 +4971,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -5056,8 +5056,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -5082,7 +5082,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(keepservice) > 0)
                                body <- jsonlite::toJSON(list(keepservice = keepservice), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -5106,7 +5106,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(keepservice) > 0)
                                body <- jsonlite::toJSON(list(keepservice = keepservice), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -5170,8 +5170,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -5255,8 +5255,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -5281,7 +5281,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(pipelinetemplate) > 0)
                                body <- jsonlite::toJSON(list(pipelinetemplate = pipelinetemplate), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -5305,7 +5305,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(pipelinetemplate) > 0)
                                body <- jsonlite::toJSON(list(pipelinetemplate = pipelinetemplate), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -5349,8 +5349,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -5434,8 +5434,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -5460,7 +5460,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(pipelineinstance) > 0)
                                body <- jsonlite::toJSON(list(pipelineinstance = pipelineinstance), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -5484,7 +5484,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(pipelineinstance) > 0)
                                body <- jsonlite::toJSON(list(pipelineinstance = pipelineinstance), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -5548,8 +5548,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -5632,8 +5632,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -5655,11 +5655,11 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(ensure_unique_name = ensure_unique_name,
-                               assign_slot = assign_slot)
+                                                         assign_slot = assign_slot)
                        
                        if(length(node) > 0)
                                body <- jsonlite::toJSON(list(node = node), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -5683,7 +5683,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(node) > 0)
                                body <- jsonlite::toJSON(list(node = node), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -5746,8 +5746,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -5831,8 +5831,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -5856,7 +5856,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(repository) > 0)
                                body <- jsonlite::toJSON(list(repository = repository), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -5880,7 +5880,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(repository) > 0)
                                body <- jsonlite::toJSON(list(repository = repository), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -5944,8 +5944,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6029,8 +6029,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6054,7 +6054,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(specimen) > 0)
                                body <- jsonlite::toJSON(list(specimen = specimen), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -6078,7 +6078,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(specimen) > 0)
                                body <- jsonlite::toJSON(list(specimen = specimen), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -6122,8 +6122,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6206,8 +6206,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6231,7 +6231,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(log) > 0)
                                body <- jsonlite::toJSON(list(log = log), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -6255,7 +6255,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(log) > 0)
                                body <- jsonlite::toJSON(list(log = log), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -6298,8 +6298,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6382,8 +6382,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6407,7 +6407,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(trait) > 0)
                                body <- jsonlite::toJSON(list(trait = trait), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -6431,7 +6431,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(trait) > 0)
                                body <- jsonlite::toJSON(list(trait = trait), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -6474,8 +6474,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6559,8 +6559,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6585,7 +6585,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(virtualmachine) > 0)
                                body <- jsonlite::toJSON(list(virtualmachine = virtualmachine), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -6609,7 +6609,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(virtualmachine) > 0)
                                body <- jsonlite::toJSON(list(virtualmachine = virtualmachine), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -6693,8 +6693,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6778,8 +6778,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6803,7 +6803,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(workflow) > 0)
                                body <- jsonlite::toJSON(list(workflow = workflow), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -6827,7 +6827,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(workflow) > 0)
                                body <- jsonlite::toJSON(list(workflow = workflow), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -6871,8 +6871,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -6956,9 +6956,9 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count,
-                               include_trash = include_trash)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count,
+                                                         include_trash = include_trash)
                        
                        body <- NULL
                        
@@ -6982,7 +6982,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(group) > 0)
                                body <- jsonlite::toJSON(list(group = group), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -7006,7 +7006,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(group) > 0)
                                body <- jsonlite::toJSON(list(group = group), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -7050,9 +7050,9 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, distinct = distinct, limit = limit,
-                               offset = offset, count = count, include_trash = include_trash,
-                               uuid = uuid, recursive = recursive)
+                                                         order = order, distinct = distinct, limit = limit,
+                                                         offset = offset, count = count, include_trash = include_trash,
+                                                         uuid = uuid, recursive = recursive)
                        
                        body <- NULL
                        
@@ -7116,9 +7116,9 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count,
-                               include_trash = include_trash)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count,
+                                                         include_trash = include_trash)
                        
                        body <- NULL
                        
@@ -7202,8 +7202,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
@@ -7228,7 +7228,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(useragreement) > 0)
                                body <- jsonlite::toJSON(list(useragreement = useragreement), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -7252,7 +7252,7 @@ Arvados <- R6::R6Class(
                        
                        if(length(useragreement) > 0)
                                body <- jsonlite::toJSON(list(useragreement = useragreement), 
-                                                  auto_unbox = TRUE)
+                                                        auto_unbox = TRUE)
                        else
                                body <- NULL
                        
@@ -7336,8 +7336,8 @@ Arvados <- R6::R6Class(
                        headers <- list(Authorization = paste("OAuth2", private$token), 
                                        "Content-Type" = "application/json")
                        queryArgs <- list(filters = filters, where = where,
-                               order = order, select = select, distinct = distinct,
-                               limit = limit, offset = offset, count = count)
+                                                         order = order, select = select, distinct = distinct,
+                                                         limit = limit, offset = offset, count = count)
                        
                        body <- NULL
                        
index b87310e9166ed461b13f4a2b467d0526ad0a166f..dacf88a8c4bff2336e232fba4a86567a2cc5d7af 100644 (file)
@@ -50,38 +50,6 @@ RESTService <- R6::R6Class(
             private$webDavHostName
         },
 
-        #Move this to utility 
-        fetchAllItems = function(resourceURL, filters)
-        {
-            headers <- list(Authorization = paste("OAuth2", self$token))
-
-            offset <- 0
-            itemsAvailable <- .Machine$integer.max
-            items <- c()
-            while(length(items) < itemsAvailable)
-            {
-                serverResponse <- self$http$execute(verb       = "GET",
-                                                    url        = resourceURL,
-                                                    headers    = headers,
-                                                    body       = NULL,
-                                                    query      = filters,
-                                                    limit      = NULL,
-                                                    offset     = offset,
-                                                    retryTimes = self$numRetries)
-
-                parsedResponse <- self$httpParser$parseJSONResponse(serverResponse)
-
-                if(!is.null(parsedResponse$errors))
-                    stop(parsedResponse$errors)
-
-                items          <- c(items, parsedResponse$items)
-                offset         <- length(items)
-                itemsAvailable <- parsedResponse$items_available
-            }
-
-            items
-        },
-
         create = function(files, uuid)
         {
             sapply(files, function(filePath)
index a2339384e6ea363b77d9905fd043e37190f03d04..4636be0855fb20f18db0d87442abc77ab7ffc66a 100644 (file)
@@ -25,7 +25,6 @@ generateAPI <- function()
                       arvadosClassMethods,
                       arvadosAPIFooter)
 
-    #TODO: Save to a file or load in memory?
     fileConn <- file("./R/Arvados.R", "w")
     writeLines(unlist(arvadosClass), fileConn)
     close(fileConn)
@@ -224,7 +223,8 @@ getRequestQueryList <- function(methodMetaData)
     lineLengthLimit <- 40
 
     if(nchar(collapsedArgs) > lineLengthLimit)
-        return(formatArgs("queryArgs <- list(", "\t", queryArgs, ")", lineLengthLimit))
+        return(formatArgs("queryArgs <- list(", "\t\t\t\t  ", queryArgs, ")",
+                          lineLengthLimit))
     else
         return(paste0("queryArgs <- list(", collapsedArgs, ")"))
 }
@@ -242,7 +242,7 @@ getRequestBody <- function(methodMetaData)
 
     c(paste0("if(length(", resourceName, ") > 0)"),
       paste0("\tbody <- jsonlite::toJSON(list(", resourceName, " = ", resourceName, "), "),
-             "                           auto_unbox = TRUE)",
+             "\t                         auto_unbox = TRUE)",
       "else",
       "\tbody <- NULL")
 }
index d9af8b057bbb00b42611894fe2186aa6f87b0caf..57dd75f228ea410800897b60031d5734ca215f85 100644 (file)
@@ -1,3 +1,39 @@
+#' listAll
+#'
+#' List all resources even if the number of items is greater than maximum API limit.
+#'
+#' @param fn Arvados method used to retrieve items from REST service.
+#' @param ... Optional arguments which will be pased to fn .
+#' @examples
+#' \dontrun{
+#' arv <- Arvados$new("your Arvados token", "example.arvadosapi.com")
+#' cl <- listAll(arv$collections.list, filters = list(list("name", "like", "test%"))
+#' }
+#' @export 
+listAll <- function(fn, ...)
+{
+    offset <- 0
+    itemsAvailable <- .Machine$integer.max
+    items <- c()
+
+    while(length(items) < itemsAvailable)
+    {
+        serverResponse <- fn(offset = offset, ...)
+
+        if(!is.null(serverResponse$errors))
+            stop(serverResponse$errors)
+
+        items          <- c(items, serverResponse$items)
+        offset         <- length(items)
+        itemsAvailable <- serverResponse$items_available
+    }
+
+    items
+}
+
+
+#NOTE: Package private functions
+
 trimFromStart <- function(sample, trimCharacters)
 {
     if(startsWith(sample, trimCharacters))
@@ -49,6 +85,5 @@ splitToPathAndName = function(path)
     nameAndPath$name <- components[length(components)]
     nameAndPath$path <- trimFromStart(paste0(components[-length(components)], collapse = "/"),
                                       "/")
-
     nameAndPath
 }
index 257512c61c44cf966deebadd0a6b3b29b7a84903..f5d4d5fa0e6183df3dcdc239c37ea34ed50fc799 100644 (file)
@@ -4,7 +4,7 @@
 \alias{api_client_authorizations.create}
 \title{api_client_authorizations.create is a method defined in Arvados class.}
 \usage{
-arv$api_client_authorizations.create(api_client_authorization,
+arv$api_client_authorizations.create(apiclientauthorization,
        ensure_unique_name = "false")
 }
 \arguments{
index 7790d9522c948815079eca08f896b13550cacb93..aca5a98f46e2aaac4f0260a767ce82800579e888 100644 (file)
@@ -4,7 +4,7 @@
 \alias{api_client_authorizations.update}
 \title{api_client_authorizations.update is a method defined in Arvados class.}
 \usage{
-arv$api_client_authorizations.update(api_client_authorization,
+arv$api_client_authorizations.update(apiclientauthorization,
        uuid)
 }
 \arguments{
index 9b607874d8e9f7f3a79df2e79c6b0a930a822949..da010101cc7b10935a5182e6fcdff9935d762a64 100644 (file)
@@ -4,7 +4,7 @@
 \alias{api_clients.create}
 \title{api_clients.create is a method defined in Arvados class.}
 \usage{
-arv$api_clients.create(api_client,
+arv$api_clients.create(apiclient,
        ensure_unique_name = "false")
 }
 \arguments{
index b89060f5712da835a69504bcf64408a7eba2c255..ec01831a78ad0cfc502f1178d8014950280fa4c0 100644 (file)
@@ -4,7 +4,7 @@
 \alias{api_clients.update}
 \title{api_clients.update is a method defined in Arvados class.}
 \usage{
-arv$api_clients.update(api_client,
+arv$api_clients.update(apiclient,
        uuid)
 }
 \arguments{
index 4ec8cea863e92923a44b5bdf0a7ae3870d9931a0..9f523f339659bd5913626da3bf28e944f7c71429 100644 (file)
@@ -4,7 +4,7 @@
 \alias{authorized_keys.create}
 \title{authorized_keys.create is a method defined in Arvados class.}
 \usage{
-arv$authorized_keys.create(authorized_key,
+arv$authorized_keys.create(authorizedkey,
        ensure_unique_name = "false")
 }
 \arguments{
index fd8ce699a7cc637a7729a2643b1dfc1ff2191fb1..10a0af40e369389b47d362feccd15254cf455a88 100644 (file)
@@ -4,7 +4,7 @@
 \alias{authorized_keys.update}
 \title{authorized_keys.update is a method defined in Arvados class.}
 \usage{
-arv$authorized_keys.update(authorized_key,
+arv$authorized_keys.update(authorizedkey,
        uuid)
 }
 \arguments{
index 94535f24554666a74e370e5d4a5feb2509bd8eb6..fe104ca7aa9d4d029e29af54b553122ff06acc30 100644 (file)
@@ -4,7 +4,7 @@
 \alias{container_requests.create}
 \title{container_requests.create is a method defined in Arvados class.}
 \usage{
-arv$container_requests.create(container_request,
+arv$container_requests.create(containerrequest,
        ensure_unique_name = "false")
 }
 \arguments{
index e5257de08293d91a80911fec3aa0b6ce71d22542..78aa17a7bd9f7ec946cc1501b2e2b184e7defb9f 100644 (file)
@@ -4,7 +4,7 @@
 \alias{container_requests.update}
 \title{container_requests.update is a method defined in Arvados class.}
 \usage{
-arv$container_requests.update(container_request,
+arv$container_requests.update(containerrequest,
        uuid)
 }
 \arguments{
index 4390eb9dac98dfb40548807adc50a0192363df19..cda460ca23e7fe2a49c66314dda632f62e5b002b 100644 (file)
@@ -4,8 +4,7 @@
 \alias{job_tasks.create}
 \title{job_tasks.create is a method defined in Arvados class.}
 \usage{
-arv$job_tasks.create(job_task,
-       ensure_unique_name = "false")
+arv$job_tasks.create(jobtask, ensure_unique_name = "false")
 }
 \arguments{
 \item{jobTask}{JobTask object.}
index 6e2a70d090a0ea858f42b867af84c3b4d4cb4548..e6fcec7f8a16e7607f052d3323b7c4a5d30bde29 100644 (file)
@@ -4,8 +4,7 @@
 \alias{job_tasks.update}
 \title{job_tasks.update is a method defined in Arvados class.}
 \usage{
-arv$job_tasks.update(job_task,
-       uuid)
+arv$job_tasks.update(jobtask, uuid)
 }
 \arguments{
 \item{jobTask}{JobTask object.}
index 3e4f833ca68d1736667ce9dcc040303b35285048..91215463ba9a803b7bd715630ab5371c09e5235b 100644 (file)
@@ -4,7 +4,7 @@
 \alias{keep_disks.create}
 \title{keep_disks.create is a method defined in Arvados class.}
 \usage{
-arv$keep_disks.create(keep_disk,
+arv$keep_disks.create(keepdisk,
        ensure_unique_name = "false")
 }
 \arguments{
index 5089f45c41eef04c22e836afdfe33e174818261b..b8ec283a7acdcd08be2e0e31231da51c94d2975e 100644 (file)
@@ -4,7 +4,7 @@
 \alias{keep_disks.update}
 \title{keep_disks.update is a method defined in Arvados class.}
 \usage{
-arv$keep_disks.update(keep_disk,
+arv$keep_disks.update(keepdisk,
        uuid)
 }
 \arguments{
index 8b12a9aee288ba7715f7a8c4aedfe9afe9f9f162..88a8a9a353345404cb80e429f50e471dafab7002 100644 (file)
@@ -4,7 +4,7 @@
 \alias{keep_services.create}
 \title{keep_services.create is a method defined in Arvados class.}
 \usage{
-arv$keep_services.create(keep_service,
+arv$keep_services.create(keepservice,
        ensure_unique_name = "false")
 }
 \arguments{
index f0594638ed425df63a62cbc66edcee0182e0689d..51120dcbd5b33e3353fc774a7fa8b87a65d263db 100644 (file)
@@ -4,7 +4,7 @@
 \alias{keep_services.update}
 \title{keep_services.update is a method defined in Arvados class.}
 \usage{
-arv$keep_services.update(keep_service,
+arv$keep_services.update(keepservice,
        uuid)
 }
 \arguments{
diff --git a/sdk/R/man/listAll.Rd b/sdk/R/man/listAll.Rd
new file mode 100644 (file)
index 0000000..2084b47
--- /dev/null
@@ -0,0 +1,22 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/util.R
+\name{listAll}
+\alias{listAll}
+\title{listAll}
+\usage{
+listAll(fn, ...)
+}
+\arguments{
+\item{fn}{Arvados method used to retrieve items from REST service.}
+
+\item{...}{Optional arguments which will be pased to fn .}
+}
+\description{
+List all resources even if the number of items is greater than maximum API limit.
+}
+\examples{
+\dontrun{
+arv <- Arvados$new("your Arvados token", "example.arvadosapi.com")
+cl <- listAll(arv$collections.list, filters = list(list("name", "like", "test\%"))
+}
+}
index 8f0c1e9f697f2035dc8275fed3d8a598037be787..63e081fea08242790a89dd32721da2d14f25f00c 100644 (file)
@@ -4,7 +4,7 @@
 \alias{pipeline_instances.create}
 \title{pipeline_instances.create is a method defined in Arvados class.}
 \usage{
-arv$pipeline_instances.create(pipeline_instance,
+arv$pipeline_instances.create(pipelineinstance,
        ensure_unique_name = "false")
 }
 \arguments{
index 505826028515c657bd881a98296ce4b7b3245051..f9caa26c59ed0ea31c4e3ab09f21a77056f1f92d 100644 (file)
@@ -4,7 +4,7 @@
 \alias{pipeline_instances.update}
 \title{pipeline_instances.update is a method defined in Arvados class.}
 \usage{
-arv$pipeline_instances.update(pipeline_instance,
+arv$pipeline_instances.update(pipelineinstance,
        uuid)
 }
 \arguments{
index 9b64766800e5f11541add307896ef012ed9f330e..32b332eb0014349ca4edb6dc772ad05029b151ce 100644 (file)
@@ -4,7 +4,7 @@
 \alias{pipeline_templates.create}
 \title{pipeline_templates.create is a method defined in Arvados class.}
 \usage{
-arv$pipeline_templates.create(pipeline_template,
+arv$pipeline_templates.create(pipelinetemplate,
        ensure_unique_name = "false")
 }
 \arguments{
index a266fe279ec69c560601bdbc8af1c2ee5b38bdfc..d7e51bd9d391ed861c22271ed4a1a6cdc8f901fd 100644 (file)
@@ -4,7 +4,7 @@
 \alias{pipeline_templates.update}
 \title{pipeline_templates.update is a method defined in Arvados class.}
 \usage{
-arv$pipeline_templates.update(pipeline_template,
+arv$pipeline_templates.update(pipelinetemplate,
        uuid)
 }
 \arguments{
index 03113a9d4d7a3bdd79019ba0cef1abe9edae6d9f..00da63623a74e7116c740708d037d311a29838ad 100644 (file)
@@ -4,7 +4,7 @@
 \alias{user_agreements.create}
 \title{user_agreements.create is a method defined in Arvados class.}
 \usage{
-arv$user_agreements.create(user_agreement,
+arv$user_agreements.create(useragreement,
        ensure_unique_name = "false")
 }
 \arguments{
index 17c5f31054fe2287366b4752f18d2cc4ea36b988..f61c8b1019858628fe03b31587b798cf28d4ceb8 100644 (file)
@@ -4,7 +4,7 @@
 \alias{user_agreements.update}
 \title{user_agreements.update is a method defined in Arvados class.}
 \usage{
-arv$user_agreements.update(user_agreement,
+arv$user_agreements.update(useragreement,
        uuid)
 }
 \arguments{
index 5ae56e5d4a3acedccade670df10626b54ba82582..d2ec7b6e67cba848e69fe51074e6f51c572bc823 100644 (file)
@@ -4,7 +4,7 @@
 \alias{virtual_machines.create}
 \title{virtual_machines.create is a method defined in Arvados class.}
 \usage{
-arv$virtual_machines.create(virtual_machine,
+arv$virtual_machines.create(virtualmachine,
        ensure_unique_name = "false")
 }
 \arguments{
index 4aa479cd3184b0055c38954fd3a7d4b6b1ad4693..8cee0bc91f9bff7f487905ab1d4784efe2028e59 100644 (file)
@@ -4,7 +4,7 @@
 \alias{virtual_machines.update}
 \title{virtual_machines.update is a method defined in Arvados class.}
 \usage{
-arv$virtual_machines.update(virtual_machine,
+arv$virtual_machines.update(virtualmachine,
        uuid)
 }
 \arguments{
index ef4a114cd15d0d6d8dabf3f5be60c68d21341699..898e59e3be89ef1c71aba81aca223b8d581c31a9 100644 (file)
@@ -31,34 +31,6 @@ test_that("getWebDavHostName returns webDAV host name properly", {
     expect_that("https://myWebDavServer.com", equals(REST$getWebDavHostName())) 
 }) 
 
-test_that("fetchAllItems always returns all resource items from server", {
-
-    expectedURL <- NULL
-    serverResponse <- list(items_available = 8,
-                           items = list("collection1",
-                                        "collection2",
-                                        "collection3",
-                                        "collection4",
-                                        "collection5",
-                                        "collection6",
-                                        "collection7",
-                                        "collection8"))
-
-    httpParser <- FakeHttpParser$new()
-    httpRequest <- FakeHttpRequest$new(expectedURL, serverResponse)
-    httpRequest$serverMaxElementsPerRequest <- 3
-
-    REST <- RESTService$new("token", "host", 
-                            httpRequest, httpParser,
-                            0, "webDavHost")
-
-    result <- REST$fetchAllItems(NULL, NULL)
-
-    expect_that(length(result), equals(8))
-    expect_that(httpRequest$numberOfGETRequests, equals(3))
-    expect_that(httpParser$parserCallCount, equals(3))
-}) 
-
 test_that("create calls REST service properly", {
 
     uuid <- "aaaaa-j7d0g-ccccccccccccccc"
index 62065f8e88f106b3bf988c418f242d57176cf5fa..ea091517c6b8abdf2f777e46046d8786623d1edc 100644 (file)
@@ -1,5 +1,29 @@
 context("Utility function")
 
+test_that("listAll always returns all resource items from server", {
+
+    serverResponseLimit <- 3
+    itemsAvailable <- 8
+    items <- list("collection1", "collection2", "collection3", "collection4",
+                  "collection5", "collection6", "collection7", "collection8")
+
+    testFunction <- function(offset, ...)
+    {
+        response <- list()
+        response$items_available <- itemsAvailable
+
+        maxIndex <- offset + serverResponseLimit
+        lastElementIndex <- if(maxIndex < itemsAvailable) maxIndex else itemsAvailable
+
+        response$items <- items[(offset + 1):lastElementIndex]
+        response
+    }
+
+    result <- listAll(testFunction)
+
+    expect_that(length(result), equals(8))
+}) 
+
 test_that("trimFromStart trims string correctly if string starts with trimCharacters", {
 
     sample <- "./something/random"