Arunabha
Arunabha

Reputation: 21

How to change a job schedule (date/time) in Rundeck from another application?

Does Rundeck have an API to dynamically change schedule? If not is there any other way to do the same?

a. POST .../api/21/job/[ID]/run { "runAtTime":"new-date/time" }

b. POST /api/21/job/[ID]/execution/enable - Only enables scheduling

Rundeck API page: https://rundeck.org/docs/api/

Thanks

Upvotes: 0

Views: 1189

Answers (1)

Arunabha
Arunabha

Reputation: 21

Think I have found an API:
POST .../api/14/project/[PROJECT-NAME]/jobs/import?dupeOption=update
Add a block for new schedule:

<schedule>
    <month month='...'>
    <time hour='12' minute='45' seconds='15'>
    <weekday day='...' />
    <year year='...' />
 </schedule>

To get current details of the job call
GET ...api/14/project/[PROJECT-NAME]/jobs/export
This will return all jobs under PROJECT.
We will have to extract block for our job.

Points to note:
- content-type must be application/xml - uuid must be specified in POST - dupeOption=update must be specified a parameter; else Rundeck will create a duplicate job instead of updating our job

Upvotes: 0

Related Questions