Commit 565ca24b authored by jml's avatar jml
Browse files

typo url instead of server

parent 3a37fe17
......@@ -2,30 +2,30 @@
#' alapur
#'
#' alapur
#' @param server server IP adress
#' @param url url IP adress
#' @keywords alapur
#' @export
#' @examples
#' \dontrun{
#' alapur()
#' }
alapur <- function(server){
alapur_object(server=server)
alapur <- function(url){
alapur_object(url=url)
}
alapur_object <- function(server){
alapur_object <- function(url){
server_ <- server
url_ <- url
object <- local({
get <- function(api,pkgname=NULL,key=NULL,epoint=NULL,object=NULL,format=NULL,filename=NULL,res_path=NULL,...){
res <- alapu_get(server=server_,api=api,pkgname=pkgname,key=key,epoint=epoint,object=object,format=format,filename=filename,res_path=res_path,...)
res <- alapu_get(url=url_,api=api,pkgname=pkgname,key=key,epoint=epoint,object=object,format=format,filename=filename,res_path=res_path,...)
return(res)
}
post <- function(api,pkgname=NULL,key=NULL,epoint=NULL,object=NULL,format=NULL,filename=NULL,...){
res <- alapu_post(server=server_,api=api,pkgname=pkgname,key=key,epoint=epoint,object=object,format=format,filename=filename,...)
res <- alapu_post(url=url_,api=api,pkgname=pkgname,key=key,epoint=epoint,object=object,format=format,filename=filename,...)
return(res)
}
......
#' endpoints_alapu
#' endpoints_alapu
#' @param server server IP adress
#' @param url url IP adress
#' @param api api endpoint
#' @param pkgname pkgname
#' @param key session key
......@@ -15,13 +15,13 @@
#' \dontrun{
#' endpoints_alapu()
#' }
endpoints_alapu <- function(server,api=c("package","session"),pkgname=NULL,key=NULL,epoint=NULL,object=NULL,format=NULL,filename=NULL){
endpoints_alapu <- function(url,api=c("package","session"),pkgname=NULL,key=NULL,epoint=NULL,object=NULL,format=NULL,filename=NULL){
api <- match.arg(api,c("package","session"))
res <- switch(api,
"package" = endpoints_package(server=server,pkgname=pkgname,epoint=epoint,object=object,format=format),
"session" = endpoints_session(server=server,key=key,epoint=epoint,object=object,format=format,filename=filename),
"package" = endpoints_package(url=url,pkgname=pkgname,epoint=epoint,object=object,format=format),
"session" = endpoints_session(url=url,key=key,epoint=epoint,object=object,format=format,filename=filename),
stop("endpoints not recognized"))
class(res) <- "alapu_endpoints"
......@@ -32,7 +32,7 @@ endpoints_alapu <- function(server,api=c("package","session"),pkgname=NULL,key=N
#' endpoints_package
#' endpoints_package
#' @param server server IP adress
#' @param url url IP adress
#' @param pkgname pkgname
#' @param epoint endpoint
#' @param object object
......@@ -43,7 +43,7 @@ endpoints_alapu <- function(server,api=c("package","session"),pkgname=NULL,key=N
#' \dontrun{
#' endpoints_package()
#' }
endpoints_package <- function(server,pkgname=NULL,epoint=NULL,object=NULL,format=NULL){
endpoints_package <- function(url,pkgname=NULL,epoint=NULL,object=NULL,format=NULL){
if (is.null(pkgname) || is.null(epoint)) {
stop("argument 'pkgname' and 'epoint' required")
......@@ -60,12 +60,12 @@ endpoints_package <- function(server,pkgname=NULL,epoint=NULL,object=NULL,format
}
res <- switch(epoint,
"info" = alapu_url(server,"library",pkgname,"info"),
"www" = alapu_url(server,"library",pkgname,"www"),
"R" = alapu_url(server,"library",pkgname,"R",object=object,format=format),
"data" = alapu_url(server,"library",pkgname,"data",object=object,format=format),
"man" = alapu_url(server,"library",pkgname,"man",object=object,format=format),
"html" = alapu_url(server,"library",pkgname,"html"),
"info" = alapu_url(url,"library",pkgname,"info"),
"www" = alapu_url(url,"library",pkgname,"www"),
"R" = alapu_url(url,"library",pkgname,"R",object=object,format=format),
"data" = alapu_url(url,"library",pkgname,"data",object=object,format=format),
"man" = alapu_url(url,"library",pkgname,"man",object=object,format=format),
"html" = alapu_url(url,"library",pkgname,"html"),
stop("epoint unknown ",epoint)
)
......@@ -77,7 +77,7 @@ endpoints_package <- function(server,pkgname=NULL,epoint=NULL,object=NULL,format
#' endpoints_session
#' endpoints_session
#' @param server server IP adress
#' @param url url IP adress
#' @param key session key
#' @param epoint endpoint
#' @param object object
......@@ -89,7 +89,7 @@ endpoints_package <- function(server,pkgname=NULL,epoint=NULL,object=NULL,format
#' \dontrun{
#' endpoints_session()
#' }
endpoints_session <- function(server,key=NULL,epoint=NULL,object=NULL,format=NULL,filename=NULL){
endpoints_session <- function(url,key=NULL,epoint=NULL,object=NULL,format=NULL,filename=NULL){
if (is.null(key) || is.null(epoint)) {
stop("argument 'key' and 'epoint' required")
......@@ -114,15 +114,15 @@ endpoints_session <- function(server,key=NULL,epoint=NULL,object=NULL,format=NUL
}
res <- switch(epoint,
"-" = alapu_url(server,"tmp",key),
"R" = alapu_url(server,"tmp",key,"R",object=object,format=format),
"graphics" = alapu_url(server,"tmp",key,"graphics"),
"source" = alapu_url(server,"tmp",key,"source"),
"stdout" = alapu_url(server,"tmp",key,"stdout"),
"console" = alapu_url(server,"tmp",key,"console"),
"zip" = alapu_url(server,"tmp",key,"zip"),
"tar" = alapu_url(server,"tmp",key,"tar"),
"files" = alapu_url(server,"tmp",key,"files",filename=filename),
"-" = alapu_url(url,"tmp",key),
"R" = alapu_url(url,"tmp",key,"R",object=object,format=format),
"graphics" = alapu_url(url,"tmp",key,"graphics"),
"source" = alapu_url(url,"tmp",key,"source"),
"stdout" = alapu_url(url,"tmp",key,"stdout"),
"console" = alapu_url(url,"tmp",key,"console"),
"zip" = alapu_url(url,"tmp",key,"zip"),
"tar" = alapu_url(url,"tmp",key,"tar"),
"files" = alapu_url(url,"tmp",key,"files",filename=filename),
stop("epoint unknown ",epoint)
)
......
#' alapu_url
#' alapu_url
#' @param server server IP adress
#' @param ... other parameters
#' @param url url IP adress
#' @param ... other parameters
#' @keywords alapu
#' @export
#' @examples
#' \dontrun{
#' alapu_url()
#' }
alapu_url <- function(server,...){
alapu_url <- function(url,...){
param <- c(as.list(environment()), list(...))
indice <- which(unlist(lapply(param,is.null)))
if (length(indice)) {
......
#' alapu_post
#' alapu_post
#' @param server server IP adress
#' @param url url IP adress
#' @param api api endpoint
#' @param pkgname pkgname
#' @param key session
......@@ -16,9 +16,9 @@
#' \dontrun{
#' alapu_post()
#' }
alapu_post <- function(server,api,pkgname=NULL,key=NULL,epoint=NULL,object=NULL,format=NULL,filename=NULL,...){
alapu_post <- function(url,api,pkgname=NULL,key=NULL,epoint=NULL,object=NULL,format=NULL,filename=NULL,...){
url <- endpoints_alapu(server=server,api=api,pkgname=pkgname,key=key,epoint=epoint,object=object,format=format,filename=filename)
url <- endpoints_alapu(url=url,api=api,pkgname=pkgname,key=key,epoint=epoint,object=object,format=format,filename=filename)
res <- httr::POST(url,body=list(...),encode = "json")
class(res) <- c("alapu_post_res",class(res))
return(res)
......@@ -27,7 +27,7 @@ alapu_post <- function(server,api,pkgname=NULL,key=NULL,epoint=NULL,object=NULL,
#' alapu_get
#' alapu_get
#' @param server server IP adress
#' @param url url IP adress
#' @param api api endpoint
#' @param pkgname pkgname
#' @param key session
......@@ -43,9 +43,9 @@ alapu_post <- function(server,api,pkgname=NULL,key=NULL,epoint=NULL,object=NULL,
#' \dontrun{
#' alapu_get()
#' }
alapu_get <- function(server,api,pkgname=NULL,key=NULL,epoint=NULL,object=NULL,format=NULL,filename=NULL,res_path=NULL,...){
alapu_get <- function(url,api,pkgname=NULL,key=NULL,epoint=NULL,object=NULL,format=NULL,filename=NULL,res_path=NULL,...){
url <- endpoints_alapu(server=server,api=api,pkgname=pkgname,key=key,epoint=epoint,object=object,format=format,filename=filename)
url <- endpoints_alapu(url=url,api=api,pkgname=pkgname,key=key,epoint=epoint,object=object,format=format,filename=filename)
if (is.null(res_path)) {
res <- httr::GET(url,...)
} else if (!is.null(res_path)) {
......
......@@ -5,11 +5,11 @@
\title{alapu_get
alapu_get}
\usage{
alapu_get(server, api, pkgname = NULL, key = NULL, epoint = NULL,
alapu_get(url, api, pkgname = NULL, key = NULL, epoint = NULL,
object = NULL, format = NULL, filename = NULL, res_path = NULL, ...)
}
\arguments{
\item{server}{server IP adress}
\item{url}{url IP adress}
\item{api}{api endpoint}
......
......@@ -5,11 +5,11 @@
\title{alapu_post
alapu_post}
\usage{
alapu_post(server, api, pkgname = NULL, key = NULL, epoint = NULL,
alapu_post(url, api, pkgname = NULL, key = NULL, epoint = NULL,
object = NULL, format = NULL, filename = NULL, ...)
}
\arguments{
\item{server}{server IP adress}
\item{url}{url IP adress}
\item{api}{api endpoint}
......
......@@ -5,10 +5,10 @@
\title{alapu_url
alapu_url}
\usage{
alapu_url(server, ...)
alapu_url(url, ...)
}
\arguments{
\item{server}{server IP adress}
\item{url}{url IP adress}
\item{...}{other parameters}
}
......
......@@ -4,10 +4,10 @@
\alias{alapur}
\title{alapur}
\usage{
alapur(server)
alapur(url)
}
\arguments{
\item{server}{server IP adress}
\item{url}{url IP adress}
}
\description{
alapur
......
......@@ -5,12 +5,12 @@
\title{endpoints_alapu
endpoints_alapu}
\usage{
endpoints_alapu(server, api = c("package", "session"), pkgname = NULL,
endpoints_alapu(url, api = c("package", "session"), pkgname = NULL,
key = NULL, epoint = NULL, object = NULL, format = NULL,
filename = NULL)
}
\arguments{
\item{server}{server IP adress}
\item{url}{url IP adress}
\item{api}{api endpoint}
......
......@@ -5,11 +5,11 @@
\title{endpoints_package
endpoints_package}
\usage{
endpoints_package(server, pkgname = NULL, epoint = NULL, object = NULL,
endpoints_package(url, pkgname = NULL, epoint = NULL, object = NULL,
format = NULL)
}
\arguments{
\item{server}{server IP adress}
\item{url}{url IP adress}
\item{pkgname}{pkgname}
......
......@@ -5,11 +5,11 @@
\title{endpoints_session
endpoints_session}
\usage{
endpoints_session(server, key = NULL, epoint = NULL, object = NULL,
endpoints_session(url, key = NULL, epoint = NULL, object = NULL,
format = NULL, filename = NULL)
}
\arguments{
\item{server}{server IP adress}
\item{url}{url IP adress}
\item{key}{session key}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment