Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from rstudio/feature/restart-app
add restartApp function
- Loading branch information
Showing
9 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ Collate: | |
'terminateApp.R' | ||
'configureApp.R' | ||
'tasks.R' | ||
'restartApp.R' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#' Restart an Application | ||
#' | ||
#' Restart an application currently running on ShinyApps. | ||
#' @param appName Name of application to restart | ||
#' @param account Account name. If a single account is registered on the | ||
#' system then this parameter can be omitted. | ||
#' @param quiet Request that no status information be printed to the console | ||
#' during the operation. | ||
#' @examples | ||
#' \dontrun{ | ||
#' | ||
#' # restart an application | ||
#' restartApp("myapp") | ||
#' } | ||
#' @seealso \code{\link{applications}}, \code{\link{deployApp}}, and | ||
#' \code{\link{terminateApp}} | ||
#' @export | ||
restartApp <- function(appName, account = NULL, quiet = FALSE) { | ||
|
||
# define deploy task | ||
taskDef <- list() | ||
taskDef$beginStatus <- "Restarting application" | ||
taskDef$endStatus <- "Application successfully restarted" | ||
taskDef$action <- function(lucid, application) { | ||
lucid$deployApplication(application$id) | ||
} | ||
|
||
# perform it | ||
applicationTask(taskDef, appName, account, quiet) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
\name{restartApp} | ||
\alias{restartApp} | ||
\title{Restart an Application} | ||
\usage{ | ||
restartApp(appName, account = NULL, quiet = FALSE) | ||
} | ||
\arguments{ | ||
\item{appName}{Name of application to restart} | ||
|
||
\item{account}{Account name. If a single account is | ||
registered on the system then this parameter can be | ||
omitted.} | ||
|
||
\item{quiet}{Request that no status information be | ||
printed to the console during the operation.} | ||
} | ||
\description{ | ||
Restart an application currently running on ShinyApps. | ||
} | ||
\examples{ | ||
\dontrun{ | ||
|
||
# restart an application | ||
restartApp("myapp") | ||
} | ||
} | ||
\seealso{ | ||
\code{\link{applications}}, \code{\link{deployApp}}, and | ||
\code{\link{terminateApp}} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters