-
Notifications
You must be signed in to change notification settings - Fork 23
/
ds.listServersideFunctions.R
69 lines (66 loc) · 2.88 KB
/
ds.listServersideFunctions.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#' @title Server-side functions
#' @description Lists all current server-side functions
#' @details Uses \code{\link{datashield.methods}} function from \code{DSI} package to list all
#' assign and aggregate functions on the available data repository servers.
#' The only choice of arguments is in \code{datasources}; i.e. which studies to interrogate.
#' Once the studies have
#' been selected \code{ds.listServersideFunctions} lists all assign functions for all
#' of these studies and then all aggregate functions for all of them.
#'
#' This function does not call any server-side function.
#' @param datasources a list of \code{\link{DSConnection-class}} objects obtained after login.
#' If the \code{datasources} argument is not specified
#' the default set of connections will be used: see \code{\link{datashield.connections_default}}.
#' @return \code{ds.listServersideFunctions} returns to the client-side
#' a list containing all server-side functions separately for each study.
#' Firstly lists assign and then aggregate functions.
#' @examples
#' \dontrun{
#'
#' ## Version 6, for version 5 see Wiki
#' # Connecting to the Opal servers
#'
#' require('DSI')
#' require('DSOpal')
#' require('dsBaseClient')
#'
#' builder <- DSI::newDSLoginBuilder()
#' builder$append(server = "study1",
#' url = "http://192.168.56.100:8080/",
#' user = "administrator", password = "datashield_test&",
#' table = "CNSIM.CNSIM1", driver = "OpalDriver")
#' builder$append(server = "study2",
#' url = "http://192.168.56.100:8080/",
#' user = "administrator", password = "datashield_test&",
#' table = "CNSIM.CNSIM2", driver = "OpalDriver")
#' builder$append(server = "study3",
#' url = "http://192.168.56.100:8080/",
#' user = "administrator", password = "datashield_test&",
#' table = "CNSIM.CNSIM3", driver = "OpalDriver")
#' logindata <- builder$build()
#'
#' # Log onto the remote Opal training servers
#' connections <- DSI::datashield.login(logins = logindata, assign = TRUE, symbol = "D")
#'
#' # List server-side functions
#'
#' ds.listServersideFunctions(datasources = connections)
#'
#' # Clear the Datashield R sessions and logout
#' datashield.logout(connections)
#' }
#' @author DataSHIELD Development Team
#' @export
#' @import DSI
ds.listServersideFunctions<-function(datasources=NULL){
.Deprecated("DSI::datashield.methods")
# look for DS connections
if(is.null(datasources)){
datasources <- datashield.connections_find()
}
assign.funs <- DSI::datashield.methods(datasources, 'assign')
aggregate.funs <- DSI::datashield.methods(datasources, 'aggregate')
return(list(serverside.assign.functions=assign.funs,
serverside.aggregate.functions=aggregate.funs))
}
#ds.listServersideFunctions