Hi, I am trying to include a config.yml file with the application settings information such as send emails, schedule the email, sharing settings, viewer, etc. when publishing a RMarkdown Report to the RStudio Connect.
The RMarkdown report is able to publish to RStudio Connect, however, there is no report shown after publishing.
Is this a right way to include the configuration for application settings? If no, please advise any solution to configure the settings for RStudio Connect?
Howdy @clhuitheng ! This is a fantastic question!
Unfortunately, we do not have a way to publish a file with your application and have it change the configuration / application settings. Part of the challenge here is life-cycle (i.e. what if you change a setting in the UI? should the UI settings take precedence?)
In any case, one way around this issue is to configure settings:
- manually in the UI
- via the API using the API cookbook or API docs
- using the API via the
connectapi
package
Hopefully one of those options will meet your needs!! I'm curious to hear what you come up with and what settings you are most interested in changing!
Hi Cole,
Thank You for the suggestion. So I have proceed with using the connectapi package. I am able to update the some of the content settings.
I would like to know is there any API to change the timezone under the schedule section as shown in the screen shot below?
This is a fantastic question! Unfortunately this was missed in connectapi
, but I just created an issue to track it! Once this issue is closed, this should be easier to accomplish!
Unfortunately, my time has been such lately that I have not had much time to dig into connectapi
development, but am hopeful that will change soon
In the meantime, unfortunately the set_schedule_*
function helpers do not have the ability to do this. However, you can use the lower level set_schedule()
function (which allows arbitrary arguments).
You would want to make a request like this (see the set_schedule_*
helpers like set_schedule_minute()
for hints to get started)
client <- connect()
my_content <- content_item(client, "my-guid")
my_variant <- get_variant_default(my_content)
my_schedule <- get_variant_schedule(my_variant)
# akin to set_schedule_day()
set_schedule(
my_schedule,
type = "day",
schedule = list(N = 1),
start_time = Sys.time(),
activate = TRUE,
email = FALSE,
timezone = "Universal"
)
Specifically, you want to add a timezone = "Universal"
or timezone = "America/New_York"
argument, where "Universal" is the name of a timezone in the list. You can get the list of possible timezones adhoc with:
client <- connect()
client$GET("timezones")
Worth noting that this is done now