[ARVADOS] updated: 1.1.1-114-g02ce18b
Git user
git at public.curoverse.com
Fri Dec 1 10:22:23 EST 2017
Summary of changes:
build/run-tests.sh | 1 +
doc/install/install-keep-web.html.textile.liquid | 18 +-
sdk/R/.RData | Bin 94018 -> 94020 bytes
sdk/R/DESCRIPTION | 4 +-
sdk/R/R/Arvados.R | 112 +-
sdk/R/R/HttpRequest.R | 23 +-
sdk/R/man/Arvados-class.Rd | 7 +-
sdk/R/man/HttrParser-class.Rd | 11 +
sdk/R/man/collection_create.Rd | 18 +
sdk/R/man/collection_delete.Rd | 24 +
sdk/R/man/collection_get.Rd | 4 +
sdk/R/man/collection_list.Rd | 22 +
sdk/go/arvados/client.go | 23 +
sdk/go/arvados/collection.go | 4 +
sdk/go/arvados/collection_fs.go | 1492 +++++++++++++++++++---
sdk/go/arvados/collection_fs_test.go | 904 ++++++++++++-
sdk/go/arvados/error.go | 8 +-
sdk/go/httpserver/id_generator.go | 33 +-
sdk/go/httpserver/logger.go | 82 ++
sdk/go/httpserver/logger_test.go | 68 +
sdk/go/httpserver/responsewriter.go | 40 +-
sdk/go/keepclient/block_cache.go | 24 +-
sdk/go/keepclient/collectionreader.go | 151 +--
sdk/go/keepclient/collectionreader_test.go | 9 +-
sdk/go/keepclient/keepclient.go | 6 +
services/arv-git-httpd/auth_handler.go | 2 +-
services/crunch-run/crunchrun_test.go | 30 +-
services/keep-web/cache.go | 23 +
services/keep-web/cadaver_test.go | 184 ++-
services/keep-web/doc.go | 12 +-
services/keep-web/handler.go | 97 +-
services/keep-web/handler_test.go | 4 +-
services/keep-web/webdav.go | 128 +-
services/keep-web/webdav_test.go | 5 +
services/keepproxy/keepproxy.go | 14 +-
services/keepproxy/keepproxy_test.go | 33 +-
services/keepproxy/proxy_client.go | 6 +-
services/keepstore/handler_test.go | 2 +-
services/keepstore/keepstore.go | 4 +-
services/keepstore/logging_router.go | 111 --
services/keepstore/logging_router_test.go | 14 -
services/keepstore/s3_volume.go | 2 +
42 files changed, 3114 insertions(+), 645 deletions(-)
create mode 100644 sdk/R/man/HttrParser-class.Rd
create mode 100644 sdk/R/man/collection_create.Rd
create mode 100644 sdk/R/man/collection_delete.Rd
create mode 100644 sdk/R/man/collection_list.Rd
create mode 100644 sdk/go/httpserver/logger.go
create mode 100644 sdk/go/httpserver/logger_test.go
create mode 100644 services/keep-web/webdav_test.go
delete mode 100644 services/keepstore/logging_router.go
delete mode 100644 services/keepstore/logging_router_test.go
via 02ce18b74c42b34a86208a713e00dfa0e0fe39de (commit)
via 723ccdb54a0fc58c3e636481c404ea95b8f38d46 (commit)
via 195deb7adedb1e2756076c4bd4ecbb90358148d9 (commit)
via 3b0de665daab935f63b2c2675da7389fe74c40e7 (commit)
via c7399ec7afdf0cfdd0f3177f410f102083a26e15 (commit)
via d921ce5b97cbd86ae0bdaffe742269323cea526e (commit)
via 5c8b4fc39287a0075fc71c65684610fb4d623218 (commit)
via 20c3fbd046f726590774c5d7a1897835080a34e3 (commit)
via 5a32827d1f5ada007f83f5d5bb9b2d12526f2755 (commit)
via 062912dab12af62beab4d585584c0ccfc700af20 (commit)
via 76ebbe5955988735c14d48d12db6a06024882d2b (commit)
via 1f29f3766ec760168695c8f5bc64aa5ca0c497f1 (commit)
via 9af8e82f25fd6eb6ff3ebe9b7aeb3ef647b98ff0 (commit)
via 1d4d5726abdb9e2899431125d0c44e2a11caf669 (commit)
via 8ab7085c18193e3072481546a8c9f273497c177e (commit)
via 400e4596d20b4b57a6d7bd2dd280f027800a8da6 (commit)
via 65495abc7634b2a7cdccd01f7b6b3188b80bf052 (commit)
via 36d61969535234a6ef7c2ce271c9fe18af2f7cee (commit)
via eb99f0ea588defa3a9e23e76eeac66d277013566 (commit)
via 95ec747218f048e5bbfb986ff4eaeba2d3d2f80b (commit)
via 31f796ae50a95b7e5799095e4eaebc66968847df (commit)
via b1280706e42852ad3f7cac4dd4c64896837ead38 (commit)
via 4412d92e672d4df12ffc04c2b747b750e313cae9 (commit)
via 03a016b1edff72e698474cd31a887530ea89b530 (commit)
via b21dbd5c2fec1c8c61d232b2cf7f0a68240d9203 (commit)
via f328939c83c4cd4dfd8ed9c389e1e1bdc3fea05d (commit)
via 2fcbfc106c807aa17d2f73ce40fe2a64ed4c5b13 (commit)
via 907fdae023d547a5fe1b7ec6e6ad67204b617ab6 (commit)
via f089d5d392804f848ab498f9176dc60771e4a880 (commit)
via 49fa2bdd6d3cc48e91f705681ee1c4e0dbcdf31d (commit)
via 0a5e96b66f653e5d269441254acc7e6ba2df195b (commit)
via dc56b929215f826fb057ee5b9b7dfa58ff5ab3ed (commit)
via 70111d82653ca633d2397c74eb994a8a9d718e80 (commit)
via 11127c5b67a10a46f60c1c1c53a2c2639b7914e1 (commit)
via 127e916894bcd16f6978aa6488c81e79a9ca2812 (commit)
via 415e641036ebcfb944a37ffa14a101f2545104c3 (commit)
via 33d4ec966d17ffc98034504c308969dbe9177a85 (commit)
via 228699abb423444293dc74e925b99211a3d541a3 (commit)
via d09c6f1c05bc2a6c4b40c19b8317a03fdb0c232c (commit)
via e789dc0f82a18f7e5830bc1a3647b353035814db (commit)
via 00a4d2f890cd363725a4d6697bbf92498c866420 (commit)
via 14f466699a77923bb312695b17a7c8e7c0d17ed9 (commit)
via fdc739318a2f0ec44ad3da69465221b48d30c29c (commit)
via 5759c046e8d53818689774abde541449aeb3e0fb (commit)
via 0373c781e9fdc31246b64e122a2cf561287d16d6 (commit)
via 307188e3e1abfc9d1b1179d203454ffe8be36097 (commit)
via b33889df9191d3725212220c1304fdeb9c9798a9 (commit)
via 794d493c18ec19b7c2437eb898b5e13645e6ca2a (commit)
via 056a3fa0fcace48ea0053ed5b89cd6e0d1ca792e (commit)
via 375602be6ccd6d2293af6b3af7dbff005e782e29 (commit)
via 1ee5740919bbfa0075d9e7d1afd44fdeaef54b03 (commit)
via ec69b9a0c19680464ca686c13e658d521fb12577 (commit)
via 90fca0f2320076993c5e04afe56d5fd08e2225b6 (commit)
via cd45aed0312fc44046dcafe1681f5a4dc3ec1512 (commit)
via 4f21d0e5c0d2dca218bc9a204d364c15ad7450b1 (commit)
via 236ede1415d7a09f97a05c5ab63e2cedd4d19d48 (commit)
via 8bd416797eb97ed25e52611f1644fda4e7fb7eba (commit)
via 015e3798f9cbba4f27e1cd23b48eb396533cc0d8 (commit)
via 9009baaf0e3aa800de8af11c741d0adc46563200 (commit)
via 6ce00fb7121813f187b555435a3f01c2aa380f93 (commit)
via cad7d333436703d48c2811de8a26caef9fc130ad (commit)
via da3f22835804cc1bafe7daf373867ef46cbb20e8 (commit)
via 3e3abb01d17b0968e22e6738da12c86ad0a2a06c (commit)
from 15eda5715c312d12ec24c24db80448bee90e38ea (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 02ce18b74c42b34a86208a713e00dfa0e0fe39de
Merge: 723ccdb 195deb7
Author: Fuad Muhic <fmuhic at capeannenterprises.com>
Date: Fri Dec 1 16:21:32 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 723ccdb54a0fc58c3e636481c404ea95b8f38d46
Author: Fuad Muhic <fmuhic at capeannenterprises.com>
Date: Fri Dec 1 16:19:13 2017 +0100
Implemented collection_create, collection_delete and collection_update
methods. Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic at capeannenterprises.com>
diff --git a/sdk/R/.RData b/sdk/R/.RData
index 13255a2..2b5f989 100644
Binary files a/sdk/R/.RData and b/sdk/R/.RData differ
diff --git a/sdk/R/DESCRIPTION b/sdk/R/DESCRIPTION
index 35fb870..c6afbbb 100644
--- a/sdk/R/DESCRIPTION
+++ b/sdk/R/DESCRIPTION
@@ -11,4 +11,6 @@ Encoding: UTF-8
LazyData: true
RoxygenNote: 6.0.1.9000
Imports:
- httr
+ httr,
+ stringr,
+ jsonlite
diff --git a/sdk/R/R/Arvados.R b/sdk/R/R/Arvados.R
index 204d87e..8b3b40b 100644
--- a/sdk/R/R/Arvados.R
+++ b/sdk/R/R/Arvados.R
@@ -5,8 +5,9 @@ source("./R/HttpParser.R")
#'
#' All Arvados logic is inside this class
#'
-#' @field token represents user authentification token.
-#' @field host represents server name we wish to connect to.
+#' @field token Token represents user authentification token.
+#' @field host Host represents server name we wish to connect to.
+#' @examples arv = Arvados("token", "host_name")
#' @export Arvados
Arvados <- setRefClass(
@@ -21,9 +22,10 @@ Arvados <- setRefClass(
initialize = function(auth_token, host_name)
{
+ version <- "v1"
#Todo(Fudo): Validate token
token <<- auth_token
- host <<- host_name
+ host <<- paste0("https://", host_name, "/arvados/", version, "/")
}
)
)
@@ -34,6 +36,8 @@ Arvados <- setRefClass(
#'
#' @name collection_get
#' @field uuid UUID of the given collection
+#' @examples arv = Arvados("token", "hostName")
+#' @examples arv$collection_get("uuid")
Arvados$methods(
collection_get = function(uuid)
@@ -56,17 +60,23 @@ Arvados$methods(
#' collection_list
#'
-#' List Arvados collections based on filter matching
+#' Retreive list of collections based on provided filter.
#'
#' @name collection_list
-#' @field uuid UUID of the given collection
+#' @field filters List of filters we want to use to retreive list of collections.
+#' @field limit Limits the number of result returned by server.
+#' @field offset Offset from beginning of the result set.
+#' @examples arv = Arvados("token", "hostName")
+#' @examples arv$collection_list(list("uuid", "=" "aaaaa-bbbbb-ccccccccccccccc"))
Arvados$methods(
collection_list = function(filters = NULL, limit = NULL, offset = NULL)
{
#Todo(Fudo): Implement limit and offset
collection_relative_url <- "collections"
- http_request <- HttpRequest("GET", token, host, collection_relative_url, filters, limit, offset)
+ http_request <- HttpRequest("GET", token, host, collection_relative_url,
+ body = NULL, filters, limit, offset)
+
server_response <- http_request$execute()
httpParser <- HttpParser()
@@ -80,3 +90,93 @@ Arvados$methods(
return(collection)
}
)
+
+#' collection_create
+#'
+#' Create Arvados collection
+#'
+#' @name collection_create
+#' @field body Structure of the collection we want to create.
+#' @examples arv = Arvados("token", "hostName")
+#' @examples arv$collection_create(list(collection = list(name = "myCollection")))
+Arvados$methods(
+
+ collection_create = function(body)
+ {
+ collection_relative_url <- paste0("collections/", "/?alt=json")
+ body = jsonlite::toJSON(body, auto_unbox = T)
+
+ http_request <- HttpRequest("POST", token, host, collection_relative_url, body)
+ server_response <- http_request$execute()
+
+ httpParser <- HttpParser()
+ collection <- httpParser$parseCollectionGet(server_response)
+
+ if(!is.null(collection$errors))
+ stop(collection$errors)
+
+ class(collection) <- "ArvadosCollection"
+
+ return(collection)
+ }
+)
+
+#' collection_delete
+#'
+#' Delete Arvados collection
+#'
+#' @name collection_delete
+#' @field uuid UUID of the collection we want to delete.
+#' @examples arv = Arvados("token", "hostName")
+#' @examples arv$collection_delete(uuid = "aaaaa-bbbbb-ccccccccccccccc")
+Arvados$methods(
+
+ collection_delete = function(uuid)
+ {
+ collection_relative_url <- paste0("collections/", uuid, "/?alt=json")
+
+ http_request <- HttpRequest("DELETE", token, host, collection_relative_url)
+ server_response <- http_request$execute()
+
+ httpParser <- HttpParser()
+ collection <- httpParser$parseCollectionGet(server_response)
+
+ if(!is.null(collection$errors))
+ stop(collection$errors)
+
+ class(collection) <- "ArvadosCollection"
+
+ return(collection)
+ }
+)
+
+#' collection_update
+#'
+#' Update Arvados collection
+#'
+#' @name collection_update
+#' @field uuid UUID of the collection we want to update.
+#' @field body New structure of the collection.
+#' @examples arv = Arvados("token", "hostName")
+#' @examples arv$collection_update(uuid = "aaaaa-bbbbb-ccccccccccccccc", list(collection = list(name = "newName")))
+Arvados$methods(
+
+ collection_update = function(uuid, body)
+ {
+ collection_relative_url <- paste0("collections/", uuid, "/?alt=json")
+ body = jsonlite::toJSON(body, auto_unbox = T)
+
+ http_request <- HttpRequest("PUT", token, host, collection_relative_url, body)
+ server_response <- http_request$execute()
+
+ httpParser <- HttpParser()
+ collection <- httpParser$parseCollectionGet(server_response)
+
+ if(!is.null(collection$errors))
+ stop(collection$errors)
+
+ class(collection) <- "ArvadosCollection"
+
+ return(collection)
+ }
+)
diff --git a/sdk/R/R/HttpRequest.R b/sdk/R/R/HttpRequest.R
index 96f0a83..041d64d 100644
--- a/sdk/R/R/HttpRequest.R
+++ b/sdk/R/R/HttpRequest.R
@@ -10,6 +10,7 @@ HttpRequest <- setRefClass(
server_relative_url = "character",
auth_token = "character",
allowed_methods = "list",
+ request_body = "ANY",
query_filters = "ANY",
response_limit = "ANY",
query_offset = "ANY"
@@ -20,6 +21,7 @@ HttpRequest <- setRefClass(
token,
base_url,
relative_url,
+ body = NULL,
filters = NULL,
limit = 100,
offset = 0)
@@ -28,6 +30,7 @@ HttpRequest <- setRefClass(
auth_token <<- token
server_base_url <<- base_url
server_relative_url <<- relative_url
+ request_body <<- body
query_filters <<- filters
response_limit <<- limit
query_offset <<- offset
@@ -35,6 +38,7 @@ HttpRequest <- setRefClass(
execute = function()
{
+ #Todo(Fudo): Get rid of the switch and make this module more general.
http_method <- switch(send_method,
"GET" = .self$getRequest,
"POST" = .self$postRequest,
@@ -57,20 +61,27 @@ HttpRequest <- setRefClass(
#Todo(Fudo): Try to make this more generic
postRequest = function()
{
- #Todo(Fudo): Implement this later on.
- print("POST method")
+ url <- paste0(server_base_url, server_relative_url)
+ requestHeaders <- httr::add_headers("Authorization" = .self$getAuthHeader(),
+ "Content-Type" = "application/json")
+ response <- POST(url, body = request_body, config = requestHeaders)
},
putRequest = function()
{
- #Todo(Fudo): Implement this later on.
- print("PUT method")
+ url <- paste0(server_base_url, server_relative_url)
+ requestHeaders <- httr::add_headers("Authorization" = .self$getAuthHeader(),
+ "Content-Type" = "application/json")
+
+ response <- PUT(url, body = request_body, config = requestHeaders)
},
deleteRequest = function()
{
- #Todo(Fudo): Implement this later on.
- print("DELETE method")
+ url <- paste0(server_base_url, server_relative_url)
+ requestHeaders <- httr::add_headers("Authorization" = .self$getAuthHeader(),
+ "Content-Type" = "application/json")
+ response <- DELETE(url, config = requestHeaders)
},
pathcRequest = function()
diff --git a/sdk/R/man/Arvados-class.Rd b/sdk/R/man/Arvados-class.Rd
index 2cc6dd1..315f851 100644
--- a/sdk/R/man/Arvados-class.Rd
+++ b/sdk/R/man/Arvados-class.Rd
@@ -11,9 +11,12 @@ All Arvados logic is inside this class
\section{Fields}{
\describe{
-\item{\code{token}}{represents user authentification token.}
+\item{\code{token}}{Token represents user authentification token.}
-\item{\code{host}}{represents server name we wish to connect to.}
+\item{\code{host}}{Host represents server name we wish to connect to.}
}}
+\examples{
+arv = Arvados("token", "host_name")
+}
diff --git a/sdk/R/man/HttrParser-class.Rd b/sdk/R/man/HttrParser-class.Rd
new file mode 100644
index 0000000..5a6d1c7
--- /dev/null
+++ b/sdk/R/man/HttrParser-class.Rd
@@ -0,0 +1,11 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/HttpParser.R
+\docType{class}
+\name{HttrParser-class}
+\alias{HttrParser-class}
+\alias{HttpParser}
+\title{HttpParser}
+\description{
+HttpParser
+}
+
diff --git a/sdk/R/man/collection_create.Rd b/sdk/R/man/collection_create.Rd
new file mode 100644
index 0000000..4a0509b
--- /dev/null
+++ b/sdk/R/man/collection_create.Rd
@@ -0,0 +1,18 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Arvados.R
+\name{collection_create}
+\alias{collection_create}
+\title{collection_create}
+\description{
+Create Arvados collection
+}
+\section{Fields}{
+
+\describe{
+\item{\code{body}}{Structure of the collection we want to create.}
+}}
+
+\examples{
+arv = Arvados("token", "host_name")
+arv$collection_create(list(collection = list(name = "myCollection")))
+}
diff --git a/sdk/R/man/collection_delete.Rd b/sdk/R/man/collection_delete.Rd
new file mode 100644
index 0000000..5c37a9b
--- /dev/null
+++ b/sdk/R/man/collection_delete.Rd
@@ -0,0 +1,24 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Arvados.R
+\name{collection_delete}
+\alias{collection_delete}
+\title{collection_delete}
+\description{
+Delete Arvados collection
+
+Delete Arvados collection
+}
+\section{Fields}{
+
+\describe{
+\item{\code{uuid}}{UUID of the collection we want to delete.}
+
+\item{\code{uuid}}{UUID of the collection we want to delete.}
+}}
+
+\examples{
+arv = Arvados("token", "host_name")
+arv$collection_delete(uuid = "aaaaa-bbbbb-ccccccccccccccc")
+arv = Arvados("token", "host_name")
+arv$collection_delete(uuid = "aaaaa-bbbbb-ccccccccccccccc")
+}
diff --git a/sdk/R/man/collection_get.Rd b/sdk/R/man/collection_get.Rd
index fac67e4..e29170b 100644
--- a/sdk/R/man/collection_get.Rd
+++ b/sdk/R/man/collection_get.Rd
@@ -12,3 +12,7 @@ Get Arvados collection
\item{\code{uuid}}{UUID of the given collection}
}}
+\examples{
+arv = Arvados("token", "host_name")
+arv$collection_get("uuid")
+}
diff --git a/sdk/R/man/collection_list.Rd b/sdk/R/man/collection_list.Rd
new file mode 100644
index 0000000..a1a73d7
--- /dev/null
+++ b/sdk/R/man/collection_list.Rd
@@ -0,0 +1,22 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Arvados.R
+\name{collection_list}
+\alias{collection_list}
+\title{collection_list}
+\description{
+Retreive list of collections based on provided filter.
+}
+\section{Fields}{
+
+\describe{
+\item{\code{filters}}{List of filters we want to use to retreive list of collections.}
+
+\item{\code{limit}}{Limits the number of result returned by server.}
+
+\item{\code{offset}}{Offset from beginning of the result set.}
+}}
+
+\examples{
+arv = Arvados("token", "host_name")
+arv$collection_list(list("uuid", "=" "aaaaa-bbbbb-ccccccccccccccc"))
+}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list