| Title: | Utilities for Interacting with the 'Posit Connect' Server API |
|---|---|
| Description: | Provides a helpful 'R6' class and methods for interacting with the 'Posit Connect' Server API along with some meaningful utility functions for regular tasks. API documentation varies by 'Posit Connect' installation and version, but the latest documentation is also hosted publicly at <https://docs.posit.co/connect/api/>. |
| Authors: | Kara Woo [aut, cre], Toph Allen [aut], Neal Richardson [aut], Sean Lopp [aut], Cole Arendt [aut], Posit, PBC [cph, fnd] |
| Maintainer: | Kara Woo <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.12.1.9000 |
| Built: | 2026-06-04 06:48:22 UTC |
| Source: | https://github.com/posit-dev/connectapi |
Convert objects to integration class
as_integration(x, client)as_integration(x, client)
x |
An object to convert to an integration. |
client |
The Connect client object where the integration comes from. |
An integration object. The object has all the fields from the
integrations endpoint (see get_integrations()) and a Connect client as a
client attribute (attr(x, "client"))
Converts a list returned by search_content() to a tibble.
## S3 method for class 'connect_content_list' as_tibble(x, ...)## S3 method for class 'connect_content_list' as_tibble(x, ...)
x |
A |
... |
Unused. |
A tibble with one row per content item.
Converts a list returned by get_integrations() to a tibble.
## S3 method for class 'connect_integration_list' as_tibble(x, ...)## S3 method for class 'connect_integration_list' as_tibble(x, ...)
x |
A |
... |
Unused. |
A tibble with one row per integration.
Converts an object returned by get_usage() to a tibble via
as.data.frame.connect_list_hits().
## S3 method for class 'connect_list_hits' as_tibble(x, ...)## S3 method for class 'connect_list_hits' as_tibble(x, ...)
x |
A |
... |
Passed to |
A tibble with one row per usage record.
Converts a list returned by search_content() into a data frame.
## S3 method for class 'connect_content_list' as.data.frame(x, row.names = NULL, optional = FALSE, ...)## S3 method for class 'connect_content_list' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
A |
row.names |
Passed to |
optional |
Passed to |
... |
Passed to |
A data.frame with one row per content item.
Converts a list returned by get_integrations() into a data frame.
## S3 method for class 'connect_integration_list' as.data.frame(x, row.names = NULL, optional = FALSE, ...)## S3 method for class 'connect_integration_list' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
A |
row.names |
Passed to |
optional |
Passed to |
... |
Passed to |
A data.frame with one row per integration.
Converts an object returned by get_usage() into a data frame with parsed
column types. By default, extracts path and user_agent from the data
field, if available.
## S3 method for class 'connect_list_hits' as.data.frame(x, row.names = NULL, optional = FALSE, ..., unnest = TRUE)## S3 method for class 'connect_list_hits' as.data.frame(x, row.names = NULL, optional = FALSE, ..., unnest = TRUE)
x |
A |
row.names |
Passed to |
optional |
Passed to |
... |
Passed to |
unnest |
Logical; if |
A data.frame with one row per usage record.
audit_access_open(content, type = "all")audit_access_open(content, type = "all")
content |
|
type |
One of "all" or "logged_in". If "all", return a list of apps whose access control is set to "Everyone". If "logged_in", return a list of apps whose access control is set to "All logged in users" |
Other audit functions:
audit_r_versions(),
audit_runas(),
vanity_is_available()
audit_r_versions(content)audit_r_versions(content)
content |
|
A plot that shows the R version used by content over time and in aggregate.
Other audit functions:
audit_access_open(),
audit_runas(),
vanity_is_available()
audit_runas(content)audit_runas(content)
content |
|
A data frame with the app name and the Run As user if the Run As user is not the default
Other audit functions:
audit_access_open(),
audit_r_versions(),
vanity_is_available()
Browse to different locations on Connect via utils::browseURL
browse_solo(content) browse_dashboard(content) browse_api_docs(connect) browse_connect(connect)browse_solo(content) browse_dashboard(content) browse_api_docs(connect) browse_connect(connect)
content |
A R6 Content object |
connect |
A R6 Connect object |
The url that is opened in the browser
An R6 class that represents a bundle
pathThe bundle path on disk.
sizeThe size of the bundle.
Bundle$new()Initialize this content bundle.
Bundle$new(path)
pathThe bundle path on disk.
Bundle$print()Print this object.
Bundle$print(...)
...Unused.
Bundle$clone()The objects of this class are cloneable with this method.
Bundle$clone(deep = FALSE)
deepWhether to make a deep clone.
Other R6 classes:
Content,
ContentTask,
Environment,
PositConnect,
Task,
Vanity,
Variant,
VariantSchedule,
VariantTask
Creates a bundle from a target directory.
bundle_dir( path = ".", filename = fs::file_temp(pattern = "bundle", ext = ".tar.gz") )bundle_dir( path = ".", filename = fs::file_temp(pattern = "bundle", ext = ".tar.gz") )
path |
The path to the directory to be bundled |
filename |
The output bundle path |
Bundle A bundle object
Other deployment functions:
bundle_path(),
bundle_static(),
deploy(),
download_bundle(),
poll_task()
bundle_dir(system.file("tests/testthat/examples/shiny/", package = "connectapi"))bundle_dir(system.file("tests/testthat/examples/shiny/", package = "connectapi"))
Define a bundle from a path (a path directly to a tar.gz file)
bundle_path(path)bundle_path(path)
path |
The path to a .tar.gz file |
Bundle A bundle object
Other deployment functions:
bundle_dir(),
bundle_static(),
deploy(),
download_bundle(),
poll_task()
bundle_path(system.file("tests/testthat/examples/static.tar.gz", package = "connectapi"))bundle_path(system.file("tests/testthat/examples/static.tar.gz", package = "connectapi"))
Defines a bundle from static files. It copies all files to a temporary directory, generates a basic manifest file (using the first file as the "primary"), and bundles the directory.
bundle_static( path, filename = fs::file_temp(pattern = "bundle", ext = ".tar.gz") )bundle_static( path, filename = fs::file_temp(pattern = "bundle", ext = ".tar.gz") )
path |
The path to a file (or files) that will be used for the static bundle |
filename |
The output bundle path |
NOTE: the rsconnect package is required for this function to work properly.
Bundle A bundle object
Other deployment functions:
bundle_dir(),
bundle_path(),
deploy(),
download_bundle(),
poll_task()
bundle_static(system.file("logo.png", package = "connectapi"))bundle_static(system.file("logo.png", package = "connectapi"))
Creates a connection to Posit Connect using the server URL and an API key. Validates the connection and checks that the version of the server is compatible with the current version of the package.
connect( server = Sys.getenv("CONNECT_SERVER"), api_key = Sys.getenv("CONNECT_API_KEY"), token, token_local_testing_key = api_key, audience = NULL, ..., .check_is_fatal = TRUE )connect( server = Sys.getenv("CONNECT_SERVER"), api_key = Sys.getenv("CONNECT_API_KEY"), token, token_local_testing_key = api_key, audience = NULL, ..., .check_is_fatal = TRUE )
server |
The URL for accessing Posit Connect. Defaults to environment variable CONNECT_SERVER |
api_key |
The API Key to authenticate to Posit Connect with. Defaults to environment variable CONNECT_API_KEY |
token |
Optional. A user session token. When running on a Connect server, creates a client using the content visitor's account. Running locally, the created client uses the provided API key. |
token_local_testing_key |
Optional. Only used when not running on
Connect and a |
audience |
Optional. The GUID of a Connect API integration associated with this piece of content. |
... |
Additional arguments. Not used at present |
.check_is_fatal |
Whether to fail if "check" requests fail. Useful in rare cases where more http request customization is needed for requests to succeed. |
When running on Connect, the client's environment will contain default
CONNECT_SERVER and CONNECT_API_KEY variables. The API key's permissions
are scoped to the publishing user's account.
To create a client with permissions scoped to the content visitor's account,
call connect() passing a user session token from content session headers
to the token argument. To do this, you must first add a Connect API
integration in your published content's Access sidebar.
A Posit Connect R6 object that can be passed along to methods
## Not run: client <- connect() # Running in Connect, create a client using the content visitor's account. # This example assumes code is being executed in a Shiny app's `server` # function with a `session` object available. token <- session$request$HTTP_POSIT_CONNECT_USER_SESSION_TOKEN client <- connect(token = token) # Test locally with an API key using a different role. fallback_key <- Sys.getenv("VIEWER_ROLE_API_KEY") client <- connect(token = token, token_local_testing_key = fallback_key) ## End(Not run) # default is to read CONNECT_SERVER and CONNECT_API_KEY environment variables connect()## Not run: client <- connect() # Running in Connect, create a client using the content visitor's account. # This example assumes code is being executed in a Shiny app's `server` # function with a `session` object available. token <- session$request$HTTP_POSIT_CONNECT_USER_SESSION_TOKEN client <- connect(token = token) # Test locally with an API key using a different role. fallback_key <- Sys.getenv("VIEWER_ROLE_API_KEY") client <- connect(token = token, token_local_testing_key = fallback_key) ## End(Not run) # default is to read CONNECT_SERVER and CONNECT_API_KEY environment variables connect()
An R6 class that represents content.
connectAn R6 Connect object.
contentThe content details from Posit Connect. Properties are described in get_content().
default_variantThe default variant for this object.
is_renderedTRUE if this is a rendered content type, otherwise FALSE.
is_interactiveTRUE if this is a rendered content type, otherwise FALSE.
Content$new()Initialize this content.
Content$new(connect, content)
connectThe Connect instance.
contentThe content data.
Content$get_content_remote()Obtain the content data from the Connect server.
Content$get_content_remote()
Content$get_bundles()Return the set of content bundles.
Content$get_bundles()
Content$bundle_download()Download the source archive for a content bundle.
Content$bundle_download( bundle_id, filename = tempfile(pattern = "bundle", fileext = ".tar.gz"), overwrite = FALSE )
bundle_idThe bundle identifer.
filenameWhere to write the result.
overwriteOverwrite an existing filename.
Content$bundle_delete()Delete a content bundle.
Content$bundle_delete(bundle_id)
bundle_idThe bundle identifer.
Content$update()Update this content item.
Content$update(...)
...Content fields.
Content$danger_delete()Delete this content item.
Content$danger_delete()
Content$get_url()Return the URL for this content.
Content$get_url()
Content$get_dashboard_url()Return the URL for this content in the Posit Connect dashboard.
Content$get_dashboard_url(pane = "")
paneThe pane in the dashboard to link to.
Content$jobs()Return the jobs for this content
Content$jobs()
Content$register_job_kill_order()Terminate a single job for this content item.
Content$register_job_kill_order(key)
keyThe job key.
Content$variants()Return the variants for this content.
Content$variants()
Content$tag_set()Set a tag for this content.
Content$tag_set(tag_id)
tag_idThe tag identifier.
Content$tag_delete()Remove a tag for this content.
Content$tag_delete(tag_id)
tag_idThe tag identifier.
Content$tags()The tags for this content.
Content$tags()
Content$permissions_add()Add a principal to the ACL for this content.
Content$permissions_add(principal_guid, principal_type, role)
principal_guidGUID for the target user or group.
principal_typeActing on user or group.
roleThe kind of content access.
Content$permissions_update()Alter a principal in the ACL for this content.
Content$permissions_update(id, principal_guid, principal_type, role)
idThe target identifier.
principal_guidGUID for the target user or group.
principal_typeActing on user or group.
roleThe kind of content access.
Content$permissions_delete()Remove an entry from the ACL for this content.
Content$permissions_delete(id)
idThe target identifier.
Content$permissions()Obtain some or all of the ACL for this content.
Content$permissions(id = NULL, add_owner = FALSE)
idThe target identifier.
add_ownerInclude the content owner in the result set.
Content$environment()Return the environment variables set for this content.
Content$environment()
Content$environment_set()Adjust the environment variables set for this content.
Content$environment_set(...)
...Environment variable names and values. Use NA as the value
to unset variables.
Content$environment_all()Overwrite the environment variables set for this content.
Content$environment_all(...)
...Environment variable names and values.
Content$deploy()Deploy this content
Content$deploy(bundle_id = NULL)
bundle_idTarget bundle identifier.
Content$repository()Get Git repository details
Content$repository()
NULL if no repo is set, otherwise a list with fields:
repository
branch
directory
polling
last_error
last_known_commit
Content$repo_enable()Adjust Git polling.
Content$repo_enable(polling = TRUE)
pollingPolling enabled.
Content$repo_set()Adjust Git repository
Content$repo_set(repository, branch = "main", directory = ".", polling = FALSE)
repositoryGit repository URL
branchGit repository branch
directoryGit repository directory
pollingWhether to check for updates
Content$packages()Get package dependencies
Content$packages()
Content$print()Print this object.
Content$print(...)
...Unused.
Content$clone()The objects of this class are cloneable with this method.
Content$clone(deep = FALSE)
deepWhether to make a deep clone.
Other R6 classes:
Bundle,
ContentTask,
Environment,
PositConnect,
Task,
Vanity,
Variant,
VariantSchedule,
VariantTask
Delete a content item. WARNING: This action deletes all history, configuration, logs, and resources about a content item. It cannot be undone.
content_delete(content, force = FALSE)content_delete(content, force = FALSE)
content |
an R6 content item |
force |
Optional. A boolean that determines whether we should prompt in interactive sessions |
The R6 Content item. The item is deleted, but information about it is cached locally
Other content functions:
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Returns a single content item based on guid
content_item(connect, guid)content_item(connect, guid)
connect |
A Connect object |
guid |
The GUID for the content item to be retrieved |
A Content object for use with other content endpoints
Other content functions:
content_delete(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: connect() %>% content_item("some-guid") %>% content_update_access_type("all") ## End(Not run)## Not run: connect() %>% content_item("some-guid") %>% content_update_access_type("all") ## End(Not run)
content_list_by_tag(src, tag)content_list_by_tag(src, tag)
src |
An R6 Connect object |
tag |
A |
content_list_by_tag() retrieves a content list by tag
These functions are experimental placeholders until the API supports
this behavior.
content_list_with_permissions(src, ..., .p = NULL) content_list_guid_has_access(content_list, guid)content_list_with_permissions(src, ..., .p = NULL) content_list_guid_has_access(content_list, guid)
src |
A Connect R6 object |
... |
Extra arguments. Currently not used |
.p |
Optional. A predicate function, passed as-is to |
content_list |
A "content list with permissions" as returned by |
guid |
A user or group GUID to filter the content list by whether they have access |
content_list_with_permissions loops through content and retrieves
permissions for each item (with a progress bar). This can take a long time
for lots of content! Make sure to use the optional .p argument as a predicate
function that filters the content list before it is transformed.
content_list_guid_has_access works with a content_list_with_permissions
dataset by checking whether a given GUID (either user or group) has access to
the content by:
checking if the content has access_type == "all"
checking if the content has access_type == "logged_in"
checking if the provided guid is the content owner
checking if the provided guid is in the list of content permissions (in the "permissions" column)
Submit a request to render a content item. Once submitted, the server runs an asynchronous process to render the content. This might be useful if content needs to be updated after its source data has changed, especially if this doesn't happen on a regular schedule.
Only valid for rendered content (e.g., most Quarto documents, Jupyter notebooks, R Markdown reports).
content_render(content, variant_key = NULL)content_render(content, variant_key = NULL)
content |
The content item you wish to render. |
variant_key |
If a variant key is provided, render that variant. Otherwise, render the default variant. |
A VariantTask object that can be used to track completion of the render.
## Not run: client <- connect() item <- content_item(client, "951bf3ad-82d0-4bca-bba8-9b27e35c49fa") task <- content_render(item) poll_task(task) ## End(Not run)## Not run: client <- connect() item <- content_item(client, "951bf3ad-82d0-4bca-bba8-9b27e35c49fa") task <- content_render(item) poll_task(task) ## End(Not run)
Submit a request to restart a content item. Once submitted, the server performs an asynchronous request to kill all processes associated with the content item, starting new processes as needed. This might be useful if the application relies on data that is loaded at startup, or if its memory usage has grown over time.
Note that users interacting with certain types of applications may have their workflows interrupted.
Only valid for interactive content (e.g., applications, APIs).
content_restart(content)content_restart(content)
content |
The content item you wish to restart. |
## Not run: client <- connect() item <- content_item(client, "8f37d6e0-3395-4a2c-aa6a-d7f2fe1babd0") content_restart(item) ## End(Not run)## Not run: client <- connect() item <- content_item(client, "8f37d6e0-3395-4a2c-aa6a-d7f2fe1babd0") content_restart(item) ## End(Not run)
Return content title for a piece of content. If the content
is missing (deleted) or not visible, then returns the default
content_title(connect, guid, default = "Unknown Content")content_title(connect, guid, default = "Unknown Content")
connect |
A Connect object |
guid |
The GUID for the content item to be retrieved |
default |
The default value returned for missing or not visible content |
character. The title of the requested content
Other content functions:
content_delete(),
content_item(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Update settings for a content item. For a list of all settings, see the
latest documentation
or the documentation for your server via connectapi::browse_api_docs().
content_update(content, ...) content_update_access_type(content, access_type = c("all", "logged_in", "acl")) content_update_owner(content, owner_guid)content_update(content, ...) content_update_access_type(content, access_type = c("all", "logged_in", "acl")) content_update_owner(content, owner_guid)
content |
An R6 content item |
... |
Settings up update that are passed along to Posit Connect |
access_type |
One of "all", "logged_in", or "acl" |
owner_guid |
The GUID of a user who is a publisher, so that they can become the new owner of the content |
Popular selections are content_update(access_type="all"),
content_update(access_type="logged_in") or
content_update(access_type="acl"), process settings, title, description,
etc.
content_update_access_type() is a helper to make it easier to change access_type
content_update_owner() is a helper to make it easier to change owner
An R6 content item
Other content functions:
content_delete(),
content_item(),
content_title(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
An R6 class that represents a Task for a piece of Content
Content -> ContentTask
taskThe task.
dataThe task data.
Content$bundle_delete()Content$bundle_download()Content$danger_delete()Content$deploy()Content$environment()Content$environment_all()Content$environment_set()Content$get_bundles()Content$get_content_remote()Content$get_dashboard_url()Content$get_url()Content$jobs()Content$packages()Content$permissions()Content$permissions_add()Content$permissions_delete()Content$permissions_update()Content$register_job_kill_order()Content$repo_enable()Content$repo_set()Content$repository()Content$tag_delete()Content$tag_set()Content$tags()Content$update()Content$variants()ContentTask$new()Initialize this task.
ContentTask$new(connect, content, task)
connectThe Connect instance.
contentThe Content instance.
taskThe task data.
ContentTask$get_task()Return the underlying task.
ContentTask$get_task()
ContentTask$add_data()Set the data.
ContentTask$add_data(data)
dataThe data.
ContentTask$get_data()Get the data.
ContentTask$get_data()
ContentTask$print()Print this object.
ContentTask$print(...)
...Unused.
ContentTask$clone()The objects of this class are cloneable with this method.
ContentTask$clone(deep = FALSE)
deepWhether to make a deep clone.
Other R6 classes:
Bundle,
Content,
Environment,
PositConnect,
Task,
Vanity,
Variant,
VariantSchedule,
VariantTask
Creates a new OAuth integration on the Posit Connect server. OAuth integrations allow content to access external resources using OAuth credentials.
You must have administrator privileges to perform this action.
See the Posit Connect documentation on OAuth integrations for more information.
create_integration(client, name, description = NULL, template, config)create_integration(client, name, description = NULL, template, config)
client |
A |
name |
A descriptive name to identify the integration. |
description |
Optional, default |
template |
The template to use to configure this integration (e.g., "custom", "github", "google", "connect"). |
config |
A list containing the configuration for the integration. The required fields vary depending on the template selected. |
A connect_integration object representing the newly created
integration. See get_integration() for details on the returned object.
get_integrations(), get_integration(), update_integration(),
delete_integration()
Other oauth integration functions:
delete_integration(),
get_associations(),
get_integration(),
get_integrations(),
set_integrations(),
update_integration()
## Not run: client <- connect() # Create a GitHub OAuth integration github_integration <- create_integration( client, name = "GitHub Integration", description = "Integration with GitHub for OAuth access", template = "github", config = list( client_id = "your-client-id", client_secret = "your-client-secret" ) ) # Create a custom OAuth integration custom_integration <- create_integration( client, name = "Custom API Integration", description = "Integration with our custom API", template = "custom", config = list( auth_mode = "Confidential", auth_type = "Viewer", authorization_uri = "https://api.example.com/oauth/authorize", client_id = "your-client-id", client_secret = "your-client-secret", token_uri = "https://api.example.com/oauth/token" ) ) ## End(Not run)## Not run: client <- connect() # Create a GitHub OAuth integration github_integration <- create_integration( client, name = "GitHub Integration", description = "Integration with GitHub for OAuth access", template = "github", config = list( client_id = "your-client-id", client_secret = "your-client-secret" ) ) # Create a custom OAuth integration custom_integration <- create_integration( client, name = "Custom API Integration", description = "Integration with our custom API", template = "custom", config = list( auth_mode = "Confidential", auth_type = "Viewer", authorization_uri = "https://api.example.com/oauth/authorize", client_id = "your-client-id", client_secret = "your-client-secret", token_uri = "https://api.example.com/oauth/token" ) ) ## End(Not run)
Creates a random name from the LETTERS dataset
create_random_name(length = 25)create_random_name(length = 25)
length |
Optional. The length of the random name. Defaults to 25 |
The randomly generated name
connectapi::verify_content_name
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Returns the URL for the content dashboard (opened to the selected pane).
dashboard_url(content, pane = "")dashboard_url(content, pane = "")
content |
Content A Content object |
pane |
character The pane in the dashboard to link to |
character The dashboard URL for the content provided
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Deletes an OAuth integration from the Posit Connect server. This permanently removes the integration and any associated content associations.
You must have administrator privileges to perform this action.
See the Posit Connect documentation on OAuth integrations for more information.
delete_integration(integration)delete_integration(integration)
integration |
A |
Returns NULL invisibly if successful.
get_integrations(), get_integration(), create_integration(),
update_integration()
Other oauth integration functions:
create_integration(),
get_associations(),
get_integration(),
get_integrations(),
set_integrations(),
update_integration()
## Not run: client <- connect() # Get an integration to delete integration <- get_integration(client, "your-integration-guid") # Delete the integration delete_integration(integration) ## End(Not run)## Not run: client <- connect() # Get an integration to delete integration <- get_integration(client, "your-integration-guid") # Delete the integration delete_integration(integration) ## End(Not run)
Delete a runtime cache from a Connect server. Requires Administrator privileges.
delete_runtime_cache( client, language, version, image_name = "Local", dry_run = FALSE )delete_runtime_cache( client, language, version, image_name = "Local", dry_run = FALSE )
client |
A |
language |
The language of the cache, either "R" or "Python". |
version |
The version of the cache, e.g. "4.3.3". |
image_name |
Optional. The name of the off-host execution image for the cache, or "Local" (the default) for native execution caches. |
dry_run |
Optional, default |
A Task object representing the deletion task. If dry_run is
TRUE, returns NULL or throws an error if the deletion would fail.
Other server management functions:
get_runtime_caches()
## Not run: client <- connect() task <- delete_runtime_cache(client, "R", "4.3.3") poll_task(task) ## End(Not run)## Not run: client <- connect() task <- delete_runtime_cache(client, "R", "4.3.3") poll_task(task) ## End(Not run)
Delete the thumbnail from a content item on Connect.
delete_thumbnail(content)delete_thumbnail(content)
content |
A content item. |
The content item (invisibly).
Other thumbnail functions:
get_thumbnail(),
has_thumbnail(),
set_thumbnail()
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: client <- connect() item <- content_item(client, "8f37d6e0-3395-4a2c-aa6a-d7f2fe1babd0") thumbnail <- get_thumbnail(item) ## End(Not run)## Not run: client <- connect() item <- content_item(client, "8f37d6e0-3395-4a2c-aa6a-d7f2fe1babd0") thumbnail <- get_thumbnail(item) ## End(Not run)
Delete the vanity URL for a piece of content.
delete_vanity_url(content)delete_vanity_url(content)
content |
A Content object |
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Deploys a bundle (tarball) to an Posit Connect server. If not provided,
name (a unique identifier) will be an auto-generated alphabetic string. If
deploying to an existing endpoint, you can set name or guid to the
desired content.
deploy( connect, bundle, name = create_random_name(), title = name, guid = NULL, ..., .pre_deploy = { } ) deploy_current(content)deploy( connect, bundle, name = create_random_name(), title = name, guid = NULL, ..., .pre_deploy = { } ) deploy_current(content)
connect |
A Connect object |
bundle |
A Bundle object |
name |
The unique name for the content on the server |
title |
optional The title to be used for the content on the server |
guid |
optional The GUID if the content already exists on the server |
... |
Additional arguments passed along to the content creation |
.pre_deploy |
An expression to execute before deploying the new bundle.
The variables |
content |
A Content object |
This function accepts the same arguments as connectapi::content_update().
deploy_current() is a helper to easily redeploy the currently active bundle
for an existing content item.
Task A task object
connectapi::content_update
Other deployment functions:
bundle_dir(),
bundle_path(),
bundle_static(),
download_bundle(),
poll_task()
## Not run: client <- connect() # beware bundling big directories, like `renv/`, `data/`, etc. bnd <- bundle_dir(".") deploy(client, bnd) ## End(Not run) client <- connect() bnd <- bundle_path(system.file("tests/testthat/examples/static.tar.gz", package = "connectapi")) deploy(client, bnd)## Not run: client <- connect() # beware bundling big directories, like `renv/`, `data/`, etc. bnd <- bundle_dir(".") deploy(client, bnd) ## End(Not run) client <- connect() bnd <- bundle_path(system.file("tests/testthat/examples/static.tar.gz", package = "connectapi")) deploy(client, bnd)
Deploy a git repository directly to Posit Connect,
using Posit Connect's "pull-based" "git-polling" method of deployment.
deploy_repo( client, repository, branch, subdirectory, name = create_random_name(), title = name, ... ) deploy_repo_enable(content, enabled = TRUE) deploy_repo_update(content)deploy_repo( client, repository, branch, subdirectory, name = create_random_name(), title = name, ... ) deploy_repo_enable(content, enabled = TRUE) deploy_repo_update(content)
client |
A Connect R6 object |
repository |
The git repository to deploy |
branch |
The git branch to deploy |
subdirectory |
The subdirectory to deploy (must contain a |
name |
The "name" / unique identifier for the content. Defaults to a random character string |
title |
The "title" of the content |
... |
Additional options for defining / specifying content attributes |
content |
An R6 Content object (i.e. the result of |
enabled |
Whether Connect will enable automatic polling for repository updates |
deploy_repo_enable() enables (or disables) Posit Connect's git polling for a piece of content
deploy_repo_update() triggers an update of the content from its git
repository, if any are present
A ContentTask object, for use with poll_task() (if you want to follow the logs)
connectapi::poll_task, connectapi::repo_check_branches, connectapi::repo_check_manifest_dirs
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Downloads a Content item's active bundle, or (optionally) one of its other bundles.
download_bundle( content, filename = fs::file_temp(pattern = "bundle", ext = ".tar.gz"), bundle_id = NULL, overwrite = FALSE )download_bundle( content, filename = fs::file_temp(pattern = "bundle", ext = ".tar.gz"), bundle_id = NULL, overwrite = FALSE )
content |
A Content object |
filename |
Optional. The output bundle path |
bundle_id |
Optional. A string representing the bundle_id to download. If NULL, will use the currently active bundle. |
overwrite |
Optional. Default FALSE. Whether to overwrite the target location if it already exists |
Bundle A bundle object
Other deployment functions:
bundle_dir(),
bundle_path(),
bundle_static(),
deploy(),
poll_task()
An R6 class that represents a Content's Environment Variables
Content -> Environment
env_rawThe (raw) set of environment variables.
env_varsThe set of environment variables.
Content$bundle_delete()Content$bundle_download()Content$danger_delete()Content$deploy()Content$get_bundles()Content$get_content_remote()Content$get_dashboard_url()Content$get_url()Content$jobs()Content$packages()Content$permissions()Content$permissions_add()Content$permissions_delete()Content$permissions_update()Content$register_job_kill_order()Content$repo_enable()Content$repo_set()Content$repository()Content$tag_delete()Content$tag_set()Content$tags()Content$update()Content$variants()Environment$new()Initialize this set of environment variables.
Environment$new(connect, content)
connectThe Connect instance.
contentThe Content instance.
Environment$environment()Fetch the set of environment variables.
Environment$environment()
Environment$environment_set()Update the set of environment variables.
Environment$environment_set(...)
...Environment variable names and values.
Environment$environment_all()Overwrite the set of environment variables.
Environment$environment_all(...)
...Environment variable names and values.
Environment$env_refresh()Fetch the set o environment variables.
Environment$env_refresh()
Environment$print()Print this object.
Environment$print(...)
...Unused.
Environment$clone()The objects of this class are cloneable with this method.
Environment$clone(deep = FALSE)
deepWhether to make a deep clone.
Other R6 classes:
Bundle,
Content,
ContentTask,
PositConnect,
Task,
Vanity,
Variant,
VariantSchedule,
VariantTask
Given a Content object, retrieves a list of its
OAuth associations. An association contains a content GUID and an association
GUID, and indicates that the integration can be used by the content when it
runs.
get_associations(x)get_associations(x)
x |
A |
A list of OAuth integration associations. Each association includes details such as:
app_guid: The content item's GUID (deprecated, use content_guid instead).
content_guid: The content item's GUID.
oauth_integration_guid: The GUID of the OAuth integration.
oauth_integration_name: The name of the OAuth integration.
oauth_integration_description: A description of the OAuth integration.
oauth_integration_template: The template used for this OAuth integration.
oauth_integration_auth_type: The authentication type (e.g., "Viewer" or "Service Account").
created_time: The timestamp when the association was created.
set_integrations(), get_integrations(), get_integration()
Other oauth integration functions:
create_integration(),
delete_integration(),
get_integration(),
get_integrations(),
set_integrations(),
update_integration()
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: client <- connect() # Get OAuth associations for an app. my_app <- content_item(client, "12345678-90ab-cdef-1234-567890abcdef") my_app_associations <- get_associations(my_app) # Given those associations, retrieve the integrations themselves. my_app_integrations <- purrr::map( my_app_associations, ~ get_integration(client, .x$oauth_integration_guid) ) ## End(Not run)## Not run: client <- connect() # Get OAuth associations for an app. my_app <- content_item(client, "12345678-90ab-cdef-1234-567890abcdef") my_app_associations <- get_associations(my_app) # Given those associations, retrieve the integrations themselves. my_app_integrations <- purrr::map( my_app_associations, ~ get_integration(client, .x$oauth_integration_guid) ) ## End(Not run)
Get Audit Logs from Posit Connect Server
get_audit_logs(src, limit = 500, previous = NULL, nxt = NULL, asc_order = TRUE)get_audit_logs(src, limit = 500, previous = NULL, nxt = NULL, asc_order = TRUE)
src |
The source object |
limit |
The number of records to return. |
previous |
Retrieve the previous page of Shiny application usage logs relative to the provided value. This value corresponds to an internal reference within the server and should be sourced from the appropriate attribute within the paging object of a previous response. |
nxt |
Retrieve the next page of Shiny application usage logs relative to the provided value. This value corresponds to an internal reference within the server and should be sourced from the appropriate attribute within the paging object of a previous response. |
asc_order |
Defaults to TRUE; Determines if the response records should be listed in ascending or descending order within the response. Ordering is by the started timestamp field. |
Please see https://docs.posit.co/connect/api/#get-/v1/audit_logs for more information.
A tibble with the following columns:
id: ID of the audit action
time: Timestamp in RFC3339 format when action was taken
user_id: User ID of the actor who made the audit action
user_description: Description of the actor
action: Audit action taken
event_description: Description of action
## Not run: library(connectapi) client <- connect() # get the last 20 audit logs get_audit_logs(client, limit = 20, asc_order = FALSE) ## End(Not run)## Not run: library(connectapi) client <- connect() # get the last 20 audit logs get_audit_logs(client, limit = 20, asc_order = FALSE) ## End(Not run)
Obtain AWS credentials for your content.
get_aws_content_credentials( connect, content_session_token = NULL, audience = NULL )get_aws_content_credentials( connect, content_session_token = NULL, audience = NULL )
connect |
A Connect R6 object. |
content_session_token |
Optional. The content session token. This token
can only be obtained when the content is running on a Connect server. The
token identifies the service account integration previously configured by
the publisher on the Connect server. Defaults to the value from the
environment variable: |
audience |
Optional. The GUID of an OAuth integration associated with this piece of content. |
Please see https://docs.posit.co/connect/user/oauth-integrations/#obtaining-service-account-aws-credentials
for more information. See the example below of using this function with
paws to access S3. Any library that allows you to pass AWS credentials
will be able to utilize the credentials returned from this function call.
The AWS credentials as a list with fields named access_key_id,
secret_access_key, session_token, and expiration.
## Not run: library(connectapi) library(paws) client <- connect() # Pulls the content session token from the environment # when deployed into Connect. aws_credentials <- get_aws_content_credentials(client) # Create S3 client with AWS credentials from Connect svc <- paws::s3( credentials = list( creds = list( access_key_id = aws_credentials$access_key_id, secret_access_key = aws_credentials$secret_access_key, session_token = aws_credentials$session_token ) ) ) # Get object from S3 obj <- svc$get_object( Bucket = "my-bucket", Key = "my-data.csv" ) ## End(Not run)## Not run: library(connectapi) library(paws) client <- connect() # Pulls the content session token from the environment # when deployed into Connect. aws_credentials <- get_aws_content_credentials(client) # Create S3 client with AWS credentials from Connect svc <- paws::s3( credentials = list( creds = list( access_key_id = aws_credentials$access_key_id, secret_access_key = aws_credentials$secret_access_key, session_token = aws_credentials$session_token ) ) ) # Get object from S3 obj <- svc$get_object( Bucket = "my-bucket", Key = "my-data.csv" ) ## End(Not run)
Obtain a visitor's AWS credentials
get_aws_credentials(connect, user_session_token, audience = NULL)get_aws_credentials(connect, user_session_token, audience = NULL)
connect |
A Connect R6 object. |
user_session_token |
The content visitor's session token. This token
can only be obtained when the content is running on a Connect server. The token
identifies the user who is viewing the content interactively on the Connect server.
Read this value from the HTTP header: |
audience |
Optional. The GUID of an OAuth integration associated with this piece of content. |
Please see https://docs.posit.co/connect/user/oauth-integrations/#obtaining-service-account-aws-credentials for more information. See the example below of using this function in a Plumber API with paws to access S3. Any library that allows you to pass AWS credentials will be able to utilize the credentials returned from this function call.
The AWS credentials as a list with fields named access_key_id,
secret_access_key, session_token, and expiration.
## Not run: library(connectapi) library(plumber) library(paws) client <- connect() #* @get /do function(req) { user_session_token <- req$HTTP_POSIT_CONNECT_USER_SESSION_TOKEN aws_credentials <- get_aws_credentials(client, user_session_token) # Create S3 client with AWS credentials from Connect svc <- paws::s3( credentials = list( creds = list( access_key_id = aws_credentials$access_key_id, secret_access_key = aws_credentials$secret_access_key, session_token = aws_credentials$session_token ) ) ) # Get object from S3 obj <- svc$get_object( Bucket = "my-bucket", Key = "my-data.csv" ) "done" } ## End(Not run)## Not run: library(connectapi) library(plumber) library(paws) client <- connect() #* @get /do function(req) { user_session_token <- req$HTTP_POSIT_CONNECT_USER_SESSION_TOKEN aws_credentials <- get_aws_credentials(client, user_session_token) # Create S3 client with AWS credentials from Connect svc <- paws::s3( credentials = list( creds = list( access_key_id = aws_credentials$access_key_id, secret_access_key = aws_credentials$secret_access_key, session_token = aws_credentials$session_token ) ) ) # Get object from S3 obj <- svc$get_object( Bucket = "my-bucket", Key = "my-data.csv" ) "done" } ## End(Not run)
Lists bundles for a content item
get_bundles(content) delete_bundle(content, bundle_id)get_bundles(content) delete_bundle(content, bundle_id)
content |
A R6 Content item, as returned by |
bundle_id |
A specific bundle ID for a content item |
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Get information about content on the Posit Connect server
get_content(src, guid = NULL, owner_guid = NULL, name = NULL, ..., .p = NULL)get_content(src, guid = NULL, owner_guid = NULL, name = NULL, ..., .p = NULL)
src |
A Connect object |
guid |
The guid for a particular content item |
owner_guid |
The unique identifier of the user who owns the content |
name |
The content name specified when the content was created |
... |
Extra arguments. Currently not used. |
.p |
Optional. A predicate function, passed as-is to |
Please see https://docs.posit.co/connect/api/#get-/v1/content for more information.
A tibble with the following columns:
guid: The unique identifier of this content item.
name: A simple, URL-friendly identifier. Allows alpha-numeric
characters, hyphens ("-"), and underscores ("_").
title: The title of this content.
description: A rich description of this content
access_type: Access type describes how this content manages its
viewers. It may have a value of all, logged_in or acl.
The value all is the most permissive; any visitor to Posit
Connect will be able to view this content. The value logged_in
indicates that all Posit Connect accounts may view the content. The
acl value lets specifically enumerated users and groups view the
content. Users configured as collaborators may always view content.
connection_timeout: Maximum number of seconds allowed without data
sent or received across a client connection. A value of 0 means
connections will never time-out (not recommended). When null, the
default Scheduler.ConnectionTimeout is used. Applies only to content
types that are executed on demand.
read_timeout: Maximum number of seconds allowed without data received
from a client connection. A value of 0 means a lack of client (browser)
interaction never causes the connection to close. When null, the default
Scheduler.ReadTimeout is used. Applies only to content types that are
executed on demand.
init_timeout: The maximum number of seconds allowed for an interactive
application to start. Posit Connect must be able to connect
to a newly launched Shiny application, for example, before this threshold
has elapsed. When null, the default Scheduler.InitTimeout is
used. Applies only to content types that are executed on demand.
idle_timeout: The maximum number of seconds a worker process
for an interactive application to remain alive after it goes idle (no
active connections). When null, the default Scheduler.IdleTimeout
is used. Applies only to content types that are executed on demand.
max_processes: Specifies the total number of concurrent processes
allowed for a single interactive application. When null, the
default Scheduler.MaxProcesses setting is used. Applies only to
content types that are executed on demand.
min_processes: Specifies the minimum number of concurrent
processes allowed for a single interactive application. When null, the
default Scheduler.MinProcesses is used. Applies only to content types
that are executed on demand.
max_conns_per_process: Specifies the maximum number of
client connections allowed to an individual process. Incoming connections
which will exceed this limit are routed to a new process or rejected.
When null, the default Scheduler.MaxConnsPerProcess is used. Applies
only to content types that are executed on demand.
load_factor: Controls how aggressively new processes are spawned.
When null, the default Scheduler.LoadFactor is used. Applies only to
content types that are executed on demand.
created_time: The timestamp (RFC3339) indicating when this
content was created.
last_deployed_time: The timestamp (RFC3339) indicating when
this content last had a successful bundle deployment performed.
bundle_id: The identifier for the active deployment bundle.
Automatically assigned upon the successful deployment of that bundle.
app_mode: The runtime model for this content. Has a value
of unknown before data is deployed to this item. Automatically assigned
upon the first successful bundle deployment. Allowed: api,
jupyter-static, python-api, python-bokeh, python-dash,
python-streamlit, rmd-shiny, rmd-static, shiny, static,
tensorflow-saved-model, unknown.
content_category: Describes the specialization of the content
runtime model. Automatically assigned upon the first successful bundle
deployment.
parameterized: True when R Markdown rendered content
allows parameter configuration. Automatically assigned upon the first
successful bundle deployment. Applies only to content with an app_mode
of rmd-static.
r_version: The version of the R interpreter associated
with this content. The value null represents that an R interpreter is
not used by this content or that the R package environment has not been
successfully restored. Automatically assigned upon the successful
deployment of a bundle.
py_version: The version of the Python interpreter
associated with this content. The value null represents that a Python
interpreter is not used by this content or that the Python package
environment has not been successfully restored. Automatically assigned
upon the successful deployment of a bundle.
run_as: The UNIX user that executes this content.
When null, the default Applications.RunAs is used. Applies
only to executable content types - not static.
run_as_current_user: Indicates if this content is allowed
to execute as the logged-in user when using PAM authentication.
Applies only to executable content types - not static.
owner_guid: The unique identifier for the owner
content_url: The URL associated with this content. Computed
from the GUID for this content.
dashboard_url: The URL within the Connect dashboard where
this content can be configured. Computed from the GUID for this content.
role: The relationship of the accessing user to this
content. A value of owner is returned for the content owner. editor
indicates a collaborator. The viewer value is given to users who are
permitted to view the content. A none role is returned for
administrators who cannot view the content but are permitted to view
its configuration. Computed at the time of the request.
vanity_url: The vanity URL associated with this content item.
id: The internal numeric identifier of this content item.
tags: Tags associated with this content item. Each entry is a list
with the following fields:
id: The identifier for the tag.
name: The name of the tag.
parent_id: The identifier for the parent tag. Null if the tag is a
top-level tag.
created_time: The timestamp (RFC3339) indicating when the tag was
created.
updated_time: The timestamp (RFC3339) indicating when the tag was
last updated.
owner: Basic details about the owner of this content item. Each entry
is a list with the following fields:
guid: The user's GUID, or unique identifier, in UUID RFC4122 format.
username: The user's username.
first_name: The user's first name.
last_name: The user's last name.
## Not run: library(connectapi) client <- connect() get_content(client) ## End(Not run)## Not run: library(connectapi) client <- connect() get_content(client) ## End(Not run)
Get a data frame of package dependencies used by a content item.
get_content_packages(content)get_content_packages(content)
content |
A content item |
A data frame with the following columns:
language : Language ecosystem the package belongs to (r or python)
name: The package name
version: The package version
hash: For R packages, the package DESCRIPTION hash
Other packages functions:
get_packages()
## Not run: client <- connect() item <- content_item(client, "951bf3ad-82d0-4bca-bba8-9b27e35c49fa") packages <- get_content_packages(item) ## End(Not run)## Not run: client <- connect() item <- content_item(client, "951bf3ad-82d0-4bca-bba8-9b27e35c49fa") packages <- get_content_packages(item) ## End(Not run)
Manage Environment Variables for a piece of content.
get_environment(content) set_environment_new(env, ...) set_environment_remove(env, ...) set_environment_all(env, ...)get_environment(content) set_environment_new(env, ...) set_environment_remove(env, ...) set_environment_all(env, ...)
content |
An R6 Content object as returned by |
env |
An R6 Environment object as returned by |
... |
name = value pairs of environment variable names and values |
get_environment() returns an Environment object for use with "setter" methods
set_environment_new() updates environment values (either creating new
values or updating existing). Set NA as the value to remove a variable.
set_environment_remove() is a wrapper on set_environment_new() that
allows removing named / listed variables quickly
set_environment_all() sets all environment variable values (will remove
variables not specified)
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Get content access permissions for a group or groups
get_group_content(src, guids)get_group_content(src, guids)
src |
A Connect client object |
guids |
A character vector of group guids |
A tibble with the following columns:
group_guid: The group's GUID
group_name: The group's name
content_guid: The content item's GUID
content_name: The content item's name
content_title: The content item's title
access_type: The access type of the content item ("all", "logged_in", or "acl")
role: The access type that members of the group have to the
content item, "publisher" or "viewer".
Other groups functions:
get_group_members(),
get_groups()
## Not run: library(connectapi) client <- connect() # Get a data frame of groups groups <- get_groups(client) # Get permissions for a single group by passing in the corresponding row. get_group_content(client, groups[1, "guid"]) dplyr::filter(groups, name = "research_scientists") %>% dplyr::pull(guid) %>% get_group_content(client, .) # Get permissions for all groups by passing in all group guids. get_group_content(client, groups$guid) ## End(Not run)## Not run: library(connectapi) client <- connect() # Get a data frame of groups groups <- get_groups(client) # Get permissions for a single group by passing in the corresponding row. get_group_content(client, groups[1, "guid"]) dplyr::filter(groups, name = "research_scientists") %>% dplyr::pull(guid) %>% get_group_content(client, .) # Get permissions for all groups by passing in all group guids. get_group_content(client, groups$guid) ## End(Not run)
Get users within a specific group
get_group_members(src, guid)get_group_members(src, guid)
src |
A Connect client object |
guid |
A group GUID identifier |
Please see https://docs.posit.co/connect/api/#get-/v1/groups/-group_guid-/members for more information.
A tibble with the following columns:
email: The user's email
username: The user's username
first_name: The user's first name
last_name: The user's last name
user_role: The user's role. It may have a value of administrator,
publisher or viewer.
created_time: The timestamp (in RFC3339 format) when the user
was created in the Posit Connect server
updated_time: The timestamp (in RFC3339 format) when the user
was last updated in the Posit Connect server
active_time: The timestamp (in RFC3339 format) when the user
was last active on the Posit Connect server
confirmed: When false, the created user must confirm their
account through an email. This feature is unique to password
authentication.
locked: Whether or not the user is locked
guid: The user's GUID, or unique identifier, in UUID RFC4122 format
Other groups functions:
get_group_content(),
get_groups()
## Not run: library(connectapi) client <- connect() # get the first 20 groups groups <- get_groups(client) group_guid <- groups$guid[1] get_group_members(client, guid = group_guid) ## End(Not run)## Not run: library(connectapi) client <- connect() # get the first 20 groups groups <- get_groups(client) group_guid <- groups$guid[1] get_group_members(client, guid = group_guid) ## End(Not run)
Get group information from the Posit Connect server
get_groups(src, page_size = 500, prefix = NULL, limit = Inf)get_groups(src, page_size = 500, prefix = NULL, limit = Inf)
src |
The source object. |
page_size |
The number of records to return per page (max 500). |
prefix |
Filters groups by prefix (group name). The filter is case insensitive. |
limit |
The number of groups to retrieve before paging stops. Default
is to return all results; however, for Connect server versions older than
2025.04.0, |
Please see https://docs.posit.co/connect/api/#get-/v1/groups for more information.
A tibble with the following columns:
guid: The unique identifier of the group
name: The group name
owner_guid: The group owner's unique identifier. When using LDAP or
Proxied authentication with group provisioning enabled this property
will always be null.
Other groups functions:
get_group_content(),
get_group_members()
## Not run: library(connectapi) client <- connect() # get all groups get_groups(client, limit = Inf) ## End(Not run)## Not run: library(connectapi) client <- connect() # get all groups get_groups(client, limit = Inf) ## End(Not run)
Given the GUID of an OAuth integration available on a Connect server, retrieve its details. You must have administrator or publisher privileges to perform this action.
get_integration(client, guid)get_integration(client, guid)
client |
A |
guid |
The GUID of an integration available on the Connect server. |
A connect_integration object representing an OAuth integration,
which has the following fields:
id: The internal identifier of this OAuth integration.
guid: The GUID of this OAuth integration.
created_time: The timestamp (RFC3339) indicating when this integration
was created.
updated_time: The timestamp (RFC3339) indicating when this integration
was last updated
name: A descriptive name to identify the OAuth integration.
description: A brief text to describe the OAuth integration.
template: The template used to configure this OAuth integration.
auth_type: The authentication type indicates which OAuth flow is used by
this integration.
config: A list with the OAuth integration configuration. Fields
differ between integrations.
get_integrations(), get_associations(), set_integrations()
Other oauth integration functions:
create_integration(),
delete_integration(),
get_associations(),
get_integrations(),
set_integrations(),
update_integration()
## Not run: client <- connect() x <- get_integration(client, guid) ## End(Not run)## Not run: client <- connect() x <- get_integration(client, guid) ## End(Not run)
Retrieve OAuth integrations either from the Connect server or associated with a specific content item.
If x is a Connect object, this function lists all OAuth integrations on the server.
If x is a Content object, it returns the integrations associated with that content item.
You must have administrator or publisher privileges to use this function.
get_integrations(x)get_integrations(x)
x |
A |
A list of class connect_integration_list, where each element is a connect_integration object
with the following fields. (Raw API fields are character strings unless noted otherwise):
id: The internal identifier of this OAuth integration.
guid: The GUID of this OAuth integration.
created_time: Timestamp (RFC3339) when the integration was created.
updated_time: Timestamp (RFC3339) when the integration was last updated.
name: A descriptive name.
description: A brief description.
template: The template used to configure the integration.
auth_type: The OAuth flow used.
config: A list with integration-specific config fields.
Use as.data.frame() or tibble::as_tibble() to convert the result to a data frame with parsed types.
get_integration(), set_integrations(), get_associations()
Other oauth integration functions:
create_integration(),
delete_integration(),
get_associations(),
get_integration(),
set_integrations(),
update_integration()
## Not run: # From a Connect client client <- connect() integrations <- get_integrations(client) # Filter or update specific ones github_integration <- purrr::keep(integrations, \(x) x$template == "github")[[1]] json_payload <- jsonlite::toJSON(list( description = "Updated Description", config = list(client_secret = "new-secret") ), auto_unbox = TRUE) client$PATCH( paste0("v1/oauth/integrations/", github_integration$guid), body = json_payload ) # From a Content item content <- content_item(client, "12345678-90ab-cdef-1234-567890abcdef") content_integrations <- get_integrations(content) # Filter content integrations snowflake_integrations <- purrr::keep(content_integrations, ~ .x$template == "snowflake") ## End(Not run)## Not run: # From a Connect client client <- connect() integrations <- get_integrations(client) # Filter or update specific ones github_integration <- purrr::keep(integrations, \(x) x$template == "github")[[1]] json_payload <- jsonlite::toJSON(list( description = "Updated Description", config = list(client_secret = "new-secret") ), auto_unbox = TRUE) client$PATCH( paste0("v1/oauth/integrations/", github_integration$guid), body = json_payload ) # From a Content item content <- content_item(client, "12345678-90ab-cdef-1234-567890abcdef") content_integrations <- get_integrations(content) # Filter content integrations snowflake_integrations <- purrr::keep(content_integrations, ~ .x$template == "snowflake") ## End(Not run)
Retrieve details about server processes associated with a content_item,
such as a FastAPI app or a Quarto render.
get_jobs(content) get_job_list(content)get_jobs(content) get_job_list(content)
content |
A Content object, as returned by |
Note that Connect versions below 2022.10.0 use a legacy endpoint, and will not return the complete set of information provided by newer versions.
get_jobs() returns job data as a data frame, whereas get_jobs_list()
returns job data in a list.
You might get job data as a data frame if you want to perform some calculations about job data (e.g. counting server processes over time), or if you want to filter jobs to find a specific key.
The objects in list returned by get_jobs_list() are useful if you want to
take an action on a job, such as getting its process log with
get_log().
get_jobs(): A data frame with a row representing each job.
get_job_list(): A list with each element representing a job.
Jobs contain the following fields:
id: The job identifier.
ppid: The job's parent process identifier (see Note 1).
pid: The job's process identifier.
key: The job's unique key identifier.
remote_id: The job's identifier for off-host execution configurations
(see Note 1).
app_id: The job's parent content identifier; deprecated in favor of content_id.
app_guid: The job's parent content GUID; deprecated in favor of content_guid.
content_id: The job's parent content identifier.
content_guid: The job's parent content GUID.
variant_id: The identifier of the variant owning this job.
bundle_id: The identifier of a content bundle linked to this job.
start_time: The timestamp (RFC3339) indicating when this job started.
end_time: The timestamp (RFC3339) indicating when this job finished.
last_heartbeat_time: The timestamp (RFC3339) indicating the last time
this job was observed to be running (see Note 1).
queued_time: The timestamp (RFC3339) indicating when this job was added
to the queue to be processed. Only scheduled reports will present a value
for this field (see Note 1).
queue_name: The name of the queue which processes the job. Only
scheduled reports will present a value for this field (see Note 1).
tag: A tag to identify the nature of the job.
exit_code: The job's exit code. Present only when job is finished.
status: The current status of the job. On Connect 2022.10.0 and newer,
one of Active: 0, Finished: 1, Finalized: 2; on earlier versions, Active:
0, otherwise NA.
hostname: The name of the node which processes the job.
cluster: The location where this content runs. Content running on the
same server as Connect will have either a null value or the string Local.
Gives the name of the cluster when run external to the Connect host
(see Note 1).
image: The location where this content runs. Content running on
the same server as Connect will have either a null value or the string
Local. References the name of the target image when content runs in
a clustered environment such as Kubernetes (see Note 1).
run_as: The UNIX user that executed this job.
On Connect instances earlier than 2022.10.0, these fields will contain NA values.
Other job functions:
get_log(),
terminate_jobs()
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: client <- connect() item <- content_item(client, "951bf3ad-82d0-4bca-bba8-9b27e35c49fa") jobs <- get_jobs(item) job_list <- get_job_list(item) ## End(Not run)## Not run: client <- connect() item <- content_item(client, "951bf3ad-82d0-4bca-bba8-9b27e35c49fa") jobs <- get_jobs(item) job_list <- get_job_list(item) ## End(Not run)
Get the log output for a job. Requires Connect 2022.10.0 or newer.
get_log(job, max_log_lines = NULL)get_log(job, max_log_lines = NULL)
job |
A job, represented by an element from the list returned by |
max_log_lines |
Optional. An integer indicating the maximum number of
log lines to return. If |
Note: The output of get_jobs() cannot be used with get_log().
Please use an object from the list returned by get_job_list().
A data frame with the requested log. Each row represents an entry.
source: stdout or stderr
timestamp: The time of the entry.
data: The logged text.
Other job functions:
get_jobs(),
terminate_jobs()
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: client <- connect() item <- content_item(client, "951bf3ad-82d0-4bca-bba8-9b27e35c49fa") jobs <- get_job_list(item) log <- get_log(jobs[[1]]) ## End(Not run)## Not run: client <- connect() item <- content_item(client, "951bf3ad-82d0-4bca-bba8-9b27e35c49fa") jobs <- get_job_list(item) log <- get_log(jobs[[1]]) ## End(Not run)
Perform an OAuth credential exchange to obtain a content-specific OAuth access token.
get_oauth_content_credentials( connect, content_session_token = NULL, requested_token_type = NULL, audience = NULL )get_oauth_content_credentials( connect, content_session_token = NULL, requested_token_type = NULL, audience = NULL )
connect |
A Connect R6 object. |
content_session_token |
Optional. The content session token. This token
can only be obtained when the content is running on a Connect server. The
token identifies the service account integration previously configured by
the publisher on the Connect server. Defaults to the value found in the file
indicated by the |
requested_token_type |
Optional. The requested token type. If unset,
will default to |
audience |
Optional. The GUID of an OAuth integration associated with this piece of content. |
Please see https://docs.posit.co/connect/user/oauth-integrations/#obtaining-a-service-account-oauth-access-token for more information.
The OAuth credential exchange response.
get_integrations(), get_oauth_credentials()
## Not run: library(connectapi) library(plumber) client <- connect() #* @get /do function(req) { credentials <- get_oauth_content_credentials(client) # ... do something with `credentials$access_token` ... "done" } ## End(Not run)## Not run: library(connectapi) library(plumber) client <- connect() #* @get /do function(req) { credentials <- get_oauth_content_credentials(client) # ... do something with `credentials$access_token` ... "done" } ## End(Not run)
Perform an OAuth credential exchange to obtain a visitor's OAuth access token.
get_oauth_credentials( connect, user_session_token, requested_token_type = NULL, audience = NULL )get_oauth_credentials( connect, user_session_token, requested_token_type = NULL, audience = NULL )
connect |
A Connect R6 object. |
user_session_token |
The content visitor's session token. This token
can only be obtained when the content is running on a Connect server. The token
identifies the user who is viewing the content interactively on the Connect server.
Read this value from the HTTP header: |
requested_token_type |
Optional. The requested token type. If unset, will
default to |
audience |
Optional. The GUID of an OAuth integration associated with this piece of content. |
Please see https://docs.posit.co/connect/user/oauth-integrations/#obtaining-a-viewer-oauth-access-token for more information.
The OAuth credential exchange response.
get_integrations(), get_oauth_content_credentials()
## Not run: library(connectapi) library(plumber) client <- connect() #* @get /do function(req) { user_session_token <- req$HTTP_POSIT_CONNECT_USER_SESSION_TOKEN credentials <- get_oauth_credentials(client, user_session_token) # ... do something with `credentials$access_token` ... "done" } ## End(Not run)## Not run: library(connectapi) library(plumber) client <- connect() #* @get /do function(req) { user_session_token <- req$HTTP_POSIT_CONNECT_USER_SESSION_TOKEN credentials <- get_oauth_credentials(client, user_session_token) # ... do something with `credentials$access_token` ... "done" } ## End(Not run)
Get a data frame of package dependencies used by all content items on the server.
get_packages(src, name = NULL, page_size = 100000, limit = Inf)get_packages(src, name = NULL, page_size = 100000, limit = Inf)
src |
A |
name |
Optional package name to filter by. Python package are normalized during matching; R package names must match exactly. |
page_size |
Optional. Integer specifying page size for API paging. |
limit |
Optional. Specify the maximum number of records after which to cease paging. |
A data frame with the following columns:
language: Language ecosystem the package belongs to (r or python)
language_version: Version of R or Python used by the content
name: Package name
version: Package version
hash: Package description hash for R packages
bundle_id: Identifier for the bundle that depends on this package
content_id: Numeric identifier for the content that depends on this
package
content_guid: The unique identifier of the content item that depends on
this package
Other packages functions:
get_content_packages()
## Not run: client <- connect() packages <- get_packages(client) ## End(Not run)## Not run: client <- connect() packages <- get_packages(client) ## End(Not run)
This returns real-time process data from the Posit Connect API. It requires
administrator privileges to use. NOTE that this only returns data for the
server that responds to the request (i.e. in a Highly Available cluster)
get_procs(src)get_procs(src)
src |
The source object |
A tibble with the following columns:
pid: The PID of the current process
appId: The application ID
appGuid: The application GUID
appName: The application name
appUrl: The application URL
appRunAs: The application RunAs user
type: The type of process
cpuCurrent: The current CPU usage
cpuTotal: The total CPU usage
ram: The current RAM usage
View the runtime caches on a Connect server. Requires Administrator privileges.
get_runtime_caches(client)get_runtime_caches(client)
client |
A |
A tibble of runtime caches on the server, showing language,
version and image_name. For Connect servers not using off-host execution,
image_name is "Local".
Other server management functions:
delete_runtime_cache()
## Not run: client <- connect() get_runtime_caches(client) ## End(Not run)## Not run: client <- connect() get_runtime_caches(client) ## End(Not run)
Get a table showing available versions of R, Python, Quarto, and Tensorflow on the Connect server.
get_runtimes(client, runtimes = NULL)get_runtimes(client, runtimes = NULL)
client |
A |
runtimes |
Optional. A character vector of runtimes to include. Must be
some combination of |
A tibble with columns for runtime, version, and cluster_name
and image_name. Cluster name and image name are only meaningful on Connect
instances running off-host execution.
## Not run: library(connectapi) client <- connect() get_runtimes(client, runtimes = c("r", "python", "tensorflow")) ## End(Not run)## Not run: library(connectapi) client <- connect() get_runtimes(client, runtimes = c("r", "python", "tensorflow")) ## End(Not run)
Tag manipulation and assignment functions
get_tags(src) get_tag_data(src) create_tag(src, name, parent = NULL) create_tag_tree(src, ...) delete_tag(src, tag) get_content_tags(content) set_content_tag_tree(content, ...) set_content_tags(content, ...) filter_tag_tree_id(tags, ids) filter_tag_tree_chr(tags, pattern)get_tags(src) get_tag_data(src) create_tag(src, name, parent = NULL) create_tag_tree(src, ...) delete_tag(src, tag) get_content_tags(content) set_content_tag_tree(content, ...) set_content_tags(content, ...) filter_tag_tree_id(tags, ids) filter_tag_tree_chr(tags, pattern)
src |
The source object |
name |
The name of the tag to create |
parent |
optional. A |
... |
Additional arguments Manage tags (requires Administrator role):
Manage content tags:
Search a tag tree:
|
tag |
A |
content |
An R6 Content object, as returned by |
tags |
A |
ids |
A list of |
pattern |
A regex to filter the tag tree by (it is passed to |
Download the thumbnail for a content item on Connect to a file on your computer.
get_thumbnail(content, path = NULL)get_thumbnail(content, path = NULL)
content |
A content item. |
path |
Optional. A path to a file used to write the thumbnail image. If no path is provided, a temporary file with the correct file extension is created. |
The path to the downloaded image file, if content has a thumbnail; otherwise NA.
Other thumbnail functions:
delete_thumbnail(),
has_thumbnail(),
set_thumbnail()
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: client <- connect() item <- content_item(client, "8f37d6e0-3395-4a2c-aa6a-d7f2fe1babd0") thumbnail <- get_thumbnail(item) ## End(Not run)## Not run: client <- connect() item <- content_item(client, "8f37d6e0-3395-4a2c-aa6a-d7f2fe1babd0") thumbnail <- get_thumbnail(item) ## End(Not run)
Get the available timezones from the server.
get_timezones(connect)get_timezones(connect)
connect |
An R6 Connect object |
A TimeZone vector to be used for setting time zones
Other schedule functions:
get_variant_schedule(),
set_schedule()
Retrieve content hits for all available content on the server. Available content depends on the user whose API key is in use. Administrator accounts will receive data for all content on the server. Publishers will receive data for all content they own or collaborate on.
If no date-times are provided, all usage data will be returned.
get_usage(client, content_guid = NULL, from = NULL, to = NULL)get_usage(client, content_guid = NULL, from = NULL, to = NULL)
client |
A |
content_guid |
Optional. A single content GUID or a character vector of
GUIDs to filter results. When multiple GUIDs are provided they are
collapsed with |
from |
Optional date-time ( |
to |
Optional date-time ( |
The data returned by get_usage() includes all content types. For Shiny
content, the timestamp indicates the start of the Shiny session.
Additional fields for Shiny and non-Shiny are available respectively from
get_usage_shiny() and get_usage_static(). get_usage_shiny() includes a
field for the session end time; get_usage_static() includes variant,
rendering, and bundle identifiers for the visited content.
When possible, however, we recommend using get_usage() over
get_usage_static() or get_usage_shiny(), as it is faster and more efficient.
A list of usage records. Each record is a list with all elements as character strings unless otherwise specified.
id: A string identifier for the hit.
user_guid: The user GUID if the visitor is logged-in, NULL for
anonymous hits.
content_guid: The GUID of the visited content.
timestamp: The time of the hit in RFC3339 format.
data: A nested list with optional fields:
path: The request path (if recorded).
user_agent: The user agent string (if available).
Use as.data.frame() or tibble::as_tibble() to convert to a flat
table with parsed types. In the resulting data frame:
timestamp is parsed to POSIXct.
path and user_agent are extracted from the nested data field.
By default, as.data.frame() attempts to extract the nested fields using
the tidyr package. If tidyr is not available, or if you want to
skip unnesting, call as.data.frame(x, unnest = FALSE) to leave data as
a list-column.
as.data.frame.connect_list_hits(), as_tibble.connect_list_hits()
## Not run: client <- connect() # Fetch the last 2 days of hits usage <- get_usage(client, from = Sys.Date() - 2, to = Sys.Date()) # Fetch usage after a specified date and convert to a data frame. usage <- get_usage( client, from = as.POSIXct("2025-05-02 12:40:00", tz = "UTC") ) # Fetch usage for a specific content item usage <- get_usage(client, content_guid = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") # Fetch all usage usage <- get_usage(client) # Convert to tibble or data frame usage_df <- tibble::as_tibble(usage) # Skip unnesting if tidyr is not installed usage_df <- as.data.frame(usage, unnest = FALSE) ## End(Not run)## Not run: client <- connect() # Fetch the last 2 days of hits usage <- get_usage(client, from = Sys.Date() - 2, to = Sys.Date()) # Fetch usage after a specified date and convert to a data frame. usage <- get_usage( client, from = as.POSIXct("2025-05-02 12:40:00", tz = "UTC") ) # Fetch usage for a specific content item usage <- get_usage(client, content_guid = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") # Fetch all usage usage <- get_usage(client) # Convert to tibble or data frame usage_df <- tibble::as_tibble(usage) # Skip unnesting if tidyr is not installed usage_df <- as.data.frame(usage, unnest = FALSE) ## End(Not run)
Get usage information for deployed shiny applications
get_usage_shiny( src, content_guid = NULL, min_data_version = NULL, from = NULL, to = NULL, limit = 500, previous = NULL, nxt = NULL, asc_order = TRUE )get_usage_shiny( src, content_guid = NULL, min_data_version = NULL, from = NULL, to = NULL, limit = 500, previous = NULL, nxt = NULL, asc_order = TRUE )
src |
the source object |
content_guid |
Filter results by content GUID |
min_data_version |
Filter by data version. Records with a data version lower than the given value will be excluded from the set of results. |
from |
The timestamp that starts the time window of interest. Any usage information that ends prior to this timestamp will not be returned. Individual records may contain a starting time that is before this if they end after it or have not finished. Must be of class Date or POSIX |
to |
The timestamp that ends the time window of interest. Any usage information that starts after this timestamp will not be returned. Individual records may contain an ending time that is after this (or no ending time) if they start before it. Must be of class Date or POSIX |
limit |
The number of records to return. |
previous |
Retrieve the previous page of Shiny application usage logs relative to the provided value. This value corresponds to an internal reference within the server and should be sourced from the appropriate attribute within the paging object of a previous response. |
nxt |
Retrieve the next page of Shiny application usage logs relative to the provided value. This value corresponds to an internal reference within the server and should be sourced from the appropriate attribute within the paging object of a previous response. |
asc_order |
Defaults to TRUE; Determines if the response records should be listed in ascending or descending order within the response. Ordering is by the started timestamp field. |
Please see https://docs.posit.co/connect/api/#get-/v1/instrumentation/shiny/usage for more information.
A tibble with the following columns:
content_guid: The GUID, in RFC4122 format, of the
Shiny application this information pertains to.
user_guid: The GUID, in RFC4122 format, of the user
that visited the application.
started: The timestamp, in RFC3339 format, when the
user opened the application.
ended: The timestamp, in RFC3339 format, when the
user left the application.
data_version: The data version the record was recorded
with. The Shiny Application Events section of the Posit Connect Admin
Guide explains how to interpret data_version values.
## Not run: library(connectapi) client <- connect() from <- Sys.Date() - lubridate::days(5) get_usage_shiny(client, limit = 20, from = from) ## End(Not run)## Not run: library(connectapi) client <- connect() from <- Sys.Date() - lubridate::days(5) get_usage_shiny(client, limit = 20, from = from) ## End(Not run)
This function retrieves usage information from static content on the Posit Connect server (e.g. Rmarkdown, Jupyter Notebooks)
get_usage_static( src, content_guid = NULL, min_data_version = NULL, from = NULL, to = NULL, limit = 500, previous = NULL, nxt = NULL, asc_order = TRUE )get_usage_static( src, content_guid = NULL, min_data_version = NULL, from = NULL, to = NULL, limit = 500, previous = NULL, nxt = NULL, asc_order = TRUE )
src |
the source object |
content_guid |
Filter results by content GUID |
min_data_version |
Filter by data version. Records with a data version lower than the given value will be excluded from the set of results. |
from |
The timestamp that starts the time window of interest. Any usage information that ends prior to this timestamp will not be returned. Individual records may contain a starting time that is before this if they end after it or have not finished. Must be of class Date or POSIX |
to |
The timestamp that ends the time window of interest. Any usage information that starts after this timestamp will not be returned. Individual records may contain an ending time that is after this (or no ending time) if they start before it. Must be of class Date or POSIX |
limit |
The number of records to return. |
previous |
Retrieve the previous page of Shiny application usage logs relative to the provided value. This value corresponds to an internal reference within the server and should be sourced from the appropriate attribute within the paging object of a previous response. |
nxt |
Retrieve the next page of Shiny application usage logs relative to the provided value. This value corresponds to an internal reference within the server and should be sourced from the appropriate attribute within the paging object of a previous response. |
asc_order |
Defaults to TRUE; Determines if the response records should be listed in ascending or descending order within the response. Ordering is by the started timestamp field. |
Please see https://docs.posit.co/connect/api/#get-/v1/instrumentation/content/visits for more information.
A tibble with the following columns:
content_guid: The GUID, in RFC4122 format, of the Shiny
application this information pertains to.
user_guid: The GUID, in RFC4122 format, of the user that
visited the application.
variant_key: The key of the variant the user visited.
This will be null for static content.
time: The timestamp, in RFC3339 format, when the user
visited the content.
rendering_id: The ID of the rendering the user visited.
This will be null for static content.
bundle_id: The ID of the particular bundle used.
data_version: The data version the record was recorded
with. The Rendered and Static Content Visit Events section of the
Posit Connect Admin Guide explains how to interpret data_version
values.
## Not run: library(connectapi) client <- connect() from <- Sys.Date() - lubridate::days(5) get_usage_static(client, limit = 20, from = from) ## End(Not run)## Not run: library(connectapi) client <- connect() from <- Sys.Date() - lubridate::days(5) get_usage_static(client, limit = 20, from = from) ## End(Not run)
Get user information from the Posit Connect server
get_users( src, page_size = 500, prefix = NULL, limit = Inf, user_role = NULL, account_status = NULL )get_users( src, page_size = 500, prefix = NULL, limit = Inf, user_role = NULL, account_status = NULL )
src |
The source object |
page_size |
the number of records to return per page (max 500) |
prefix |
Filters users by prefix (username, first name, or last name). The filter is case insensitive. |
limit |
The max number of records to return |
user_role |
Optionally filter by user role ("administrator",
"publisher", "viewer"). Pass in a vector of multiple roles to match any value
(boolean OR). When |
account_status |
Optionally filter by account status ("locked",
"licensed", "inactive"). Pass a vector of multiple statuses to match any
value (boolean OR). When |
Please see https://docs.posit.co/connect/api/#get-/v1/users for more information.
A tibble with the following columns:
email: The user's email
username: The user's username
first_name: The user's first name
last_name: The user's last name
user_role: The user's role. It may have a value of administrator,
publisher or viewer.
created_time: The timestamp (in RFC3339 format) when the user was
created in the Posit Connect server
updated_time: The timestamp (in RFC3339 format) when the user was last
updated in the Posit Connect server
active_time: The timestamp (in RFC3339 format) when the user was last
active on the Posit Connect server
confirmed: When false, the created user must confirm their account
through an email. This feature is unique to password authentication.
locked: Whether or not the user is locked
guid: The user's GUID, or unique identifier, in UUID RFC4122 format
## Not run: library(connectapi) client <- connect() # Get all users get_users(client) # Get all licensed users get_users(client, account_status = "licensed") # Get all users who are administrators or publishers get_users(client, user_role = c("administrator", "publisher")) ## End(Not run)## Not run: library(connectapi) client <- connect() # Get all users get_users(client) # Get all licensed users get_users(client, account_status = "licensed") # Get all users who are administrators or publishers get_users(client, user_role = c("administrator", "publisher")) ## End(Not run)
Get the vanity URL for a piece of content.
get_vanity_url(content)get_vanity_url(content)
content |
A Content object |
A character string (or NULL if not defined)
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Get a table of all vanity URLs on the server. Requires administrator privileges.
get_vanity_urls(client)get_vanity_urls(client)
client |
A |
A tibble with columns for content_guid, path, and
created_time.
## Not run: library(connectapi) client <- connect() get_vanity_urls(client) ## End(Not run)## Not run: library(connectapi) client <- connect() get_vanity_urls(client) ## End(Not run)
Get details about renderings (i.e. render history)
or execute a variant on demand
get_variant_renderings(variant) variant_render(variant)get_variant_renderings(variant) variant_render(variant)
variant |
An R6 Variant object. As returned by |
get_variant_renderings() returns all renderings / content for a particular variant. Returns a tibble
variant_render() executes a variant on demand. Returns a VariantTask object
Other variant functions:
get_variants()
Gets the schedule associated with a Variant.
get_variant_schedule(variant)get_variant_schedule(variant)
variant |
A Variant object, as returned by |
A VariantSchedule object
Other schedule functions:
get_timezones(),
set_schedule()
get_variants(content) get_variant(content, key) get_variant_default(content)get_variants(content) get_variant(content, key) get_variant_default(content)
content |
An R6 Content object. Returned from |
key |
The Variant key for a specific variant |
get_variants() returns a tibble with variant data for a content_item
get_variant_default() returns the default variant for a content_item
get_variant() returns a specific variant for a content_item (specified by key)
Other variant functions:
get_variant_renderings()
These functions help use Posit Connect's
configured authorization to query available branches and subdirectories for
deployment using
deploy_repo()
repo_check_account(client, host) repo_check_branches(client, repository) repo_check_branches_ref(client, repository) repo_check_manifest_dirs(client, repository, branch)repo_check_account(client, host) repo_check_branches(client, repository) repo_check_branches_ref(client, repository) repo_check_manifest_dirs(client, repository, branch)
client |
A Connect R6 object |
host |
The git repository host (with schema). For example, "https://github.com" |
repository |
The git repository to explore or consider deploying |
branch |
The git branch to explore for subdirectories |
repo_check_account() messages whether an account is in use, and then returns that account
repo_check_branches() retrieves which branches are available, returning in a named list
repo_check_manifest_dirs() retrieves which directories contain a
manifest.json, returning in a named list
connectapi::deploy_repo
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Create a Remote Group
groups_create_remote(connect, prefix, expect = 1, check = TRUE, exact = FALSE)groups_create_remote(connect, prefix, expect = 1, check = TRUE, exact = FALSE)
connect |
An R6 Connect object. |
prefix |
character. The prefix of the user name to search for. |
expect |
number. Optional. The number of responses to expect for this search. |
check |
boolean. Optional. Whether to check for local existence first. |
exact |
boolean. Optional. Whether to only create groups whose name
exactly matches the provided |
The results of creating the groups.
Check whether a content item has a thumbnail.
has_thumbnail(content)has_thumbnail(content)
content |
A content item. |
TRUE if the content item has a thumbnail, otherwise FALSE.
Throws an error if you do not have permission to view the thumbnail.
Other thumbnail functions:
delete_thumbnail(),
get_thumbnail(),
set_thumbnail()
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: client <- connect() item <- content_item(client, "8f37d6e0-3395-4a2c-aa6a-d7f2fe1babd0") has_thumbnail(item) ## End(Not run)## Not run: client <- connect() item <- content_item(client, "8f37d6e0-3395-4a2c-aa6a-d7f2fe1babd0") has_thumbnail(item) ## End(Not run)
Lock or unlock a content item. When content is locked, all processes are terminated, rendering is disabled, and new bundles cannot be deployed.
lock_content(content, locked_message = "") unlock_content(content)lock_content(content, locked_message = "") unlock_content(content)
content |
An R6 content item |
locked_message |
Optional. A custom message that is displayed by the content item when locked. It is possible to format this message using Markdown. |
lock_content() locks a content item with an optional message displayed to
visitors (supports Markdown).
unlock_content() unlocks a content item, reverting the effects of locking.
An R6 content item
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: # Lock content with a message client <- connect() content <- content_item(client, "content-guid") content <- lock_content(content, locked_message = "Ah ah ah! You didn't say the magic word!") # Lock content without a message content <- lock_content(content) # Unlock content content <- unlock_content(content) ## End(Not run)## Not run: # Lock content with a message client <- connect() content <- content_item(client, "content-guid") content <- lock_content(content, locked_message = "Ah ah ah! You didn't say the magic word!") # Lock content without a message content <- lock_content(content) # Unlock content content <- unlock_content(content) ## End(Not run)
Helper functions that make paging easier in the Posit Connect Server API.
page_cursor(client, req, limit = Inf) page_offset(client, req, limit = Inf)page_cursor(client, req, limit = Inf) page_offset(client, req, limit = Inf)
client |
A Connect client object |
req |
For page_cursor, the output from an initial response to an API endpoint that uses cursor-based pagination. For page_offset, a request that needs to be paged. |
limit |
A row limit |
The aggregated results from all requests
Get or set content permissions for a content item
content_add_user(content, guid, role = c("viewer", "owner")) content_add_group(content, guid, role = c("viewer", "owner")) content_delete_user(content, guid) content_delete_group(content, guid) get_user_permission(content, guid, add_owner = TRUE) get_my_permission(content, add_owner = TRUE) get_group_permission(content, guid) get_content_permissions(content, add_owner = TRUE)content_add_user(content, guid, role = c("viewer", "owner")) content_add_group(content, guid, role = c("viewer", "owner")) content_delete_user(content, guid) content_delete_group(content, guid) get_user_permission(content, guid, add_owner = TRUE) get_my_permission(content, add_owner = TRUE) get_group_permission(content, guid) get_content_permissions(content, add_owner = TRUE)
content |
An R6 content object |
guid |
The guid associated with either a user (for |
role |
The role to assign to a user. Either "viewer" or "owner." Defaults to "viewer" |
add_owner |
Optional. Whether to include the owner in returned permission sets. Default is TRUE. The owner will have an NA_character_ permission "id" |
Permission modification:
content_add_* adds a permission to the content
content_delete_* removes a permission from the content
Permission retrieval:
get_content_permissions() lists permissions
get_my_permission() gets the permission associated with the caller.
get_user_permission() gets the permissions associated with a given user.
It does not evaluate group memberships
get_group_permission() gets the permissions associated with a given
group.
NOTE: by default, the owner is injected with an "NA_character_" permission id. This makes it easier to find / isolate this record.
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Polls a task, waiting for information about a deployment. If the task has
results, the output will be a modified "Task" object with task$get_data()
available to retrieve the results.
poll_task(task, wait = 1, callback = message)poll_task(task, wait = 1, callback = message)
task |
A Task object |
wait |
The interval to wait between polling |
callback |
A function to be called for each message received. Set to NULL for no callback |
For a simple way to silence messages, set callback = NULL
Task The Task object that was input
Other deployment functions:
bundle_dir(),
bundle_path(),
bundle_static(),
deploy(),
download_bundle()
Class representing a Connect API client
client <- Connect$new(server = 'connect.example.com', api_key = 'mysecretkey') get_content(client) client$get_tags()
This class allows a user to interact with a Connect server via the Connect API. Authentication is done by providing an API key.
serverThe base URL of your Posit Connect server.
api_keyYour Posit Connect API key.
tagsThe initial set of tags.
tag_mapThe initial tag map.
httr_additionsAn initial set of httr configuration added to each HTTP call.
using_authIndicates that the API key is added to each HTTP call.
versionThe server version.
timezonesThe server timezones.
Connect$new()Initialize a new connect.
Connect$new(server, api_key)
serverThe base URL of your Posit Connect server.
api_keyYour Posit Connect API key.
Connect$httr_config()Set additional httr configuration that is added to each HTTP call.
Connect$httr_config(...)
...Set of httr configurations.
Connect$print()Print details about this instance.
Connect$print(...)
...Ignored.
Connect$raise_error()Raise an error when the HTTP result is an HTTP error.
Connect$raise_error(res)
resHTTP result.
Connect$add_auth()Returns HTTP authorization headers, or NULL when none are used.
Connect$add_auth()
Connect$api_url()Build a URL relative to the API root
Connect$api_url(...)
...path segments
Connect$server_url()Build a URL relative to the server root
Connect$server_url(...)
...path segments
Connect$request()General wrapper around httr verbs
Connect$request(method, url, ..., parser = "parsed", simplify = FALSE)
methodHTTP request method
urlURL to request
...Additional arguments passed to the request function
parserHow the response is parsed. If NULL, the httr_response
will be returned. Otherwise, the argument is forwarded to
httr::content(res, as = parser).
simplifyLogical; if TRUE, JSON arrays of objects are
simplified to data frames by jsonlite. Default FALSE preserves
list-of-lists for compatibility with pagination helpers.
Connect$GET()Perform an HTTP GET request of the named API path.
Connect$GET( path, ..., url = self$api_url(path), parser = "parsed", simplify = FALSE )
pathAPI path relative to the server's /__api__ root.
...Arguments to httr::GET()
urlTarget URL. Default uses path, but provide url to request
a server resource that is not under /__api__
parserHow the response is parsed. If NULL, the httr_response
will be returned. Otherwise, the argument is forwarded to
httr::content(res, as = parser).
simplifyLogical; if TRUE, JSON arrays of objects are
simplified to data frames by jsonlite. Default FALSE preserves
list-of-lists for compatibility with pagination helpers.
Connect$PUT()Perform an HTTP PUT request of the named API path.
Connect$PUT(
path,
body = "{}",
...,
url = self$api_url(path),
encode = "json",
parser = "parsed"
)
pathAPI path relative to the server's /__api__ root.
bodyThe HTTP payload.
...Arguments to httr::PUT()
urlTarget URL. Default uses path, but provide url to request
a server resource that is not under /__api__
encodeHow the payload is encoded.
parserHow the response is parsed. If NULL, the httr_response
will be returned. Otherwise, the argument is forwarded to
httr::content(res, as = parser).
Connect$HEAD()Perform an HTTP HEAD request of the named API path.
Connect$HEAD(path, ..., url = self$api_url(path))
pathAPI path relative to the server's /__api__ root.
...Arguments to httr::HEAD()
urlTarget URL. Default uses path, but provide url to request
a server resource that is not under /__api__
httr::content(res, as = parser).
Connect$DELETE()Perform an HTTP DELETE request of the named API path. Returns the HTTP response object.
Connect$DELETE(path, ..., url = self$api_url(path), parser = NULL)
pathAPI path relative to the server's /__api__ root.
...Arguments to httr::DELETE()
urlTarget URL. Default uses path, but provide url to request
a server resource that is not under /__api__
parserHow the response is parsed. If NULL, the httr_response
will be returned. Otherwise, the argument is forwarded to
httr::content(res, as = parser).
Connect$PATCH()Perform an HTTP PATCH request of the named API path.
Connect$PATCH(
path,
body = "{}",
...,
url = self$api_url(path),
encode = "json",
parser = "parsed"
)
pathAPI path relative to the server's /__api__ root.
bodyThe HTTP payload.
...Arguments to httr::PATCH()
urlTarget URL. Default uses path, but provide url to request
a server resource that is not under /__api__
encodeHow the payload is encoded.
parserHow the response is parsed. If NULL, the httr_response
will be returned. Otherwise, the argument is forwarded to
httr::content(res, as = parser).
Connect$POST()Perform an HTTP POST request of the named API path.
Connect$POST(
path,
body = "{}",
...,
url = self$api_url(path),
encode = "json",
parser = "parsed"
)
pathAPI path relative to the server's /__api__ root.
bodyThe HTTP payload.
...Arguments to httr::POST()
urlTarget URL. Default uses path, but provide url to request
a server resource that is not under /__api__
encodeHow the payload is encoded.
parserHow the response is parsed. If NULL, the httr_response
will be returned. Otherwise, the argument is forwarded to
httr::content(res, as = parser).
Connect$me()Perform an HTTP GET request of the "me" server endpoint.
Connect$me()
Connect$get_dashboard_url()Return the base URL of the Connect server.
Connect$get_dashboard_url()
Connect$get_tags()Return all tags.
Connect$get_tags(use_cache = FALSE)
use_cacheIndicates that a cached set of tags is used.
Connect$get_tag_id()Get the identifier for the named tag.
Connect$get_tag_id(tagname)
tagnameThe name of the tag.
Connect$get_tag_tree()Get the tag tree.
Connect$get_tag_tree()
Connect$tag_create_safe()Create a tag.
Connect$tag_create_safe(name, parent_id = NULL)
nameThe tag name.
parent_idThe parent identifier.
Connect$tag_create()Create a tag.
Connect$tag_create(name, parent_id = NULL)
nameThe tag name.
parent_idThe parent identifier.
Connect$tag()Get a tag.
Connect$tag(id = NULL)
idThe tag identifier.
Connect$tag_delete()Delete a tag.
Connect$tag_delete(id)
idThe tag identifier.
Connect$get_schedule()Get a schedule.
Connect$get_schedule(schedule_id)
schedule_idThe schedule identifier.
Connect$content_create()Create content.
Connect$content_create(name, title = name, ...)
nameThe content name.
titleThe content title.
...Other content fields.
Connect$content_upload()Upload a content bundle.
Connect$content_upload(bundle_path, guid)
bundle_pathThe path to the bundle archive.
guidThe content GUID.
Connect$content_deploy()Deploy a content bundle.
Connect$content_deploy(guid, bundle_id)
guidThe content GUID.
bundle_idThe bundle identifier.
Connect$content()Get a content item.
Connect$content( guid = NULL, owner_guid = NULL, name = NULL, include = "tags,owner" )
guidThe content GUID.
owner_guidThe target content owner.
nameThe target name.
includeAdditional response fields.
Connect$task()Get a task.
Connect$task(task_id, first = 0, wait = 5)
task_idThe task identifier.
firstThe initial status position.
waitMaximum time to wait for update.
Connect$set_content_tag()Set a tag for a content item.
Connect$set_content_tag(content_id, tag_id)
content_idThe content identifier.
tag_idThe tag identifier.
Connect$remove_content_tag()Remove a tag from a content item.
Connect$remove_content_tag(content_id, tag_id)
content_idThe content identifier.
tag_idThe tag identifier.
Connect$user()Get user details.
Connect$user(guid)
guidThe user GUID.
Connect$users()Get users.
Connect$users( page_number = 1, prefix = NULL, page_size = 500, user_role = NULL, account_status = NULL )
page_numberThe page number.
prefixThe search term.
page_sizeThe page size.
user_roleFilter by user role.
account_statusFilter by account status.
Connect$users_remote()Get remote users.
Connect$users_remote(prefix)
prefixThe search term.
Connect$users_create()Create a user.
Connect$users_create( username, email, first_name = NULL, last_name = NULL, password = NULL, user_must_set_password = NULL, user_role = NULL, unique_id = NULL )
usernameThe username.
emailEmail address.
first_nameFirst name.
last_nameLast name.
passwordThe password.
user_must_set_passwordIndicates that user sets password on first login.
user_roleRole for user.
unique_idIdentifier for user.
Connect$users_create_remote()Create a remote user.
Connect$users_create_remote(temp_ticket)
temp_ticketTicket identifying target remote user.
Connect$users_lock()Lock a user.
Connect$users_lock(user_guid)
user_guidUser GUID.
Connect$users_unlock()Unlock a user.
Connect$users_unlock(user_guid)
user_guidUser GUID.
Connect$users_update()Update a user.
Connect$users_update(user_guid, ...)
user_guidUser GUID.
...User fields.
Connect$groups()Get groups.
Connect$groups(page_number = 1, prefix = NULL, page_size = 500)
page_numberThe page number.
prefixThe search term.
page_sizeThe page size.
Connect$group_members()Get group members.
Connect$group_members(guid)
guidThe group GUID.
Connect$group_member_add()Add a group member.
Connect$group_member_add(group_guid, user_guid)
group_guidThe group GUID.
user_guidThe user GUID.
Connect$group_member_remove()Remove a group member.
Connect$group_member_remove(group_guid, user_guid)
group_guidThe group GUID.
user_guidThe user GUID.
Connect$groups_create()Create a group.
Connect$groups_create(name)
nameThe group name.
Connect$groups_create_remote()Create a remote group.
Connect$groups_create_remote(temp_ticket)
temp_ticketTicket identifying target remote group.
Connect$groups_remote()Get remote groups.
Connect$groups_remote(prefix = NULL, limit = 500)
prefixThe search term.
limitThe maximal result set size.
Connect$group_content()Get content to which a group has access
Connect$group_content(guid)
guidThe group GUID.
Connect$inst_content_visits()Get (non-interactive) content visits.
Connect$inst_content_visits( content_guid = NULL, min_data_version = NULL, from = NULL, to = NULL, limit = 500, previous = NULL, nxt = NULL, asc_order = TRUE )
content_guidContent GUID.
min_data_versionData version for request.
fromStart of range.
toEnd of range.
limitResult set size.
previousPrevious item.
nxtNext item.
asc_orderIndicates ascending result order.
Connect$inst_shiny_usage()Get interactive content visits.
Get (non-interactive) content visits.
Connect$inst_shiny_usage( content_guid = NULL, min_data_version = NULL, from = NULL, to = NULL, limit = 500, previous = NULL, nxt = NULL, asc_order = TRUE )
content_guidContent GUID.
min_data_versionData version for request.
fromStart of range.
toEnd of range.
limitResult set size.
previousPrevious item.
nxtNext item.
asc_orderIndicates ascending result order.
Connect$procs()Get running processes.
Connect$procs()
Connect$repo_account()Determine if Git repository is associated with authorization.
Connect$repo_account(host)
hostRepository URL.
Connect$repo_branches()Get Git repository branches.
Connect$repo_branches(repo)
repoRepository URL.
Connect$repo_manifest_dirs()Get Git repository directories.
Connect$repo_manifest_dirs(repo, branch)
repoRepository URL.
branchRepository branch.
Connect$schedules()Get schedules.
Connect$schedules( start = Sys.time(), end = Sys.time() + 60 * 60 * 24 * 7, detailed = FALSE )
startStarting time.
endEnding time.
detailedIndicates detailed schedule information.
Connect$packages()Get packages. This endpoint is paginated.
Connect$packages(name = NULL, page_number = 1, page_size = 1e+05)
nameThe package name to filter by.
page_numberPage number.
page_sizePage size, default 100000.
Connect$docs()Get documentation.
Connect$docs(docs = "api", browse = TRUE)
docsNamed document.
browseOpen a browser.
Connect$audit_logs()Get auditing.
Connect$audit_logs(limit = 500, previous = NULL, nxt = NULL, asc_order = TRUE)
limitResult set size.
previousPrevious item.
nxtNext item.
asc_orderIndicates ascending result order.
Connect$vanities()Get all vanity URLs
Connect$vanities()
Connect$server_settings()Get server settings.
Connect$server_settings()
Connect$clone()The objects of this class are cloneable with this method.
Connect$clone(deep = FALSE)
deepWhether to make a deep clone.
Other R6 classes:
Bundle,
Content,
ContentTask,
Environment,
Task,
Vanity,
Variant,
VariantSchedule,
VariantTask
Promote content from one Connect server to another
promote(from, to, to_key, from_key, name)promote(from, to, to_key, from_key, name)
from |
The url for the server containing the content (the originating server) |
to |
The url for the server where the content will be deployed (the destination server) |
to_key |
An API key on the destination "to" server. If the destination content is going to be updated, the API key must belong to a user with collaborator access on the content that will be updated. If the destination content is to be created new, the API key must belong to a user with publisher privileges. |
from_key |
An API key on the originating "from" server. The API key must belong to a user with collaborator access to the content to be promoted. |
name |
The name of the content on the originating "from" server. If content with the same name is found on the destination server, the content will be updated. If no content on the destination server has a matching name, a new endpoint will be created. |
The URL for the content on the destination "to" server
Search for content on the Connect server
search_content( client, q = NULL, include = "owner,vanity_url", page_size = 500, limit = Inf, ... )search_content( client, q = NULL, include = "owner,vanity_url", page_size = 500, limit = Inf, ... )
client |
A Connect object |
q |
The search query, using the syntax described in the Connect documentation on content search terms |
include |
Comma-separated character string of values indicating additional
details to include in the response. Values can be |
page_size |
The number of items to fetch per page. Maximum is 500. |
limit |
Maximum number of items to return overall. Defaults to |
... |
Additional query parameters passed to the API for future expansion.
Note: If you pass |
Please see https://docs.posit.co/connect/api/#get-/v1/search/content for more information.
A list of Content objects, of class "connect_content_list"
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: library(connectapi) client <- connect() my_content <- search_content(client, q = "owner:@me") shiny_content <- purrr::keep(my_content, function(x) { x$content$app_mode == "rmd-shiny" }) purrr::map(shiny_content, lock_content) ## End(Not run)## Not run: library(connectapi) client <- connect() my_content <- search_content(client, q = "owner:@me") shiny_content <- purrr::keep(my_content, function(x) { x$content$app_mode == "rmd-shiny" }) purrr::map(shiny_content, lock_content) ## End(Not run)
Removes all existing OAuth integrations associated with a content item, and creates associations with the integrations provided. You must have administrator or publisher privileges to perform this action.
set_integrations(content, integrations)set_integrations(content, integrations)
content |
A |
integrations |
The complete set of integrations to be associated with the
content. May be a single |
Invisibly returns NULL.
get_integrations(), get_integration(), get_associations(), content_item()
Other oauth integration functions:
create_integration(),
delete_integration(),
get_associations(),
get_integration(),
get_integrations(),
update_integration()
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: client <- connect() content <- content_item(client, "12345678-90ab-cdef-1234-567890abcdef") integrations <- get_integrations(client) # Associate a single integration github_integration <- purrr::keep(integrations, \(x) x$template == "github")[[1]] set_integrations(content, github_integration) # Associate multiple integrations at once selected_integrations <- integrations[1:2] set_integrations(content, selected_integrations) # Unset integrations set_integrations(content, NULL) ## End(Not run)## Not run: client <- connect() content <- content_item(client, "12345678-90ab-cdef-1234-567890abcdef") integrations <- get_integrations(client) # Associate a single integration github_integration <- purrr::keep(integrations, \(x) x$template == "github")[[1]] set_integrations(content, github_integration) # Associate multiple integrations at once selected_integrations <- integrations[1:2] set_integrations(content, selected_integrations) # Unset integrations set_integrations(content, NULL) ## End(Not run)
Set the RunAs user for a piece of content.
The run_as_current_user flag only does anything if:
set_run_as(content, run_as, run_as_current_user = FALSE)set_run_as(content, run_as, run_as_current_user = FALSE)
content |
an R6 Content item |
run_as |
The RunAs user to use for this content |
run_as_current_user |
Whether to run this content as the viewer of the application |
PAM is the authentication method
Applications.RunAsCurrentUser is enabled on the server
Also worth noting that the run_as user must exist on the Posit Connect
server (as a linux user) and have appropriate group memberships, or you will
get a 400: Bad Request. Set to NULL to use the default RunAs user / unset
any current configuration.
To "read" the current RunAs user, use the Content object or get_content() function.
a Content object, updated with new details
connectapi::content_update
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
Sets the schedule for a given Variant. Requires a
Schedule object (as returned by get_variant_schedule())
set_schedule(.schedule, ...) set_schedule_minute( .schedule, n = 30, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_hour( .schedule, n = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_day( .schedule, n = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_weekday( .schedule, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_week( .schedule, n = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_dayofweek( .schedule, days, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_semimonth( .schedule, first = TRUE, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_dayofmonth( .schedule, n = 1, day = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_dayweekofmonth( .schedule, n = 1, day = 1, week = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_year( .schedule, n = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_remove(.schedule) schedule_describe(.schedule)set_schedule(.schedule, ...) set_schedule_minute( .schedule, n = 30, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_hour( .schedule, n = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_day( .schedule, n = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_weekday( .schedule, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_week( .schedule, n = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_dayofweek( .schedule, days, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_semimonth( .schedule, first = TRUE, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_dayofmonth( .schedule, n = 1, day = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_dayweekofmonth( .schedule, n = 1, day = 1, week = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_year( .schedule, n = 1, start_time = Sys.time(), activate = TRUE, email = FALSE, timezone = Sys.timezone() ) set_schedule_remove(.schedule) schedule_describe(.schedule)
.schedule |
A schedule object. As returned by |
... |
Scheduling parameters |
n |
The "number of" iterations |
start_time |
The start time of the schedule |
activate |
|
email |
Whether to send emails on this schedule |
timezone |
The timezone to use for setting the schedule. Defaults to |
days |
The days of the week (0-6) |
first |
logical Whether to execute on the 1st and 15th (TRUE) or 14th and last (FALSE) |
day |
The day of the week (0-6) or day of the month (0-31) |
week |
The week of the month (0-5) |
schedule |
A JSON blob (as a string) describing the schedule. See "More Details" |
set_schedule() is a raw interface to Posit Connect's schedule API
set_schedule_*() functions provide handy wrappers around set_schedule()
set_schedule_remove() removes a schedule / un-schedules a variant
Beware, using set_schedule() currently uses the Posit Connect schedule API
directly, and so can be a little clunky. Using the set_schedule_*() is generally
recommended.
An updated Schedule object
Other schedule functions:
get_timezones(),
get_variant_schedule()
Set the thumbnail for a content item.
set_thumbnail(content, path)set_thumbnail(content, path)
content |
A content item. |
path |
Either a path to a local file or a URL to an image available over
HTTP/HTTPS. If |
The content item (invisibly).
Other thumbnail functions:
delete_thumbnail(),
get_thumbnail(),
has_thumbnail()
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: client <- connect() item <- content_item(client, "8f37d6e0-3395-4a2c-aa6a-d7f2fe1babd0") set_thumbnail(item, "resources/image.png") ## End(Not run)## Not run: client <- connect() item <- content_item(client, "8f37d6e0-3395-4a2c-aa6a-d7f2fe1babd0") set_thumbnail(item, "resources/image.png") ## End(Not run)
Set the vanity URL for a piece of content.
set_vanity_url(content, url, force = FALSE)set_vanity_url(content, url, force = FALSE)
content |
A Content object |
url |
The path component of the URL |
force |
optional. Default FALSE. Whether to force-reassign a vanity URL that already exists |
An updated Content object
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
swap_vanity_urls(),
terminate_jobs(),
verify_content_name()
## Not run: bnd <- bundle_dir("~/my/directory") connect() %>% deploy(bnd) %>% set_vanity_url("a/vanity/url") ## End(Not run)## Not run: bnd <- bundle_dir("~/my/directory") connect() %>% deploy(bnd) %>% set_vanity_url("a/vanity/url") ## End(Not run)
Swap the vanity URLs of two pieces of content.
swap_vanity_urls(content_a, content_b)swap_vanity_urls(content_a, content_b)
content_a |
A Content object |
content_b |
A Content object |
A list of the new vanity URLs for content_a and content_b
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
terminate_jobs(),
verify_content_name()
An R6 class that represents a Task
connectThe Connect instance.
taskThe task.
dataThe task data.
Task$new()Initialize this task.
Task$new(connect, task)
connectThe Connect instance.
taskThe task data.
Task$get_task()Return the underlying task.
Task$get_task()
Task$add_data()Set the data.
Task$add_data(data)
dataThe data.
Task$get_data()Get the data.
Task$get_data()
Task$print()Print this object.
Task$print(...)
...Unused.
Task$clone()The objects of this class are cloneable with this method.
Task$clone(deep = FALSE)
deepWhether to make a deep clone.
Other R6 classes:
Bundle,
Content,
ContentTask,
Environment,
PositConnect,
Vanity,
Variant,
VariantSchedule,
VariantTask
A lazy tibble that automatically pages through API requests when
collected.
tbl_connect( src, from = c("users", "groups", "content", "usage_shiny", "usage_static", "audit_logs"), ... )tbl_connect( src, from = c("users", "groups", "content", "usage_shiny", "usage_static", "audit_logs"), ... )
src |
The source object |
from |
The type of tibble |
... |
Additional arguments that are not yet implemented |
A tbl_connect object
Register a job kill order for one or more jobs associated with a content item. Requires Connect 2022.10.0 or newer.
terminate_jobs(content, keys = NULL)terminate_jobs(content, keys = NULL)
content |
A Content object, as returned by |
keys |
Optional. One or more job keys, which can be obtained using
|
A data frame with the status of each termination request.
app_id: The content item's identifier.
app_guid: The content item's GUID.
job_key: The job key.
job_id: The job's identifier.
result: The result string returned by Connect.
code: An error code, NA if the request was successful.
error: An error message, NA if the result was successful.
Note that app_id, app_guid, job_id, and result are NA if the
request returns an error.
Other job functions:
get_jobs(),
get_log()
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
verify_content_name()
## Not run: client <- connect() item <- content_item(client, "951bf3ad-82d0-4bca-bba8-9b27e35c49fa") result <- terminate_jobs(item) ## End(Not run)## Not run: client <- connect() item <- content_item(client, "951bf3ad-82d0-4bca-bba8-9b27e35c49fa") result <- terminate_jobs(item) ## End(Not run)
Updates an existing OAuth integration. All fields except integration are optional,
and are unchanged if not provided.
You must have administrator privileges to perform this action.
See the Posit Connect documentation on OAuth integrations for more information.
update_integration( integration, name = NULL, description = NULL, template = NULL, config = NULL )update_integration( integration, name = NULL, description = NULL, template = NULL, config = NULL )
integration |
A |
name |
A new name for the integration. |
description |
A new description for the integration. |
template |
The template to use (generally not changed after creation). |
config |
A list with updated OAuth integration configuration. If |
A connect_integration object representing the updated OAuth
integration. See get_integration() for details on the returned object.
get_integrations(), get_integration(), create_integration(),
delete_integration()
Other oauth integration functions:
create_integration(),
delete_integration(),
get_associations(),
get_integration(),
get_integrations(),
set_integrations()
## Not run: client <- connect() # Get an existing integration integration <- get_integration(client, "your-integration-guid") # Update the integration's name and description updated_integration <- update_integration( integration, name = "Updated GitHub Integration", description = "A more descriptive description." ) # Update only the client secret in the configuration updated_integration <- update_integration( integration, config = list( client_secret = "your-new-client-secret" ) ) ## End(Not run)## Not run: client <- connect() # Get an existing integration integration <- get_integration(client, "your-integration-guid") # Update the integration's name and description updated_integration <- update_integration( integration, name = "Updated GitHub Integration", description = "A more descriptive description." ) # Update only the client secret in the configuration updated_integration <- update_integration( integration, config = list( client_secret = "your-new-client-secret" ) ) ## End(Not run)
Get user details
user_guid_from_username(client, username)user_guid_from_username(client, username)
client |
A Connect R6 object |
username |
The user's username |
user_guid_from_username() is a helper to retrieve a user GUID, given the
user's username. It is useful in Shiny applications for using session$user
The remote user creation workflow involves authentication providers like LDAP
that involve a queryable identity store. This helper wraps the API calls
necessary to retrieve information about and then create such a user. It
functions with a "fuzzy match" prefix by default, but if you want to
instantiate users directly, you should set exact = TRUE.
users_create_remote(connect, prefix, expect = 1, check = TRUE, exact = FALSE)users_create_remote(connect, prefix, expect = 1, check = TRUE, exact = FALSE)
connect |
An R6 Connect object. |
prefix |
character. The prefix of the user name to search for. |
expect |
number. Optional. The number of responses to expect for this search. |
check |
boolean. Optional. Whether to check for local existence first. |
exact |
boolean. Optional. Whether to only create users whose username
exactly matches the provided |
NOTE: there can be problems with usernames that are not unique. Please open an issue if you run into any problems.
The results of creating the users.
An R6 class that represents a Vanity URL
Content -> Vanity
vanityThe vanity.
Content$bundle_delete()Content$bundle_download()Content$danger_delete()Content$deploy()Content$environment()Content$environment_all()Content$environment_set()Content$get_bundles()Content$get_content_remote()Content$get_dashboard_url()Content$get_url()Content$jobs()Content$packages()Content$permissions()Content$permissions_add()Content$permissions_delete()Content$permissions_update()Content$register_job_kill_order()Content$repo_enable()Content$repo_set()Content$repository()Content$tag_delete()Content$tag_set()Content$tags()Content$update()Content$variants()Vanity$new()Initialize this vanity.
Vanity$new(connect, content, vanity)
connectThe Connect instance.
contentThe Content instance.
vanityThe vanity data.
Vanity$get_vanity()Return the underlying vanity.
Vanity$get_vanity()
Vanity$print()Print this object.
Vanity$print(...)
...Unused.
Vanity$clone()The objects of this class are cloneable with this method.
Vanity$clone(deep = FALSE)
deepWhether to make a deep clone.
Other R6 classes:
Bundle,
Content,
ContentTask,
Environment,
PositConnect,
Task,
Variant,
VariantSchedule,
VariantTask
vanity_is_available(connect, vanity)vanity_is_available(connect, vanity)
connect |
A Connect R6 object |
vanity |
string of the vanity URL to check |
logical indicating if the vanity URL is available.
Other audit functions:
audit_access_open(),
audit_r_versions(),
audit_runas()
An R6 class that represents a Variant
Content -> Variant
keyThe variant key.
variantThe variant.
Content$bundle_delete()Content$bundle_download()Content$danger_delete()Content$deploy()Content$environment()Content$environment_all()Content$environment_set()Content$get_bundles()Content$get_content_remote()Content$packages()Content$permissions()Content$permissions_add()Content$permissions_delete()Content$permissions_update()Content$register_job_kill_order()Content$repo_enable()Content$repo_set()Content$repository()Content$tag_delete()Content$tag_set()Content$tags()Content$update()Content$variants()Variant$get_variant_remote()Get the underlying variant data.
Get and store the (remote) variant data.
Variant$get_variant_remote()
Variant$new()Initialize this variant.
Variant$new(connect, content, key)
connectThe Connect instance.
contentThe Content instance.
keyThe variant key.
Variant$send_mail()Mail previously rendered content.
Variant$send_mail(to = c("me", "collaborators", "collaborators_viewers"))
toTargeting.
Variant$get_schedule()Get the (remote) schedule data.
Variant$get_schedule()
Variant$get_schedule_remote()Get the (remote) schedule data.
Variant$get_schedule_remote()
Variant$get_subscribers()Get the subscribers.
Variant$get_subscribers()
Variant$remove_subscriber()Remove a named subscriber.
Variant$remove_subscriber(guid)
guidUser GUID.
Variant$add_subscribers()Add named subscribers.
Variant$add_subscribers(guids)
guidsUser GUIDs.
Variant$render()Render this variant.
Variant$render()
Variant$renderings()List the renderings of this variant.
Variant$renderings()
Variant$update_variant()Update this variant.
Variant$update_variant(...)
...Target fields and values.
Variant$jobs()Jobs for this variant.
Variant$jobs()
Variant$get_url()Return the URL for this variant.
Variant$get_url()
Variant$get_url_rev()Return the URL associated with one rendering for this variant.
Variant$get_url_rev(rev)
revRendering identifier.
Variant$get_dashboard_url()Return the URL for this variant in the Posit Connect dashboard.
Variant$get_dashboard_url(pane = "access")
paneThe pane in the dashboard to link to.
Variant$print()Print this object.
Variant$print(...)
...Unused.
Variant$clone()The objects of this class are cloneable with this method.
Variant$clone(deep = FALSE)
deepWhether to make a deep clone.
Other R6 classes:
Bundle,
Content,
ContentTask,
Environment,
PositConnect,
Task,
Vanity,
VariantSchedule,
VariantTask
An R6 class that represents a Schedule
Content -> Variant -> VariantSchedule
schedule_dataThe schedule data.
Content$bundle_delete()Content$bundle_download()Content$danger_delete()Content$deploy()Content$environment()Content$environment_all()Content$environment_set()Content$get_bundles()Content$get_content_remote()Content$packages()Content$permissions()Content$permissions_add()Content$permissions_delete()Content$permissions_update()Content$register_job_kill_order()Content$repo_enable()Content$repo_set()Content$repository()Content$tag_delete()Content$tag_set()Content$tags()Content$update()Content$variants()Variant$add_subscribers()Variant$get_dashboard_url()Variant$get_subscribers()Variant$get_url()Variant$get_url_rev()Variant$get_variant_remote()Variant$jobs()Variant$remove_subscriber()Variant$render()Variant$renderings()Variant$send_mail()Variant$update_variant()VariantSchedule$new()Initialize this schedule.
VariantSchedule$new(connect, content, key, schedule)
connectThe Connect instance.
contentThe Content instance.
keyThe variant key.
scheduleThe schedule data.
VariantSchedule$GET()Perform an HTTP GET request of the named API path. Returns an object parsed from the HTTP response.
VariantSchedule$GET(path)
pathAPI path.
VariantSchedule$POST()Perform an HTTP POST request of the named API path. Returns an object parsed from the HTTP response.
VariantSchedule$POST(path, body)
pathAPI path.
bodyThe HTTP payload.
VariantSchedule$DELETE()Perform an HTTP DELETE request of the named API path. Returns the HTTP response object.
VariantSchedule$DELETE(path)
pathAPI path.
VariantSchedule$set_schedule()Set the schedule for this variant
VariantSchedule$set_schedule(...)
...Schedule fields.
VariantSchedule$is_empty()Return if this variant has a schedule.
VariantSchedule$is_empty()
VariantSchedule$print()Print this object.
VariantSchedule$print(...)
...Unused.
VariantSchedule$get_schedule()Get the schedule data.
VariantSchedule$get_schedule()
VariantSchedule$get_schedule_remote()Get and store the (remote) schedule data.
VariantSchedule$get_schedule_remote()
VariantSchedule$describe_schedule()Description of the associated schedule.
VariantSchedule$describe_schedule()
VariantSchedule$clone()The objects of this class are cloneable with this method.
VariantSchedule$clone(deep = FALSE)
deepWhether to make a deep clone.
Other R6 classes:
Bundle,
Content,
ContentTask,
Environment,
PositConnect,
Task,
Vanity,
Variant,
VariantTask
An R6 class that represents a Variant Task
Content -> Variant -> VariantTask
taskThe task.
dataThe variant data.
Content$bundle_delete()Content$bundle_download()Content$danger_delete()Content$deploy()Content$environment()Content$environment_all()Content$environment_set()Content$get_bundles()Content$get_content_remote()Content$packages()Content$permissions()Content$permissions_add()Content$permissions_delete()Content$permissions_update()Content$register_job_kill_order()Content$repo_enable()Content$repo_set()Content$repository()Content$tag_delete()Content$tag_set()Content$tags()Content$update()Content$variants()Variant$add_subscribers()Variant$get_dashboard_url()Variant$get_schedule()Variant$get_schedule_remote()Variant$get_subscribers()Variant$get_url()Variant$get_url_rev()Variant$get_variant_remote()Variant$jobs()Variant$remove_subscriber()Variant$render()Variant$renderings()Variant$send_mail()Variant$update_variant()VariantTask$new()Initialize this variant task.
VariantTask$new(connect, content, key, task)
connectThe Connect instance.
contentThe Content instance.
keyThe variant key.
taskThe task data.
VariantTask$get_task()Return the underlying task.
VariantTask$get_task()
VariantTask$add_data()Set the data.
VariantTask$add_data(data)
dataThe data.
VariantTask$get_data()Get the data.
VariantTask$get_data()
VariantTask$print()Print this object.
VariantTask$print(...)
...Unused.
VariantTask$clone()The objects of this class are cloneable with this method.
VariantTask$clone(deep = FALSE)
deepWhether to make a deep clone.
Other R6 classes:
Bundle,
Content,
ContentTask,
Environment,
PositConnect,
Task,
Vanity,
Variant,
VariantSchedule
Ensures that a content name fits the specifications / requirements of Posit Connect. Throws an error if content name is invalid. Content names (as of the time of writing) must be between 3 and 64 alphanumeric characters, dashes, and underscores
verify_content_name(name)verify_content_name(name)
name |
The proposed content name |
The name (or an error if invalid)
connectapi::create_random_name
Other content functions:
content_delete(),
content_item(),
content_title(),
content_update(),
create_random_name(),
dashboard_url(),
delete_thumbnail(),
delete_vanity_url(),
deploy_repo(),
get_associations(),
get_bundles(),
get_environment(),
get_jobs(),
get_log(),
get_thumbnail(),
get_vanity_url(),
git,
has_thumbnail(),
lock_content(),
permissions,
search_content(),
set_integrations(),
set_run_as(),
set_thumbnail(),
set_vanity_url(),
swap_vanity_urls(),
terminate_jobs()