Class representing a Connect API client
Class representing a Connect API client
Usage
client <- Connect$new(server = 'connect.example.com',
apiKey = 'mysecretkey')
client$get_apps()
client$get_tags()
Details
This class allows a user to interact with a Connect server via the Connect API. Authentication is done by providing an API key.
See also
Other R6 classes:
Bundle
,
Content
,
ContentTask
,
Environment
,
Task
,
Vanity
,
Variant
,
VariantSchedule
,
VariantTask
Public fields
server
The base URL of your Posit Connect server.
api_key
Your Posit Connect API key.
tags
The initial set of tags.
tag_map
The initial tag map.
httr_additions
An initial set of
httr
configuration added to each HTTP call.using_auth
Indicates that the API key is added to each HTTP call.
Methods
Method GET()
Perform an HTTP GET request of the named API path.
Arguments
path
API path relative to the server's
/__api__
root....
Arguments to
httr::GET()
url
Target URL. Default uses
path
, but provideurl
to request a server resource that is not under/__api__
parser
How the response is parsed. If
NULL
, thehttr_response
will be returned. Otherwise, the argument is forwarded tohttr::content(res, as = parser)
.
Method PUT()
Perform an HTTP PUT request of the named API path.
Usage
Connect$PUT(
path,
body = "{}",
...,
url = self$api_url(path),
encode = "json",
parser = "parsed"
)
Arguments
path
API path relative to the server's
/__api__
root.body
The HTTP payload.
...
Arguments to
httr::PUT()
url
Target URL. Default uses
path
, but provideurl
to request a server resource that is not under/__api__
encode
How the payload is encoded.
parser
How the response is parsed. If
NULL
, thehttr_response
will be returned. Otherwise, the argument is forwarded tohttr::content(res, as = parser)
.
Method HEAD()
Perform an HTTP HEAD request of the named API path.
Arguments
path
API path relative to the server's
/__api__
root....
Arguments to
httr::HEAD()
url
Target URL. Default uses
path
, but provideurl
to request a server resource that is not under/__api__
httr::content(res, as = parser)
.
Method DELETE()
Perform an HTTP DELETE request of the named API path. Returns the HTTP response object.
Arguments
path
API path relative to the server's
/__api__
root....
Arguments to
httr::DELETE()
url
Target URL. Default uses
path
, but provideurl
to request a server resource that is not under/__api__
parser
How the response is parsed. If
NULL
, thehttr_response
will be returned. Otherwise, the argument is forwarded tohttr::content(res, as = parser)
.
Method PATCH()
Perform an HTTP PATCH request of the named API path.
Usage
Connect$PATCH(
path,
body = "{}",
...,
url = self$api_url(path),
encode = "json",
parser = "parsed"
)
Arguments
path
API path relative to the server's
/__api__
root.body
The HTTP payload.
...
Arguments to
httr::PATCH()
url
Target URL. Default uses
path
, but provideurl
to request a server resource that is not under/__api__
encode
How the payload is encoded.
parser
How the response is parsed. If
NULL
, thehttr_response
will be returned. Otherwise, the argument is forwarded tohttr::content(res, as = parser)
.
Method POST()
Perform an HTTP POST request of the named API path.
Usage
Connect$POST(
path,
body = "{}",
...,
url = self$api_url(path),
encode = "json",
parser = "parsed"
)
Arguments
path
API path relative to the server's
/__api__
root.body
The HTTP payload.
...
Arguments to
httr::POST()
url
Target URL. Default uses
path
, but provideurl
to request a server resource that is not under/__api__
encode
How the payload is encoded.
parser
How the response is parsed. If
NULL
, thehttr_response
will be returned. Otherwise, the argument is forwarded tohttr::content(res, as = parser)
.
Method get_tags()
Return all tags.
Method users()
Get users.
Method users_create()
Create a user.
Method users_create_remote()
Create a remote user.
Method groups_create_remote()
Create a remote group.
Method inst_content_visits()
Get (non-interactive) content visits.
Method inst_shiny_usage()
Get interactive content visits.
Get (non-interactive) content visits.