I am trying to combine rsconnect and connectapi in order to deploy programmatically a product (dashboard, ETL, report, API, etc..) onto RStudio Connect.
Is there a way to programmatically set run-as-user, runtime and/or scheduling from a script?
Thanks for sharing this! Do you mind saying a bit more about your use case and why you are trying to deploy this product programmatically to RStudio Connect? We always value learning a bit more about why users are attempting to set up these types of workflows. Is this a CI pipeline?
As for the ways to accomplish this today: there are currently no publicly documented endpoints for setting run as user or the report schedule using the RStudio Connect Server API. Those endpoints have also not yet been exposed to the experimental endpoints within connectapi.
That said, it is possible to view and change the runtime settings for an application using the publicly documented Content API:
Thank you very much for your answer and for the code snippet.
Yes, that is correct. We are setting CI and CD pipelines for all our products. The CI focus is on testing, code coverage, linting, deploy new version of the package in our package manager, etc. CD is at this point a script where we deploy the app to RStudio Connect using rsconnect, set vanity URL with connectapi and now what is missing is to set run-as-user, runtime, and scheduling. Hopefully, runtime should be in place using your example.
This is long-delayed, but I just wanted to follow up and say that all of these options should be available inside of connectapi today! In particular, setting the run-as-user can be done using set_run_as() and scheduling can be accomplished using something like: