Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rundeck Curl Job Import

Tags:

curl

rundeck

I want to import a job.xml to Rundeck via curl.
Trying something like this:

curl -v -u admin:admin -F xmlBatch=@C:\job.xml http://XXXXXXXXXX/api/1/jobs/import

I get the 302 response and that's all

Can somebody help me out with a working sample or help to create/modify such one

like image 301
SilliS Avatar asked Jul 14 '14 13:07

SilliS


People also ask

How to get rundeck token?

To obtain an API Token, you must first log in to the Rundeck GUI using a user account. Click on your username in the header of the page, and you will be shown your User Profile page. From this page you can manage your API Tokens. Note: You must have appropriate authorization to generate a token.

How do I create a new job on rundeck?

First, log into your Rundeck server. Once authenticated, click on the project (in the sidebar) you want associated with the job. In the Job Actions dropdown (Figure A), click New Job. Give the job a name and a description (Figure B).

What is rundeck used for?

Rundeck is an open-source software Job scheduler and Run Book Automation system for automating routine processes across development and production environments. It combines task scheduling multi-node command execution workflow orchestration and logs everything that happens.


1 Answers

So I managed to upload a job and it's working. I stopped using simple authentication and went for using authentication token, that you can generate in the user profile settings. That made the trick
The working command for cURL:

curl -v --header "X-Rundeck-Auth-Token:<token-value>" -F xmlBatch=@"X:\job.xml"  http://xxx.xxx.xxx.xxx/api/1/jobs/import
like image 116
SilliS Avatar answered Oct 16 '22 21:10

SilliS