Updated README and removed debug prints
authorFuad Muhic <muhic.fuad@gmail.com>
Tue, 27 Mar 2018 12:31:57 +0000 (14:31 +0200)
committerFuad Muhic <muhic.fuad@gmail.com>
Tue, 27 Mar 2018 12:31:57 +0000 (14:31 +0200)
Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic@capeannenterprises.com>

sdk/R/R/Arvados.R
sdk/R/R/HttpRequest.R
sdk/R/R/autoGenAPI.R
sdk/R/README.Rmd

index 94d5fb0851613d1ff58bed1735056cf82e1474bb..66e2794c7ed688ad8a88e6356ecd1971b2172222 100644 (file)
@@ -1625,24 +1625,24 @@ Arvados <- R6::R6Class(
 
                },
 
-               project.get = function(uuid)
+               projects.get = function(uuid)
                {
                        self$groups.get(uuid)
                },
 
-               project.create = function(group, ensure_unique_name = "false")
+               projects.create = function(group, ensure_unique_name = "false")
                {
                        group <- c("group_class" = "project", group)
                        self$groups.create(group, ensure_unique_name)
                },
 
-               project.update = function(group, uuid)
+               projects.update = function(group, uuid)
                {
                        group <- c("group_class" = "project", group)
                        self$groups.update(group, uuid)
                },
 
-               project.list = function(filters = NULL, where = NULL,
+               projects.list = function(filters = NULL, where = NULL,
                        order = NULL, select = NULL, distinct = NULL,
                        limit = "100", offset = "0", count = "exact",
                        include_trash = NULL)
@@ -1652,7 +1652,7 @@ Arvados <- R6::R6Class(
                                         limit, offset, count, include_trash)
                },
 
-               project.delete = function(uuid)
+               projects.delete = function(uuid)
                {
                        self$groups.delete(uuid)
                },
index 149ec0db7ae5f655bec60893c590ee7bf584a84a..bc6b4d406d1f801acb7328a5d9263b44a473b2a7 100644 (file)
@@ -28,7 +28,6 @@ HttpRequest <- R6::R6Class(
             if(toString(Sys.getenv("ARVADOS_API_HOST_INSECURE") == "TRUE"))
                config$options = list(ssl_verifypeer = FALSE)
 
-            print(config)
             # times = 1 regular call + numberOfRetries
             response <- httr::RETRY(verb, url = url, body = body,
                                     config = config, times = retryTimes + 1)
index ba74f9828aeddae2eefbcde635378e9cc9760542..849875204d6f224052ce3fca2a5f6d766c30a2c4 100644 (file)
@@ -70,24 +70,24 @@ generateAPIClassHeader <- function()
 
 generateProjectMethods <- function()
 {
-    c("\t\tproject.get = function(uuid)",
+    c("\t\tprojects.get = function(uuid)",
       "\t\t{",
       "\t\t\tself$groups.get(uuid)",
       "\t\t},",
       "",
-      "\t\tproject.create = function(group, ensure_unique_name = \"false\")",
+      "\t\tprojects.create = function(group, ensure_unique_name = \"false\")",
       "\t\t{",
       "\t\t\tgroup <- c(\"group_class\" = \"project\", group)",
       "\t\t\tself$groups.create(group, ensure_unique_name)",
       "\t\t},",
       "",
-      "\t\tproject.update = function(group, uuid)",
+      "\t\tprojects.update = function(group, uuid)",
       "\t\t{",
       "\t\t\tgroup <- c(\"group_class\" = \"project\", group)",
       "\t\t\tself$groups.update(group, uuid)",
       "\t\t},",
       "",
-      "\t\tproject.list = function(filters = NULL, where = NULL,",
+      "\t\tprojects.list = function(filters = NULL, where = NULL,",
       "\t\t\torder = NULL, select = NULL, distinct = NULL,",
       "\t\t\tlimit = \"100\", offset = \"0\", count = \"exact\",",
       "\t\t\tinclude_trash = NULL)",
@@ -97,7 +97,7 @@ generateProjectMethods <- function()
       "\t\t\t                 limit, offset, count, include_trash)",
       "\t\t},",
       "",
-      "\t\tproject.delete = function(uuid)",
+      "\t\tprojects.delete = function(uuid)",
       "\t\t{",
       "\t\t\tself$groups.delete(uuid)",
       "\t\t},",
index 098bfe19a5759d345ee9f325ee23f4b3a000e3bd..65c79798611aacfc58cd325c50e519278be6aef6 100644 (file)
@@ -56,16 +56,16 @@ knitr::opts_chunk$set(eval = FALSE)
 * Get a collection:
 
     ```{r}
-    collection <- arv$getCollection("uuid")
+    collection <- arv$collections.get("uuid")
     ```
 
 * List collections:
 
     ```{r}
     # offset of 0 and default limit of 100
-    collectionList <- arv$listCollections(list(list("name", "like", "Test%")))
+    collectionList <- arv$collections.list(list(list("name", "like", "Test%")))
 
-    collectionList <- arv$listCollections(list(list("name", "like", "Test%")), limit = 10, offset = 2)
+    collectionList <- arv$collections.list(list(list("name", "like", "Test%")), limit = 10, offset = 2)
     ```
 
     ```{r}
@@ -79,25 +79,25 @@ knitr::opts_chunk$set(eval = FALSE)
 * List all collections even if the number of items is greater than maximum API limit:
 
     ```{r}
-    collectionList <- arv$listAllCollections(list(list("name", "like", "Test%")))
+    collectionList <- listAll(arv$collections.list, list(list("name", "like", "Test%")))
     ```
 
 * Delete a collection:
 
     ```{r}
-    deletedCollection <- arv$deleteCollection("uuid")
+    deletedCollection <- arv$collections.delete("uuid")
     ```
 
 * Update a collection's metadata:
 
     ```{r}
-    updatedCollection <- arv$updateCollection("uuid", list(name = "New name", description = "New description"))
+    updatedCollection <- arv$collections.update(list(name = "New name", description = "New description"), "uuid")
     ```
 
 * Create collection:
 
     ```{r}
-    createdCollection <- arv$createCollection(list(name = "Example", description = "This is a test collection"))
+    newCollection <- arv$collections.create(list(name = "Example", description = "This is a test collection"))
     ```
 
 
@@ -252,41 +252,50 @@ knitr::opts_chunk$set(eval = FALSE)
 * Get a project:
 
     ```{r}
-    project <- arv$getProject("uuid")
+    project <- arv$projects.get("uuid")
     ```
 
 * List projects:
 
     ```{r}
     # list subprojects of a project
-    projects <- arv$listProjects(list(list("owner_uuid", "=", "aaaaa-j7d0g-ccccccccccccccc")))
+    projects <- arv$projects.list(list(list("owner_uuid", "=", "aaaaa-j7d0g-ccccccccccccccc")))
 
     # list projects which have names beginning with Example
-    arv$listProjects(list(list("name","like","Example%")))
+    examples <- arv$projects.list(list(list("name","like","Example%")))
     ```
 
 * List all projects even if the number of items is greater than maximum API limit:
 
     ```{r}
-    collectionList <- arv$listAllProjects(list(list("name","like","Example%")))
+    projects <- listAll(arv$projects.list, list(list("name","like","Example%")))
     ```
 
 * Delete a project:
 
     ```{r}
-    deletedProject <- arv$deleteProject("uuid")
+    deletedProject <- arv$projects.delete("uuid")
     ```
 
 * Update project:
 
     ```{r}
-    updatedProject <- arv$updateProject("uuid", list(name = "new_name", description = "new description"))
+    updatedProject <- arv$projects.update(list(name = "new_name", description = "new description"), "uuid")
     ```
 
 * Create project:
 
     ```{r}
-    createdProject <- arv$createProject(list(name = "project_name", description = "project description"))
+    newProject <- arv$projects.update(list(name = "project_name", description = "project description"))
+    ```
+
+#### Help
+
+* View help page of any method defined in Arvados class by puting ? before method name:
+
+    ```{r}
+    ?collections.update
+    ?jobs.get
     ```
 
 ### Building the ArvadosR package