[ARVADOS] updated: 1.1.1-312-g2fcdd3f
Git user
git at public.curoverse.com
Tue Dec 19 12:18:19 EST 2017
Summary of changes:
build/run-build-packages-one-target.sh | 15 +++---
sdk/R/R/Arvados.R | 91 +++++++++++++++++++++++++++++++++-
sdk/R/R/HttpParser.R | 1 -
sdk/R/README | 58 ++++++++++++++++++++--
4 files changed, 152 insertions(+), 13 deletions(-)
via 2fcdd3f845647243517af895d49c812f9c2eaae2 (commit)
via 62a2ccba46cb5b83e510e727afa44eee2e893676 (commit)
via d5cb3c081c0e9a8d7698feb7c04ade6f385a5471 (commit)
via 459de9bfd86a58496e9585ebc999113afd6bb0d1 (commit)
from 790a912ff48b90cba284a0a6b5b4e34db7b22078 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 2fcdd3f845647243517af895d49c812f9c2eaae2
Author: Fuad Muhic <fmuhic at capeannenterprises.com>
Date: Tue Dec 19 18:17:42 2017 +0100
Updated README file
Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic at capeannenterprises.com>
diff --git a/sdk/R/R/HttpParser.R b/sdk/R/R/HttpParser.R
index dda3db9..e7407b1 100644
--- a/sdk/R/R/HttpParser.R
+++ b/sdk/R/R/HttpParser.R
@@ -14,7 +14,6 @@ HttpParser <- R6::R6Class(
parsed_response <- httr::content(serverResponse, as = "parsed", type = "application/json")
},
- #TODO rename this
parseWebDAVResponse = function(response, uri)
{
text <- rawToChar(response$content)
diff --git a/sdk/R/README b/sdk/R/README
index 2e2298e..560be87 100644
--- a/sdk/R/README
+++ b/sdk/R/README
@@ -138,8 +138,28 @@ collection$remove(c("path/to/my/file.cpp", "path/to/other/file.cpp"))
--------------------------------------------------------------------------------------------------------------------------------
+#Move file or folder inside collection
+
+file <- collection$get("location/to/my/file.cpp")
+
+file$move("destination/file.cpp")
+
+#Or subcollections
+
+subcollection <- collection$get("location/to/folder")
+
+file$move("destination/folder")
+
+#Make sure to include folder name in destination
+#For example
+#file$move("destination/") will not work
+
--------------------------------------------------------------------------------------------------------------------------------
+--------------------------------------------------------------------------------------------------------------------------------
+
+# Working with projects:
+
#Get project:
arv$getProject("uuid")
commit 62a2ccba46cb5b83e510e727afa44eee2e893676
Merge: d5cb3c0 459de9b
Author: Fuad Muhic <fmuhic at capeannenterprises.com>
Date: Tue Dec 19 18:03:41 2017 +0100
Merge branch 'master' of git.curoverse.com:arvados into 11876-r-sdk
Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic at capeannenterprises.com>
commit d5cb3c081c0e9a8d7698feb7c04ade6f385a5471
Author: Fuad Muhic <fmuhic at capeannenterprises.com>
Date: Tue Dec 19 18:02:45 2017 +0100
Added function to work with projects.
Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic at capeannenterprises.com>
diff --git a/sdk/R/R/Arvados.R b/sdk/R/R/Arvados.R
index 7d61d77..2c9d003 100644
--- a/sdk/R/R/Arvados.R
+++ b/sdk/R/R/Arvados.R
@@ -73,6 +73,8 @@ Arvados <- R6::R6Class(
collectionURL <- paste0(private$host, "collections")
headers <- list(Authorization = paste("OAuth2", private$token))
+ names(filters) <- c("collection")
+
serverResponse <- private$http$GET(collectionURL, headers, filters, limit, offset)
collection <- private$httpParser$parseJSONResponse(serverResponse)
@@ -104,6 +106,7 @@ Arvados <- R6::R6Class(
headers <- list("Authorization" = paste("OAuth2", private$token),
"Content-Type" = "application/json")
+ names(body) <- c("collection")
body <- jsonlite::toJSON(body, auto_unbox = T)
serverResponse <- private$http$PUT(collectionURL, headers, body)
@@ -121,6 +124,8 @@ Arvados <- R6::R6Class(
collectionURL <- paste0(private$host, "collections")
headers <- list("Authorization" = paste("OAuth2", private$token),
"Content-Type" = "application/json")
+
+ names(body) <- c("collection")
body <- jsonlite::toJSON(body, auto_unbox = T)
serverResponse <- private$http$POST(collectionURL, headers, body)
@@ -131,8 +136,92 @@ Arvados <- R6::R6Class(
stop(collection$errors)
collection
- }
+ },
+
+ getProject = function(uuid)
+ {
+ projectURL <- paste0(private$host, "groups/", uuid)
+ headers <- list(Authorization = paste("OAuth2", private$token))
+
+ serverResponse <- private$http$GET(projectURL, headers)
+
+ project <- private$httpParser$parseJSONResponse(serverResponse)
+
+ if(!is.null(project$errors))
+ stop(project$errors)
+
+ project
+ },
+
+ createProject = function(body)
+ {
+ projectURL <- paste0(private$host, "groups")
+ headers <- list("Authorization" = paste("OAuth2", private$token),
+ "Content-Type" = "application/json")
+
+ names(body) <- c("group")
+ body <- jsonlite::toJSON(body, auto_unbox = T)
+
+ serverResponse <- private$http$POST(projectURL, headers, body)
+
+ project <- private$httpParser$parseJSONResponse(serverResponse)
+
+ if(!is.null(project$errors))
+ stop(project$errors)
+
+ project
+ },
+
+ updateProject = function(uuid, body)
+ {
+ projectURL <- paste0(private$host, "groups/", uuid)
+ headers <- list("Authorization" = paste("OAuth2", private$token),
+ "Content-Type" = "application/json")
+
+ names(body) <- c("group")
+ body <- jsonlite::toJSON(body, auto_unbox = T)
+
+ serverResponse <- private$http$PUT(projectURL, headers, body)
+
+ project <- private$httpParser$parseJSONResponse(serverResponse)
+
+ if(!is.null(project$errors))
+ stop(project$errors)
+
+ project
+ },
+
+ listProjects = function(filters = NULL, limit = 100, offset = 0)
+ {
+ projectURL <- paste0(private$host, "groups")
+ headers <- list(Authorization = paste("OAuth2", private$token))
+
+ names(filters) <- c("groups")
+ serverResponse <- private$http$GET(projectURL, headers, filters, limit, offset)
+ projects <- private$httpParser$parseJSONResponse(serverResponse)
+
+ if(!is.null(projects$errors))
+ stop(projects$errors)
+
+ projects
+ },
+
+ deleteProject = function(uuid)
+ {
+ projectURL <- paste0(private$host, "groups/", uuid)
+ headers <- list("Authorization" = paste("OAuth2", private$token),
+ "Content-Type" = "application/json")
+
+ serverResponse <- private$http$DELETE(projectURL, headers)
+
+ project <- private$httpParser$parseJSONResponse(serverResponse)
+
+ if(!is.null(project$errors))
+ stop(project$errors)
+
+ project
+ }
),
private = list(
diff --git a/sdk/R/README b/sdk/R/README
index a59e9b5..2e2298e 100644
--- a/sdk/R/README
+++ b/sdk/R/README
@@ -30,19 +30,19 @@ deletedCollection <- arv$deleteCollection("uuid")
#Update collection:
-updatedCollection <- arv$updateCollection("uuid", list(collection = list(name = "new_name", description = "new_desciption")))
+updatedCollection <- arv$updateCollection("uuid", list((name = "new_name", description = "new_desciption")))
--------------------------------------------------------------------------------------------------------------------------------
#Create collection:
-updatedCollection <- arv$createCollection("uuid", list(collection = list(name = "new_name", description = "new_desciption")))
+cratedCollection <- arv$createCollection(list(list(name = "new_name", description = "new_desciption")))
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
-#Collection manipulation:
+#Collection content manipulation:
--------------------------------------------------------------------------------------------------------------------------------
@@ -137,3 +137,35 @@ collection$remove(file)
collection$remove(c("path/to/my/file.cpp", "path/to/other/file.cpp"))
--------------------------------------------------------------------------------------------------------------------------------
+
+--------------------------------------------------------------------------------------------------------------------------------
+
+#Get project:
+
+arv$getProject("uuid")
+
+--------------------------------------------------------------------------------------------------------------------------------
+
+#List projects:
+
+projects <- arv$listProjects(list("uuid", "=" "aaaaa-bbbbb-ccccccccccccccc"), limit = 10, offset = 2)
+
+--------------------------------------------------------------------------------------------------------------------------------
+
+#Delete project:
+
+deletedProject <- arv$deleteProject("uuid")
+
+--------------------------------------------------------------------------------------------------------------------------------
+
+#Update project:
+
+updatedProject <- arv$updateProject("uuid", list((name = "new_name", description = "new_desciption")))
+
+--------------------------------------------------------------------------------------------------------------------------------
+
+#Create project:
+
+cratedProject <- arv$createProject(list(list(name = "project_name", description = "project_desciption")))
+
+--------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list