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
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.
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).
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With