Creating a rundeck job using REST API

2,525 views
Skip to first unread message

PHANI KUMAR YADAVILLI

unread,
Jul 8, 2016, 9:58:38 AM7/8/16
to rundeck-discuss
Hi Everyone, 

Is there any way i can create a rundeck job using a rest client to the rundeck rest api.

Any pointers or code snippets are really helpful.

Alex Honor

unread,
Jul 8, 2016, 11:00:08 AM7/8/16
to rundeck...@googlegroups.com
Hi,

You first would need to have or generate a job definition but with that you would use the api to import it to a project. http://rundeck.org/docs/api/index.html#importing-jobs

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/cb76ca3d-b3ff-410a-b812-4121d6400f74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Alex Honor

[SimplifyOps, Inc | a...@simplifyops.com ]

Be sure to comment and vote on Rundeck Feature Development!

PHANI KUMAR YADAVILLI

unread,
Jul 11, 2016, 5:01:14 AM7/11/16
to rundeck-discuss
Hi Alex,

You mean to say we need to create a job definition i.e XML or YAML and send it as a post request to the rundeck import rest end point?

PHANI KUMAR YADAVILLI

unread,
Jul 11, 2016, 5:51:11 AM7/11/16
to rundeck-discuss
Hi Alex,

As per the documentation for Exporting the jobs how to use the project parameter. Could you please provide an example as i do not see any examples in the documentation. 

Exporting Jobs

Export the job definitions for in XML or YAML formats.

URL:

/api/1/jobs/export

Required parameters:

  • project

Optional parameters:

  • format : can be "xml" or "yaml" to specify the output format. Default is "xml"

The following parameters can also be used to narrow down the result set.

  • idlist: specify a comma-separated list of Job IDs to export
  • groupPath: specify a group or partial group path to include all jobs within that group path.
  • jobFilter: specify a filter for the job Name

Alex Honor

unread,
Jul 11, 2016, 10:02:29 AM7/11/16
to rundeck...@googlegroups.com

Dave Ruffin

unread,
Sep 1, 2017, 11:01:36 PM9/1/17
to rundeck-discuss
Hi PHANI KUMAR YADAVILLI ,
Did you ever figure out how to duplicate job via rest api or command line?
Reply all
Reply to author
Forward
0 new messages