-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Platform] Add ability to schedule external scripts in platform #8637
Comments
Need to be careful about this because platform runs as a high privileged user. |
This needs to be delivered as part of satisfying this requirement for LDAP in YCQL. |
vipul-yb
added a commit
that referenced
this issue
Aug 19, 2021
…pts. Summary: - Added APIs to schedule/stop/modify external scripts in Platform - Scripts are defined on the universe level and a universe can only have a single external script scheduled. - These scripts are stored in RunTimeConfig DB in this phase but will be shifted to a more secured DB in the next phase. - These APIs are highly sensitive and can be exploited to affect the Platform, Currently, only ATS will be accessing these APIs. These APIs send data in Multipart/From data format and this API can be accessed using X-AUTH-TOKEN as well as X-AUTH-YW-API-TOKEN. Schedule external script: ``` POST /api/v1/customers/:cUUID/universes/:uniUUID/scheduleScript { script: FileUpload, cornExpression: ${cornExpression} scriptParameter: {"param1": "va1l", "param2": "val2"} timeLimitMins: ${timeLimitMins} } ``` example ``` { script: FileUpload, cronExperssion: 5 * * * *, scriptParameter: {"restore_time": "2021-08-08 12:00:00", "platform_version": "2.6.7"} timeLimitMins: 4 } ``` Update existing external scheduled script ``` PUT /api/v1/customers/:cUUID/universes/:uniUUID/updateScheduledScript { script: FileUpload, cornExpression: ${cornExpression} scriptParameter: {"param1": "val1", "param2": "val2"} timeLimitMins: ${timeLimitMins} } ``` stop scheduled external scheduled script ``` PUT /api/v1/customers/:cUUID/universes/:uniUUID/stopScheduledScript ``` Test Plan: - Added unit tests. - Tested on a local setup by running self-generated scripts and an infinitely long-running script Reviewers: arnav, sanketh, hkandala Reviewed By: sanketh, hkandala Subscribers: hsu, jenkins-bot, yugaware Differential Revision: https://phabricator.dev.yugabyte.com/D12324
vipul-yb
added a commit
that referenced
this issue
Sep 21, 2021
…er-defined scripts. Summary: - Added APIs to schedule/stop/modify external scripts in Platform - Scripts are defined on the universe level and a universe can only have a single external script scheduled. - These scripts are stored in RunTimeConfig DB in this phase but will be shifted to a more secured DB in the next phase. - These APIs are highly sensitive and can be exploited to affect the Platform, Currently, only ATS will be accessing these APIs. These APIs send data in Multipart/From data format and this API can be accessed using X-AUTH-TOKEN as well as X-AUTH-YW-API-TOKEN. Schedule external script: ``` POST /api/v1/customers/:cUUID/universes/:uniUUID/schedule_script { script: FileUpload, cornExpression: ${cornExpression} scriptParameter: {"param1": "va1l", "param2": "val2"} timeLimitMins: ${timeLimitMins} } ``` example ``` { script: FileUpload, cronExperssion: 5 * * * *, scriptParameter: {"restore_time": "2021-08-08 12:00:00", "platform_version": "2.6.7"} timeLimitMins: 4 } ``` Update existing external scheduled script ``` PUT /api/v1/customers/:cUUID/universes/:uniUUID/update_scheduled_script { script: FileUpload, cornExpression: ${cornExpression} scriptParameter: {"param1": "val1", "param2": "val2"} timeLimitMins: ${timeLimitMins} } ``` stop scheduled external scheduled script ``` PUT /api/v1/customers/:cUUID/universes/:uniUUID/stop_scheduled_script ``` Original commit: D12324 / 717ef62 Test Plan: Jenkins: rebase: 2.6 - Added unit tests. - Tested on a local setup by running self-generated scripts and an infinitely long-running script Reviewers: arnav, hkandala, sanketh Reviewed By: hkandala, sanketh Subscribers: yugaware, jenkins-bot, hsu Differential Revision: https://phabricator.dev.yugabyte.com/D12981
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In order to support custom scripts that need to be run from platform, an API should be added to collect the schedule desired as well as any parameters for a script / program that needs to be run by platform's scheduler. An example of this would be a script that would synchronize universes on that platform to be updated with new users as the result of a LDAP server scrape.
The text was updated successfully, but these errors were encountered: