projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
19126: update the nginx template used by our tests and arvados-server
[arvados.git]
/
sdk
/
R
/
R
/
autoGenAPI.R
diff --git
a/sdk/R/R/autoGenAPI.R
b/sdk/R/R/autoGenAPI.R
index 6db28f9dac63c070df26023da66c87e9b0124d67..c86684f8b0a13ab62f53eddc23884a16e2504ffc 100644
(file)
--- a/
sdk/R/R/autoGenAPI.R
+++ b/
sdk/R/R/autoGenAPI.R
@@
-1,5
+1,9
@@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
getAPIDocument <- function(){
getAPIDocument <- function(){
- url <- "https://
4xphq
.arvadosapi.com/discovery/v1/apis/arvados/v1/rest"
+ url <- "https://
jutro
.arvadosapi.com/discovery/v1/apis/arvados/v1/rest"
serverResponse <- httr::RETRY("GET", url = url)
httr::content(serverResponse, as = "parsed", type = "application/json")
serverResponse <- httr::RETRY("GET", url = url)
httr::content(serverResponse, as = "parsed", type = "application/json")
@@
-13,6
+17,10
@@
generateAPI <- function()
discoveryDocument <- getAPIDocument()
methodResources <- discoveryDocument$resources
discoveryDocument <- getAPIDocument()
methodResources <- discoveryDocument$resources
+
+ # Don't emit deprecated APIs
+ methodResources <- methodResources[!(names(methodResources) %in% c("jobs", "job_tasks", "pipeline_templates", "pipeline_instances",
+ "keep_disks", "nodes", "humans", "traits", "specimens"))]
resourceNames <- names(methodResources)
methodDoc <- genMethodsDoc(methodResources, resourceNames)
resourceNames <- names(methodResources)
methodDoc <- genMethodsDoc(methodResources, resourceNames)
@@
-30,6
+38,10
@@
generateAPI <- function()
arvadosAPIFooter)
fileConn <- file("./R/Arvados.R", "w")
arvadosAPIFooter)
fileConn <- file("./R/Arvados.R", "w")
+ writeLines(c(
+ "# Copyright (C) The Arvados Authors. All rights reserved.",
+ "#",
+ "# SPDX-License-Identifier: Apache-2.0", ""), fileConn)
writeLines(unlist(arvadosClass), fileConn)
close(fileConn)
NULL
writeLines(unlist(arvadosClass), fileConn)
close(fileConn)
NULL
@@
-248,7
+260,7
@@
getRequestURL <- function(methodMetaData)
getRequestHeaders <- function()
{
getRequestHeaders <- function()
{
- c("headers <- list(Authorization = paste(\"
OAuth2
\", private$token), ",
+ c("headers <- list(Authorization = paste(\"
Bearer
\", private$token), ",
" \"Content-Type\" = \"application/json\")")
}
" \"Content-Type\" = \"application/json\")")
}
@@
-339,7
+351,7
@@
genMethodsDoc <- function(methodResources, resourceNames)
}, methodResources, resourceNames)))
projectDoc <- genProjectMethodsDoc()
}, methodResources, resourceNames)))
projectDoc <- genProjectMethodsDoc()
-
+
c(methodsDoc, projectDoc)
}
c(methodsDoc, projectDoc)
}
@@
-397,10
+409,10
@@
getAPIClassMethodList <- function(methodResources, resourceNames)
methodNames[!(methodNames %in% c("index", "show", "destroy"))])
}, methodResources, resourceNames)))
methodNames[!(methodNames %in% c("index", "show", "destroy"))])
}, methodResources, resourceNames)))
-
+
hardcodedMethods <- c("projects.create", "projects.get",
"projects.list", "projects.update", "projects.delete")
hardcodedMethods <- c("projects.create", "projects.get",
"projects.list", "projects.update", "projects.delete")
- paste0("#' \t\\item{}{\\code{\\link{", sort(c(methodList, hardcodedMethods)), "}}}")
+ paste0("#' \t\\item{}{\\code{\\link{", sort(c(methodList, hardcodedMethods)), "}}}")
}
getMethodDoc <- function(methodName, methodMetaData)
}
getMethodDoc <- function(methodName, methodMetaData)
@@
-443,7
+455,7
@@
getMethodDescription <- function(methodMetaData)
className <- sapply(prop, function(ref) ref)
objectName <- paste0(tolower(substr(className, 1, 1)),
substr(className, 2, nchar(className)))
className <- sapply(prop, function(ref) ref)
objectName <- paste0(tolower(substr(className, 1, 1)),
substr(className, 2, nchar(className)))
- paste("#' @param", objectName, className, "object.")
+ paste("#' @param", objectName, className, "object.")
})))
}
})))
}
@@
-453,7
+465,7
@@
getMethodDescription <- function(methodMetaData)
{
arg <- methodMetaData$parameters[[argName]]
argDescription <- arg$description
{
arg <- methodMetaData$parameters[[argName]]
argDescription <- arg$description
- paste("#' @param", argName, argDescription)
+ paste("#' @param", argName, argDescription)
})))
c(requestDoc, argsDoc)
})))
c(requestDoc, argsDoc)
@@
-537,7
+549,7
@@
formatArgs <- function(prependAtStart, prependToEachSplit,
{
if(length(args) > 1)
{
{
if(length(args) > 1)
{
- args[1:(length(args) - 1)] <- paste0(args[1:(length(args) - 1)], ",")
+ args[1:(length(args) - 1)] <- paste0(args[1:(length(args) - 1)], ",")
}
args[1] <- paste0(prependAtStart, args[1])
}
args[1] <- paste0(prependAtStart, args[1])
@@
-560,12
+572,12
@@
formatArgs <- function(prependAtStart, prependToEachSplit,
argLines <- c(argLines, line)
}
argLines <- c(argLines, line)
}
-
+
argLines <- unlist(argLines)
argLinesLen <- length(argLines)
if(argLinesLen > 1)
argLines <- unlist(argLines)
argLinesLen <- length(argLines)
if(argLinesLen > 1)
- argLines[2:argLinesLen] <- paste0(prependToEachSplit, argLines[2:argLinesLen])
+ argLines[2:argLinesLen] <- paste0(prependToEachSplit, argLines[2:argLinesLen])
argLines
}
argLines
}