### List Application Deployments - R Usage Example Source: https://rstudio.github.io/rsconnect/reference/deployments Example usage of the deployments() function showing how to filter deployments by specific account. Demonstrates querying deployments for a specific directory using the abc account filter. The example is wrapped in conditional FALSE block to prevent execution during package checking. ```r if (FALSE) { # \dontrun{ # Return all deployments of the ~/r/myapp directory made with the 'abc' # account deployments("~/r/myapp", accountFilter="abc") } # } ``` -------------------------------- ### Example: Terminate ShinyApps application in R Source: https://rstudio.github.io/rsconnect/reference/terminateApp Practical example demonstrating terminateApp usage with a sample application name. Shows basic function call pattern for terminating deployed applications. Example is wrapped in if(FALSE) for documentation and requires modification for actual use. ```r if (FALSE) { # \dontrun{ # terminate an application terminateApp("myapp") } # } ``` -------------------------------- ### Gather files to bundle with an app using listDeploymentFiles (R) Source: https://rstudio.github.io/rsconnect/reference/listDeploymentFiles Provides example usage of listDeploymentFiles from the rsconnect package. It demonstrates calling the function with default arguments to collect all deployable files from the app directory, handling optional file specifications and error reporting. No additional dependencies are required beyond the rsconnect package. ```R listDeploymentFiles( appDir, appFiles = NULL, appFileManifest = NULL, error_call = caller_env() ) ``` -------------------------------- ### Configure rsconnect HTTP and Trace Options Source: https://rstudio.github.io/rsconnect/reference/options These examples demonstrate how to configure rsconnect package options to control HTTP communication methods and enable tracing of HTTP requests and verbose output. This is useful for debugging connection issues or monitoring network activity during deployments. ```R if (FALSE) { # \dontrun{ # use curl for http connections options(rsconnect.http = "curl") # trace http requests options(rsconnect.http.trace = TRUE) # print verbose output for http requests options(rsconnect.http.verbose = TRUE) } ``` -------------------------------- ### Get server details with rsconnect::serverInfo Source: https://rstudio.github.io/rsconnect/reference/servers Shows how to use `serverInfo()` to obtain a list containing the name, URL, and certificate of a specified server. Supply the server name as a string argument. ```R serverInfo("shinyapps.io") ``` -------------------------------- ### Configure Remote Package Repositories with options() Source: https://rstudio.github.io/rsconnect/reference/appDependencies This code snippet demonstrates how to configure remote package repositories using the `options()` function in R. It sets up a custom repository named 'CORPORATE' in addition to the default 'CRAN' repository. This is useful for managing packages installed from specific, non-CRAN sources during application deployment. ```r options( repos = c( CRAN = "https://cran.rstudio.com/", CORPORATE = "https://corporate-packages.development.company.com/" ) ) ``` -------------------------------- ### Register Posit Connect Account Interactively Source: https://rstudio.github.io/rsconnect/reference/connectApiUser Connects to a Posit Connect server via an interactive browser session. It allows for easy authentication and supports launching the default web browser after the app starts. The `quiet` argument controls message display. ```R connectUser( account = NULL, server = NULL, quiet = FALSE, launch.browser = getOption("rsconnect.launch.browser", interactive()) ) ``` -------------------------------- ### Add Custom R Linter Source: https://rstudio.github.io/rsconnect/reference/addLinter Adds a custom linter to rsconnect by providing a name and a linter object. The linter object must include apply, takes, message, and suggest functions. The example creates a linter that identifies lines with capital letters in R files, generates appropriate messages, and provides suggestions. ```R addLinter("no.capitals", linter( ## Identify lines containing capital letters -- either by name or by index apply = function(content, ...) { grep("[A-Z]", content) }, ## Only use this linter on R files (paths ending with .r or .R) takes = function(paths) { grep("[rR]$", paths) }, # Use the default message constructor message = function(content, lines, ...) { makeLinterMessage("Capital letters found on the following lines", content, lines) }, # Give a suggested prescription suggest = "Do not use capital letters in these documents." )) ``` -------------------------------- ### Deploy R Markdown or quarto website using deploySite Source: https://rstudio.github.io/rsconnect/reference/deploySite The deploySite function deploys R Markdown or quarto websites to Posit Connect, Posit Connect Cloud, or ShinyApps servers. It supports three rendering modes: uploading static content, rendering locally before upload, or rendering on the server. The function accepts numerous parameters for configuring deployment behavior, authentication, and dependency management. ```r deploySite( siteDir = getwd(), siteName = NULL, siteTitle = NULL, account = NULL, server = NULL, render = c("none", "local", "server"), launch.browser = getOption("rsconnect.launch.browser", interactive()), logLevel = c("normal", "quiet", "verbose"), lint = FALSE, metadata = list(), python = NULL, recordDir = NULL, ... ) ``` -------------------------------- ### Deploy a single document (R) Source: https://rstudio.github.io/rsconnect/reference/deployDoc Deploys a single R Markdown, Quarto document, or other file. Automatically discovers dependencies when deploying .Rmd or .Qmd, and includes an .Rprofile if present. Use this function to deploy individual documents without manually specifying app details. ```R deployDoc("my-report.Rmd") deployDoc("static-file.html") ``` -------------------------------- ### Deploying R Applications with deployApp() Source: https://rstudio.github.io/rsconnect/reference/deployApp The deployApp() function deploys R-based applications like Shiny apps or Quarto sites to RStudio Connect servers, reusing deployment records for subsequent updates. It requires the rsconnect package and an authenticated account; inputs include app directory, name, title, server, and environment variables; outputs a deployed app with optional browser launch. Limitations include needing write permissions for existing apps and manual rediscovery if records are lost. ```R if (FALSE) { # \dontrun{ # deploy the application in the current working dir deployApp() # deploy an application in another directory deployApp("~/projects/shiny/app1") # deploy using an alternative application name and title deployApp("~/projects/shiny/app1", appName = "myapp", appTitle = "My Application") # deploy specifying an explicit account name, then # redeploy with no arguments (will automatically use # the previously specified account) deployApp(account = "jsmith") deployApp() # deploy but don't launch a browser when completed deployApp(launch.browser = FALSE) # deploy a Quarto website, using the quarto package to # find the Quarto binary deployApp("~/projects/quarto/site1") # deploy application with environment variables # (e.g., `SECRET_PASSWORD=XYZ` is set via an ~/.Renviron file) rsconnect::deployApp(envVars = c("SECRET_PASSWORD")) } # } ``` -------------------------------- ### Deploy R Application with rsconnect Source: https://rstudio.github.io/rsconnect/reference/deployApp Deploys a Shiny application, RMarkdown document, Plumber API, or HTML content to a supported server using the `deployApp` function from the rsconnect package. It handles application directory, files, name, and server configuration. It also supports environment variables and Python environment management. ```r deployApp( appDir = getwd(), appFiles = NULL, appFileManifest = NULL, appPrimaryDoc = NULL, appSourceDoc = NULL, appName = NULL, appTitle = NULL, envVars = NULL, appId = NULL, appMode = NULL, contentCategory = NULL, account = NULL, server = NULL, upload = TRUE, recordDir = NULL, launch.browser = getOption("rsconnect.launch.browser", is_interactive()), on.failure = NULL, logLevel = c("normal", "quiet", "verbose"), lint = TRUE, metadata = list(), forceUpdate = NULL, python = NULL, forceGeneratePythonEnvironment = FALSE, quarto = NA, appVisibility = NULL, image = NULL, envManagement = NULL, envManagementR = NULL, envManagementPy = NULL ) ``` -------------------------------- ### List Deployed Applications Source: https://rstudio.github.io/rsconnect/reference/applications Lists all applications currently deployed for a given account on RStudio Connect. Supports all servers. ```APIDOC ## GET /applications ### Description Lists all applications currently deployed for a given account. ### Method GET ### Endpoint `/applications` ### Parameters #### Query Parameters - **account** (string) - Optional - The account name to list applications for. - **server** (string) - Optional - The server name to list applications for. ### Response #### Success Response (200) - **id** (string) - Unique ID of the application. - **name** (string) - Name of the application. - **title** (string) - Title of the application. - **url** (string) - URL where the application can be accessed. - **status** (string) - Current status of the application. Valid values are `pending`, `deploying`, `running`, `terminating`, and `terminated`. - **size** (string) - Instance size (e.g., small, medium, large) (on ShinyApps.io). - **instances** (integer) - Number of instances (on ShinyApps.io). - **config_url** (string) - URL where the application can be configured. #### Response Example ```json [ { "id": "a1b2c3d4e5f6789012345678", "name": "my-shiny-app", "title": "My Shiny Application", "url": "https://your-connect-server.com/content/a1b2c3d4e5f6789012345678/", "status": "running", "size": "medium", "instances": 1, "config_url": "https://your-connect-server.com/__/edit/content/a1b2c3d4e5f6789012345678" } ] ``` ``` -------------------------------- ### List Deployed Applications (R) Source: https://rstudio.github.io/rsconnect/reference/applications Lists all applications currently deployed for a given account on supported servers. It takes optional 'account' and 'server' arguments to filter the results. Returns a data frame containing application ID, name, title, URL, status, and configuration URL. ```r applications(account = NULL, server = NULL) ``` ```r if (FALSE) { # \dontrun{ # list all applications for the default account applications() # list all applications for a specific account applications("myaccount") # view the list of applications in the data viewer View(applications()) } # } ``` -------------------------------- ### Show Application Properties (R) Source: https://rstudio.github.io/rsconnect/reference/showProperties Displays properties of an application deployed to ShinyApps servers. It takes the application path, name, account, and server as arguments. This function is specifically designed for ShinyApps servers. ```r showProperties( appPath = getwd(), appName = NULL, account = NULL, server = NULL ) ``` -------------------------------- ### configureApp Function Usage in R Source: https://rstudio.github.io/rsconnect/reference/configureApp The configureApp function configures an application on a ShinyApps server by setting options such as redeployment, instance size, and logging level. It depends on the rsconnect package and requires an app name; optional parameters include account, server, and directory (defaults to current working directory). Inputs are function arguments; outputs modify the application configuration remotely. Limitation: Works only with ShinyApps servers. ```R configureApp( appName, appDir = getwd(), account = NULL, server = NULL, redeploy = TRUE, size = NULL, instances = NULL, logLevel = c("normal", "quiet", "verbose") ) ``` ```R if (FALSE) { # \dontrun{ # set instance size for an application configureApp("myapp", size="xlarge") } # } ``` -------------------------------- ### R: writeManifest() Function Source: https://rstudio.github.io/rsconnect/reference/writeManifest The `writeManifest()` function generates a manifest.json file, crucial for Git-Backed content on Posit Connect. It bundles app files, handles dependencies, and can be customized with various arguments like app directory, file lists, and Python environment settings. It is essential to re-run this after any change in app files or dependencies. ```R writeManifest( appDir = getwd(), appFiles = NULL, appFileManifest = NULL, appPrimaryDoc = NULL, appMode = NULL, contentCategory = NULL, python = NULL, forceGeneratePythonEnvironment = FALSE, quarto = NA, image = NULL, envManagement = NULL, envManagementR = NULL, envManagementPy = NULL, verbose = FALSE, quiet = FALSE ) ``` -------------------------------- ### List App Dependencies with rsconnect Source: https://rstudio.github.io/rsconnect/reference/appDependencies Demonstrates how to list the dependencies for an R application using the `appDependencies()` function from the rsconnect package. This function can analyze dependencies for the current directory or a specified path. ```r if (FALSE) { # \dontrun{ # dependencies for the app in the current working dir appDependencies() # dependencies for an app in another directory appDependencies("~/projects/shiny/app1") } # } ``` -------------------------------- ### Display and Retrieve Application Logs (R) Source: https://rstudio.github.io/rsconnect/reference/showLogs Provides R functions to display or retrieve log entries for applications deployed on ShinyApps.io. `showLogs()` displays logs directly, while `getLogs()` returns them as a data frame. These functions utilize the libcurl transport and are specific to ShinyApps.io. ```R showLogs( appPath = getwd(), appFile = NULL, appName = NULL, account = NULL, server = NULL, entries = 50, streaming = FALSE ) getLogs( appPath = getwd(), appFile = NULL, appName = NULL, account = NULL, server = NULL, entries = 50 ) ``` -------------------------------- ### Adding and Managing Posit Connect Servers in R Source: https://rstudio.github.io/rsconnect/reference/addServer The addServer() function registers a Posit Connect server by URL, optionally with a name and certificate, validating the connection if specified. removeServer() deletes a registered server by name, and addServerCertificate() adds a certificate to an existing server. These functions require the rsconnect package and work with Posit Connect URLs; inputs include server details, outputs update the server registry, with limitations on non-Posit Connect servers. ```R addServer( url, name = NULL, certificate = NULL, validate = TRUE, snowflakeConnectionName = NULL, quiet = FALSE ) removeServer(name = NULL) addServerCertificate(name, certificate, quiet = FALSE) ``` ```R if (FALSE) { # \dontrun{ # register a local server addServer("http://myrsconnect/", "myserver") # list servers servers(local = TRUE) # connect to an account on the server connectUser(server = "myserver") } # } ``` -------------------------------- ### Upload a file to RPubs using R Source: https://rstudio.github.io/rsconnect/reference/rpubsUpload The rpubsUpload function publishes a file to rpubs.com. It returns a list with an 'id' and 'continueUrl' upon success, or an 'error' message upon failure. Requires the 'rsconnect' package. The continueUrl should be opened in a browser to complete publishing. ```r rpubsUpload(title, contentFile, originalDoc, id = NULL, properties = list()) ``` ```r if (FALSE) { # \dontrun{ # upload a document result <- rpubsUpload("My document title", "Document.html") if (!is.null(result$continueUrl)) browseURL(result$continueUrl) else stop(result$error) # update the same document with a new title updateResult <- rpubsUpload("My updated title", "Document.html", id = result$id) } # } ``` -------------------------------- ### deployments() - List Application Deployments Source: https://rstudio.github.io/rsconnect/reference/deployments This endpoint describes how to use the deployments() function to list deployment records. It supports filtering by app path, name, account, and server. This function is useful for managing and monitoring deployed applications. ```APIDOC ## List Application Deployments ### Description List deployment records for a given application. ### Method Function ### Endpoint `deployments(appPath = ".", nameFilter = NULL, accountFilter = NULL, serverFilter = NULL, excludeOrphaned = TRUE)` ### Parameters #### Path Parameters - **appPath** (character) - Required - The path to the content that was deployed, either a directory or an individual document. #### Query Parameters - **nameFilter** (character) - Optional - Return only deployments matching the given name. - **accountFilter** (character) - Optional - Return only deployments matching the given account. - **serverFilter** (character) - Optional - Return only deployments matching the given server. - **excludeOrphaned** (logical) - Optional - If `TRUE` (the default), return only deployments made by a currently registered account. #### Request Body - None ### Request Example ```R deployments("~/r/myapp", accountFilter="abc") ``` ### Response #### Success Response (data frame) - **name** (character) - Name of deployed application - **account** (character) - Account owning deployed application - **bundleId** (character) - Identifier of deployed application's bundle - **url** (character) - URL of deployed application - **deploymentFile** (character) - Name of configuration file Additional columns may be present if metadata was saved with the deployment record. #### Response Example ```R # A data frame containing deployment information # (example) # name account bundleId url deploymentFile # 1 myapp abc 1234567890 http://example.com/myapp myapp.yml ``` ## See also `applications()` to get a list of deployments from the server, and `deployApp()` to create a new deployment. ``` -------------------------------- ### Register Posit Connect Account in Snowpark Container Services (R) Source: https://rstudio.github.io/rsconnect/reference/connectSPCSUser The `connectSPCSUser` function registers your Posit Connect account with the rsconnect package for deploying and managing applications. It requires Snowflake authentication and a Posit Connect API key, configured via a `connections.toml` file. Supported servers include Posit Connect. ```r connectSPCSUser( account = NULL, server = NULL, apiKey, snowflakeConnectionName, quiet = FALSE ) ``` -------------------------------- ### Show Application Metrics (R) Source: https://rstudio.github.io/rsconnect/reference/showMetrics The showMetrics function retrieves and displays application metrics from ShinyApps servers. It requires specifying metric series, metric names, and optionally, the application directory, name, account, server, date range, and summarization interval. ```R showMetrics( metricSeries, metricNames, appDir = getwd(), appName = NULL, account = NULL, server = "shinyapps.io", from = NULL, until = NULL, interval = NULL ) ``` -------------------------------- ### List Application Deployments - R Function Definition Source: https://rstudio.github.io/rsconnect/reference/deployments Function definition for deployments() that lists deployment records for R applications. Supports filtering by app path, account name, server, and excludes orphaned deployments by default. Returns a data frame with deployment metadata including name, account, bundle ID, URL, and configuration file. ```r deployments( appPath = ".", nameFilter = NULL, accountFilter = NULL, serverFilter = NULL, excludeOrphaned = TRUE ) ``` -------------------------------- ### Load rsconnect Package in R Source: https://rstudio.github.io/rsconnect/articles/custom-http Loads the rsconnect library into the R session. This is a prerequisite for using any rsconnect functionalities. ```r library(rsconnect) ``` -------------------------------- ### Restart Application using rsconnect in R Source: https://rstudio.github.io/rsconnect/reference/restartApp The `restartApp` function in the rsconnect package allows you to restart applications deployed on ShinyApps servers. It requires the application name as input and optionally accepts account and server details for clarity and to specify the target environment. This function supports only ShinyApps servers. ```R restartApp(appName = "myapp") ``` ```R restartApp(appName = "myapp", account = NULL, server = NULL, quiet = FALSE) ``` -------------------------------- ### Show Application Usage Source: https://rstudio.github.io/rsconnect/reference/showUsage Retrieves usage data for a deployed application on ShinyApps servers. This function allows specifying date ranges and summarization intervals. ```APIDOC ## Show Application Usage ### Description Retrieves usage data for a deployed application on ShinyApps servers. This function allows specifying date ranges and summarization intervals. ### Method GET (Implicit - this is an R function call, not a direct HTTP endpoint) ### Endpoint N/A (Function call within R) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```R showUsage(appDir = "/path/to/app", appName = "my_shiny_app", server = "shinyapps.io", usageType = "users", from = "2d", until = "now", interval = "1h") ``` ### Response #### Success Response (Implicit - Returns a data frame or similar structure) - **usage_data** (data.frame) - Contains the application usage metrics. #### Response Example ```R # Example data frame structure # timestamp | users | sessions # ------------------------------- # 1678886400 | 150 | 300 # 1678890000 | 165 | 320 ``` ## Arguments `appDir` Directory containing application. Defaults to current working directory. `appName` Name of application `account`, `server` Uniquely identify a remote server with either your user `account`, the `server` name, or both. If neither are supplied, and there are multiple options, you'll be prompted to pick one. Use `accounts()` to see the full list of available options. `usageType` Use metric to retrieve (for example: "hours", "users", "sessions"). `from` Date range starting timestamp (Unix timestamp or relative time delta such as "2d" or "3w"). `until` Date range ending timestamp (Unix timestamp or relative time delta such as "2d" or "3w"). `interval` Summarization interval. Data points at intervals less then this will be grouped. (Relative time delta e.g. "120s" or "1h" or "30d"). ## Note This function only works for ShinyApps servers. ``` -------------------------------- ### List Account Environment Variables (R) Source: https://rstudio.github.io/rsconnect/reference/listAccountEnvVars Lists the environment variables used by applications published to a specified account on a Posit Connect server. Returns a data frame with application details and their environment variables. Requires the 'rsconnect' package. ```r listAccountEnvVars(server = NULL, account = NULL) ``` -------------------------------- ### Create Linter in R Source: https://rstudio.github.io/rsconnect/reference/linter The `linter` function allows creation of custom linters for project analysis. It requires four arguments: `apply` (to identify errors), `takes` (to select relevant files), `message` (to inform the user), and `suggestion` (to suggest fixes). ```R linter(apply, takes, message, suggestion) ``` ```R addLinter("no.capitals", linter( apply = function(content, ...) { grep("[A-Z]", content) }, takes = function(paths) { grep("[rR]$", paths) }, message = function(content, lines, ...) { makeLinterMessage("Capital letters found on the following lines", content, lines) }, suggest = "Do not use capital letters in these documents.") ) ``` -------------------------------- ### Show Invited Users for a ShinyApps Application (R) Source: https://rstudio.github.io/rsconnect/reference/showInvited Lists users who have been invited to an application on ShinyApps servers. It requires the application directory and optionally accepts application name, account, and server details. This function is specific to ShinyApps servers. ```r showInvited(appDir = getwd(), appName = NULL, account = NULL, server = NULL) ``` -------------------------------- ### Show Application Metrics Source: https://rstudio.github.io/rsconnect/reference/showMetrics Retrieves metrics for a deployed R application on ShinyApps servers. Allows specifying metric series, names, and time ranges. ```APIDOC ## Show Application Metrics ### Description Shows application metrics of a currently deployed application. Supported servers include ShinyApps servers. ### Method GET (implied, as it retrieves data) ### Endpoint `/sites/{site_id}/metrics` (This is a hypothetical endpoint based on typical RESTful practices for metric retrieval. The actual implementation might be within the R function itself.) ### Parameters #### Query Parameters - **metricSeries** (string) - Required - Metric series to query. Refer to the shinyapps.io documentation for available series. - **metricNames** (string) - Required - Metric names in the series to query. Refer to the shinyapps.io documentation for available metrics. - **appName** (string) - Optional - Application name, a string consisting of letters, numbers, `_` and `-`. If not specified, it's inferred from `appDir`. - **account** (string) - Optional - Your user account name for identifying the server. - **server** (string) - Optional - The name of the server (e.g., "shinyapps.io"). - **from** (timestamp or relative time delta) - Optional - Date range starting timestamp (e.g., "2d", "3w"). - **until** (timestamp or relative time delta) - Optional - Date range ending timestamp (e.g., "2d", "3w"). - **interval** (relative time delta) - Optional - Summarization interval (e.g., "120s", "1h", "30d"). #### Path Parameters - **appDir** (string) - Optional - A directory containing an application. Defaults to the current directory. ### Request Example (This function is called from R, so a direct HTTP request example is not applicable. The R function signature is provided.) ```R showMetrics( metricSeries = "requests", metricNames = c("count", "avg_size"), appName = "my_shiny_app", server = "shinyapps.io", from = "3d", interval = "1h" ) ``` ### Response #### Success Response (200) - **metrics** (list) - A list containing the retrieved metrics data, typically structured by time series and metric names. #### Response Example (The exact structure depends on the `metricSeries` and `metricNames` queried. Below is a hypothetical example.) ```json { "metrics": { "requests": { "count": [ {"timestamp": 1678886400, "value": 150}, {"timestamp": 1678890000, "value": 180} ], "avg_size": [ {"timestamp": 1678886400, "value": 10240}, {"timestamp": 1678890000, "value": 12050} ] } } } ``` ``` -------------------------------- ### List registered servers using rsconnect::servers Source: https://rstudio.github.io/rsconnect/reference/servers Demonstrates how to call `servers()` to retrieve a data frame of all known servers, optionally filtering out cloud servers with the `local` argument. Returns server names and URLs. ```R servers() ``` -------------------------------- ### Retrieve account usage metrics in R Source: https://rstudio.github.io/rsconnect/reference/accountUsage The accountUsage function fetches usage data from ShinyApps servers. It requires specifying an account or server, and supports filtering by date range and summarization interval. Only works with ShinyApps servers. ```R accountUsage( account = NULL, server = NULL, usageType = "hours", from = NULL, until = NULL, interval = NULL ) ``` -------------------------------- ### Show Application Usage Source: https://rstudio.github.io/rsconnect/reference/showUsage Retrieves usage data for a deployed Shiny application on ShinyApps servers. It accepts parameters for the application directory, name, account, server, usage type, date range, and interval. Note: This function is exclusively for ShinyApps servers. ```R showUsage( appDir = getwd(), appName = NULL, account = NULL, server = NULL, usageType = "hours", from = NULL, until = NULL, interval = NULL ) ``` -------------------------------- ### Configure ShinyApps properties - R Source: https://rstudio.github.io/rsconnect/reference/setProperty Demonstrates practical usage of setProperty to configure application settings. Shows how to set instance count and disable package caching for ShinyApps deployments. Code is wrapped in if(FALSE) for documentation purposes. ```R if (FALSE) { # \\dontrun{\n\n# set instance size for an application\nsetProperty(\"application.instances.count\", 1)\n\n# disable application package cache\nsetProperty(\"application.package.cache\", FALSE)\n\n} # } ``` -------------------------------- ### Register Posit Connect Account using API Key Source: https://rstudio.github.io/rsconnect/reference/connectApiUser Connects to a Posit Connect server using an API key for non-interactive authentication. Requires the server URL and API key. The `quiet` argument controls whether messages are displayed. ```R connectApiUser(account = NULL, server = NULL, apiKey, quiet = FALSE) ``` -------------------------------- ### Detect Application Dependencies with appDependencies() Source: https://rstudio.github.io/rsconnect/reference/appDependencies The `appDependencies()` function recursively detects all R package dependencies for an application by parsing R and Rmd files. It identifies calls to library, require, requireNamespace, and ::, and includes implicit and recursive dependencies to create a complete package manifest. It supports all deployment servers and returns a data frame detailing package name, version, source, and repository. ```r appDependencies( appDir = getwd(), appFiles = NULL, appFileManifest = NULL, appMode = NULL ) ``` -------------------------------- ### Manage rsconnect Accounts Source: https://rstudio.github.io/rsconnect/reference/accounts Provides functions to interact with registered user accounts on the local system for rsconnect. It allows listing all accounts, retrieving specific account information, and removing existing accounts. These functions are crucial for managing deployment credentials. ```R accounts(server = NULL) accountInfo(name = NULL, server = NULL) removeAccount(name = NULL, server = NULL) ``` -------------------------------- ### Set Account Info in R Source: https://rstudio.github.io/rsconnect/reference/setAccountInfo Configures a ShinyApps account for publishing. The function takes account name, token, secret, and server as arguments. This allows you to authenticate and publish your R Shiny applications. ```R setAccountInfo(name, token, secret, server = "shinyapps.io") ``` -------------------------------- ### Define setProperty function interface - R Source: https://rstudio.github.io/rsconnect/reference/setProperty Defines the function signature for setProperty used to configure ShinyApps applications. Specifies parameters for property name, value, application path, name, account, server, and force flag. Only works with ShinyApps servers. ```R setProperty(\n propertyName,\n propertyValue,\n appPath = getwd(),\n appName = NULL,\n account = NULL,\n server = NULL,\n force = FALSE\n) ``` -------------------------------- ### Set Other libcurl Options in R for rsconnect Source: https://rstudio.github.io/rsconnect/articles/custom-http Allows setting additional options for the underlying libcurl library used by rsconnect via the 'rsconnect.libcurl.options' option. This enables fine-grained control over network requests, such as specifying proxy settings directly. Refer to 'curl::curl_options()' for a full list of available options. ```r options(rsconnect.libcurl.options = list(proxy = "http://proxy.example.com")) ``` -------------------------------- ### List authorized users for ShinyApps applications using R Source: https://rstudio.github.io/rsconnect/reference/showUsers The showUsers function from the rsconnect R package retrieves authorized users for applications deployed on ShinyApps servers. It accepts parameters for application directory, name, account, and server to target specific deployments. This function exclusively supports ShinyApps servers and integrates with related functions like addAuthorizedUser() and showInvited(). ```r showUsers(appDir = getwd(), appName = NULL, account = NULL, server = NULL) ``` -------------------------------- ### Update Account Environment Variables (R) Source: https://rstudio.github.io/rsconnect/reference/listAccountEnvVars Updates specified environment variables for all applications on a given account of a Posit Connect server. The current values of the environment variables from the R process are used. Requires the 'rsconnect' package. ```r updateAccountEnvVars(envVars, server = NULL, account = NULL) ``` -------------------------------- ### List Tasks on Shinyapps.io (R) Source: https://rstudio.github.io/rsconnect/reference/tasks The 'tasks' function retrieves a data frame containing task information (ID, action, status, timestamps) from Shinyapps.io servers. It can optionally filter by account or server name. If multiple accounts are configured and neither account nor server is specified, the user will be prompted to select one. This function is specific to shinyapps.io. ```r tasks(account = NULL, server = NULL) # Example: list tasks for the default account if (FALSE) { # \dontrun{ tasks() } # } ``` -------------------------------- ### Explicitly Declare Package Dependency in R Source: https://rstudio.github.io/rsconnect/reference/appDependencies Shows how to use `requireNamespace()` to explicitly tell rsconnect that a package is required for the application to run. This is useful for packages listed in the 'Suggests' field of another package, which might otherwise be missed during dependency detection. ```r requireNamespace(hexbin) ``` -------------------------------- ### terminateApp Source: https://rstudio.github.io/rsconnect/reference/terminateApp The terminateApp function is used to terminate and archive a currently deployed ShinyApps application. It requires the application name and optionally an account and server. This function only works with ShinyApps servers and is part of the rsconnect package. ```APIDOC ## terminateApp ### Description Terminate and archive a currently deployed ShinyApps application. This function only works for ShinyApps servers. ### Method R Function ### Endpoint terminateApp(appName, account = NULL, server = NULL, quiet = FALSE) ### Parameters #### Arguments - **appName** (character) - Required - Name of application to terminate - **account** (character) - Optional - Account name. If a single account is registered on the system then this parameter can be omitted. - **server** (character) - Optional - Server name. Required only if you use the same account name on multiple servers (see servers()) - **quiet** (logical) - Optional - Request that no status information be printed to the console during the termination. ### Request Example ```r terminateApp("myapp") ``` ### Response This function does not return a structured response but performs the termination operation. See related functions like applications(), deployApp(), and restartApp(). #### Examples ```r if (FALSE) { # \dontrun{ # terminate an application terminateApp("myapp") } # } ``` ``` -------------------------------- ### Construct Linter Message with R Source: https://rstudio.github.io/rsconnect/reference/makeLinterMessage Constructs a formatted linter message. Primarily used as a helper function within the `linter()` function to create user-friendly messages about linting issues in R code. It takes a header, the file content, and specific line numbers as input. ```r makeLinterMessage(header, content, lines) ``` -------------------------------- ### Set HTTPS Proxy Environment Variable in R Source: https://rstudio.github.io/rsconnect/articles/custom-http Sets the HTTPS_PROXY environment variable to specify an HTTP proxy server. This is useful for environments that require proxy access for internet requests. The proxy URL can include authentication details. ```r Sys.setenv(https_proxy = "https://proxy.example.com") ``` -------------------------------- ### Terminate ShinyApps application using R function terminateApp Source: https://rstudio.github.io/rsconnect/reference/terminateApp Function signature for terminateApp from the rsconnect package. Terminates and archives deployed ShinyApps applications. Requires authentication with ShinyApps server and valid application name, and only supports ShinyApps.io servers. ```r terminateApp(appName, account = NULL, server = NULL, quiet = FALSE) ``` -------------------------------- ### Remove Account in R Source: https://rstudio.github.io/rsconnect/reference/setAccountInfo Removes a configured ShinyApps account. This function removes configurations and prevents the use of that account for publishing. Its a useful cleanup function. ```R removeAccount("user") ```