| PositConnect | R Documentation |
Class representing a Connect API client
Class representing a Connect API client
client <- Connect$new(server = 'connect.example.com', apiKey = 'mysecretkey') client$get_apps() 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.
new()Initialize a new connect.
Connect$new(server, api_key)
serverThe base URL of your Posit Connect server.
api_keyYour Posit Connect API key.
httr_config()Set additional httr configuration that is added to each HTTP call.
Connect$httr_config(...)
...Set of httr configurations.
print()Print details about this instance.
Connect$print(...)
...Ignored.
raise_error()Raise an error when the HTTP result is an HTTP error.
Connect$raise_error(res)
resHTTP result.
add_auth()Returns HTTP authorization headers, or NULL when none are used.
Connect$add_auth()
api_url()Build a URL relative to the API root
Connect$api_url(...)
...path segments
server_url()Build a URL relative to the server root
Connect$server_url(...)
...path segments
request()General wrapper around httr verbs
Connect$request(method, url, ..., parser = "parsed")
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).
GET()Perform an HTTP GET request of the named API path.
Connect$GET(path, ..., url = self$api_url(path), parser = "parsed")
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).
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).
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).
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).
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).
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).
me()Perform an HTTP GET request of the "me" server endpoint.
Connect$me()
get_dashboard_url()Return the base URL of the Connect server.
Connect$get_dashboard_url()
get_tags()Return all tags.
Connect$get_tags(use_cache = FALSE)
use_cacheIndicates that a cached set of tags is used.
get_tag_id()Get the identifier for the named tag.
Connect$get_tag_id(tagname)
tagnameThe name of the tag.
get_tag_tree()Get the tag tree.
Connect$get_tag_tree()
tag_create_safe()Create a tag.
Connect$tag_create_safe(name, parent_id = NULL)
nameThe tag name.
parent_idThe parent identifier.
tag_create()Create a tag.
Connect$tag_create(name, parent_id = NULL)
nameThe tag name.
parent_idThe parent identifier.
tag()Get a tag.
Connect$tag(id = NULL)
idThe tag identifier.
tag_delete()Delete a tag.
Connect$tag_delete(id)
idThe tag identifier.
get_schedule()Get a schedule.
Connect$get_schedule(schedule_id)
schedule_idThe schedule identifier.
content_create()Create content.
Connect$content_create(name, title = name, ...)
nameThe content name.
titleThe content title.
...Other content fields.
content_upload()Upload a content bundle.
Connect$content_upload(bundle_path, guid)
bundle_pathThe path to the bundle archive.
guidThe content GUID.
content_deploy()Deploy a content bundle.
Connect$content_deploy(guid, bundle_id)
guidThe content GUID.
bundle_idThe bundle identifier.
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.
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.
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.
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.
user()Get user details.
Connect$user(guid)
guidThe user GUID.
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.
users_remote()Get remote users.
Connect$users_remote(prefix)
prefixThe search term.
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.
users_create_remote()Create a remote user.
Connect$users_create_remote(temp_ticket)
temp_ticketTicket identifying target remote user.
users_lock()Lock a user.
Connect$users_lock(user_guid)
user_guidUser GUID.
users_unlock()Unlock a user.
Connect$users_unlock(user_guid)
user_guidUser GUID.
users_update()Update a user.
Connect$users_update(user_guid, ...)
user_guidUser GUID.
...User fields.
groups()Get groups.
Connect$groups(page_number = 1, prefix = NULL, page_size = 500)
page_numberThe page number.
prefixThe search term.
page_sizeThe page size.
group_members()Get group members.
Connect$group_members(guid)
guidThe group GUID.
group_member_add()Add a group member.
Connect$group_member_add(group_guid, user_guid)
group_guidThe group GUID.
user_guidThe user GUID.
group_member_remove()Remove a group member.
Connect$group_member_remove(group_guid, user_guid)
group_guidThe group GUID.
user_guidThe user GUID.
groups_create()Create a group.
Connect$groups_create(name)
nameThe group name.
groups_create_remote()Create a remote group.
Connect$groups_create_remote(temp_ticket)
temp_ticketTicket identifying target remote group.
groups_remote()Get remote groups.
Connect$groups_remote(prefix = NULL, limit = 500)
prefixThe search term.
limitThe maximal result set size.
group_content()Get content to which a group has access
Connect$group_content(guid)
guidThe group GUID.
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.
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.
procs()Get running processes.
Connect$procs()
repo_account()Determine if Git repository is associated with authorization.
Connect$repo_account(host)
hostRepository URL.
repo_branches()Get Git repository branches.
Connect$repo_branches(repo)
repoRepository URL.
repo_manifest_dirs()Get Git repository directories.
Connect$repo_manifest_dirs(repo, branch)
repoRepository URL.
branchRepository branch.
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.
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.
docs()Get documentation.
Connect$docs(docs = "api", browse = TRUE)
docsNamed document.
browseOpen a browser.
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.
vanities()Get all vanity URLs
Connect$vanities()
server_settings_r()Get R installations.
Connect$server_settings_r()
server_settings()Get server settings.
Connect$server_settings()
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.