|
#!/usr/bin/env Rscript
|
|
library(ArvadosR)
|
|
arv <- Arvados$new(
|
|
"v2/jutro-gj3su-5ley3cu1mpg87r5/63clrb29suazbp7kcyx9cltikcm6z970drlt0fvl8dbvym9arj",
|
|
"pirca.arvadosapi.com"
|
|
)
|
|
# Should print FALSE
|
|
arv$project_exist("pirca-j7d0g-fffffffffffffff")
|
|
cat("\n")
|
|
# Should print TRUE
|
|
projUUID <- "pirca-j7d0g-ck9w4qzqi3u0jv6"
|
|
arv$project_exist(projUUID)
|
|
cat("\n")
|
|
|
|
show <- function(project) print(format(c(project$uuid, project$properties)))
|
|
project <- arv$project_properties_set(list("properties_set" = "True"), projUUID)
|
|
show(project) # Should show `properties_set`
|
|
project <- arv$project_properties_append(list("properties_append" = "True"), projUUID)
|
|
show(project) # Should show `properties_set` and `properties_append`
|
|
print(format(arv$project_properties_get(projUUID))) # Should show both properties
|
|
project <- arv$project_properties_delete("properties_append", projUUID)
|
|
show(project) # Should show `properties_set`
|
|
|
|
userUUID <- "pirca-j7d0g-anonymouspublic"
|
|
showLink <- function(link) print(format(c(link$tail_uuid, link$name, link$head_uuid)))
|
|
link <- arv$project_permission_give("can_read", projUUID, userUUID)
|
|
showLink(link) # Should show anonymouspublic can_read projUUID
|
|
link <- arv$project_permission_update("can_read", "can_write", projUUID, userUUID)
|
|
showLink(link) # Should show anonymouspublic can_write projUUID
|
|
links <- arv$project_permission_check(projUUID, userUUID)
|
|
showLink(links[[1]]) # Should show anonymouspublic can_write projUUID
|
|
arv$project_permission_check(projUUID, userUUID, "can_write") # Should print `can_write`
|
|
link <- arv$project_permission_delete("can_write", projUUID, userUUID)
|
|
showLink(link) # Should show anonymouspublic can_write projUUID
|