RStudio Connect 1.8.6 – Server API

[This article was first published on RStudio Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Audit Server Content with the RStudio Connect API

In 1.8.6, RStudio Connect administrators have the ability to create reports that track and manage the content on their servers. If you’ve ever wanted the answers to questions like:

  • How do I produce a list of all the content we have published to RStudio Connect?
  • Which applications can be accessed by which people and which groups?
  • Which versions of R and Python are actually being used, and by which publishers?
  • How much unpublished content is on the server, and can it be removed?
  • Which vanity URLs do we have in use across the server, and how do I list them out?

You’re not alone. We’ve had a flood of requests for making the APIs for accessing this information publicly available. Using an API key and the content enumeration endpoint, RStudio Connect administrators can now build custom reports to answer all these questions and more.

RStudio Connect Server API Showcase

Visit the RStudio Connect Server API Showcase for access to code examples and template reports that can be deployed straight to Connect.

Content Enumeration API

Retrieve detailed information about the content that is available on your Connect instance using the GET /v1/content/ endpoint. Administrators can retrieve all content items regardless of visibility and permissions.

Example Content Audit Report

Read more about content enumeration in the RStudio Connect API Cookbook.

Content Permissions API

This set of endpoints will let you manage the user permissions associated with a content item:

  • List the permissions for a specified content item with GET /v1/content/{guid}/permissions
  • Grant access to a user or group for a content item with POST /v1/content/{guid}/permissions

These permissions are used when the content item’s access_type is acl (Access Control List).

Example Content Access Audit Report

Read more about managing content access in the RStudio Connect API Cookbook.

Vanity Auditing and Management APIs

All RStudio Connect content receives a URL that includes its numerical ID at the time of deployment. Administrators and publishers (if allowed) can create “vanity paths” for content which make the content available at an additional, customized URL.

GET /v1/vanities can be used to list all defined vanity URLs on a server. You must have an API key with administrator privileges to call this endpoint.

Example Vanity URL Audit Report

In addition to auditing vanity URLs, there are also API methods for setting and deleting vanities on individual content items:

  • Use GET /v1/content/{guid}/vanity to get the vanity URL, if any, for a single content item.
  • Use PUT /v1/content/{guid}/vanity to set the vanity URL for a content item.
  • Use DELETE /v1/content/{guid}/vanity to remove the vanity URL for a content item and revert to using its numerical ID for URL construction.

If Authorization.PublishersCanManageVanities is enabled, publishers can set and delete the vanity URL for content items that they have permission to change. Otherwise, administrator permissions are required.

Read more about content organization and vanity URL management in the RStudio Connect API Cookbook.

Tag Auditing and Management APIs

Tags are the primary content organization concept available in RStudio Connect. Tags and content items have a many-to-many relationship: any content item may be associated with multiple tags, and any tag may be associated with multiple content items. This gives you the flexibility to group and organize your content in whatever way best suits your organization.

The new tag API endpoints introduce management tools for tags as well as their associations with content items.

Tag and Tagged Content Auditing:

  • List all tags with GET /v1/tags
  • List all of the content for a specified tag with GET /v1/tags/{id}/content
  • List all the tags for a specified content item with GET /v1/content/{guid}/tags

Example Tag Usage Audit Report

Read more about content organization and tag management in the RStudio Connect API Cookbook.

RStudio Connect 1.8.6

  • Return to the general announcement post to learn about more features and updates here.
  • For upgrade planning notes, continue reading more here.

To leave a comment for the author, please follow the link and comment on their blog: RStudio Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)