Can anyone point me to working code samples for the native SCM plugins to import and export jobs.
I am currently exporting and importing to my git repo via the web console and all working fine.
I'm looking to edit jobs via the YAML definitions, push to my git repo server, and import the updates.
While the API docs are quite comprehensive, the SCM APIs in particular are quite hard to follow and without examples of the end to end workflow, I'm quite lost.
I'm up to the stage where I have the following command:
$ curl -H 'X-Rundeck-Auth-Token:my-token' -H 'Accept:text/json'
https://my.rundeck.com/api/24/project/aws/scm/import/action/remote-pull/input | python -m json.tool
{
"title": "Pull Remote Changes",
"exportItems": null,
"fields": [
{
"defaultValue": "1 file(s) need to be imported\n\nPulling from remote branch: `master`",
"description": null,
"name": "status",
"renderingOptions": {
"displayType": "STATIC_TEXT",
"staticTextContentType": "text/x-markdown"
},
"required": false,
"scope": null,
"title": "Git Status",
"type": "String",
"values": null
}
],
"importItems": [],
"description": "Synch incoming changes from Remote",
"integration": "import",
"actionId": "remote-pull"
}
However, I can't quite follow the docs as to how I should populate the POST payload using the outputs of the first Action-Input call - or even if I am right track with the sequence of API calls.
The last call gives me a HTML response for an Error page but no details of the error.