lock_content: Lock or Unlock Content

View source: R/content.R

lock_contentR Documentation

Lock or Unlock Content

Description

Lock or unlock a content item. When content is locked, all processes are terminated, rendering is disabled, and new bundles cannot be deployed.

Usage

lock_content(content, locked_message = "")

unlock_content(content)

Arguments

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.

Details

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.

Value

An R6 content item

See Also

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_image(), get_job(), get_jobs(), get_log(), get_thumbnail(), get_vanity_url(), git, has_thumbnail(), permissions, search_content(), set_image_path(), set_integrations(), set_run_as(), set_thumbnail(), set_vanity_url(), swap_vanity_url(), swap_vanity_urls(), terminate_jobs(), verify_content_name()

Examples

## 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)

connectapi documentation built on Nov. 5, 2025, 7:32 p.m.