diff --git a/src/site/apt/groovy.apt b/src/site/apt/groovy.apt new file mode 100644 index 0000000..03de15d --- /dev/null +++ b/src/site/apt/groovy.apt @@ -0,0 +1,36 @@ + ------ + Using the RunDeck API from Groovy scripts + ------ + Vincent Behar + ------ + 2011-07-03 + ------ + +Using the RunDeck API from Groovy scripts + + Here are some examples of what you can do with this lib and a few lines of {{{http://groovy.codehaus.org/}Groovy}}. + We can use {{{http://groovy.codehaus.org/Grape}Grape}} to download the lib (and its dependencies) from the {{{http://search.maven.org/}main maven repository}}, so you don't have to install anything manually (except Groovy, of course). + + <> but hopefully it should be pretty soon ! + +* Running a job (from its name, group and project) + + Save the following script in a file named "<<>>", and execute it with "<<>>". Feeling Groovy ? ;-) + ++-- +@Grab(group='org.rundeck', module='rundeck-api-java-client', version='1.0-SNAPSHOT') +import org.rundeck.api.RundeckClient + +rundeck = new RundeckClient("http://localhost:4440", "admin", "admin") + +job = rundeck.findJob("my-project", "main-group/sub-group", "job-name") +println "Running job : ${job}" + +execution = rundeck.triggerJob(job.id) +println "Follow the execution at : ${execution.url}" ++-- + +* And more... + + See the API documentation of the {{{./apidocs/org/rundeck/api/RundeckClient.html}RundeckClient}} class for more interactions with your RunDeck instance... + diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt new file mode 100644 index 0000000..8b43aaa --- /dev/null +++ b/src/site/apt/index.apt @@ -0,0 +1,28 @@ + ------ + RunDeck API - Java Client + ------ + Vincent Behar + ------ + 2011-07-03 + ------ + +Java client for the RunDeck REST API + +* What is it ? + + A Java librairie that maps the {{{http://rundeck.org}RunDeck}} HTTP REST API. RunDeck is an open-source tool for automating tasks on multiple nodes, with a CLI, a web-based interface and an HTTP REST API. You can read more about its API on the {{{http://rundeck.org/docs/RunDeck-Guide.html#rundeck-api}RunDeck User Manual}}. + + This librairie has been extracted from the {{{http://wiki.jenkins-ci.org/display/JENKINS/RunDeck+Plugin}Jenkins RunDeck plugin}}, so for the moment it is still incomplete (not all the RunDeck API is mapped). My goal is to have a complete mapping of the RunDeck API, and to publish the librairie on the {{{http://search.maven.org/}main maven repository}}, so that it can easily be used by Java ({{{http://maven.apache.org}Maven}}) and Groovy ({{{http://groovy.codehaus.org/Grape}Grape}}) developers. + +* What can I do with it ? + + * Use it in a Java application. A good example would be the {{{http://wiki.jenkins-ci.org/display/JENKINS/RunDeck+Plugin}Jenkins RunDeck plugin}}, that needs to trigger RunDeck jobs from within the {{{http://jenkins-ci.org}Jenkins}} continuous-integration server. + + * Use it to write {{{./groovy.html}Groovy}} or {{{./jruby.html}JRuby}} scripts, for example if you want to automate the execution of RunDeck jobs based on external events. + +* Where can I get more information ? + + * You can read the {{{./apidocs/index.html}API documentation}} + + * And the code is available on {{{https://github.com/vbehar/rundeck-api-java-client}GitHub}} + diff --git a/src/site/apt/jruby.apt b/src/site/apt/jruby.apt new file mode 100644 index 0000000..c880b46 --- /dev/null +++ b/src/site/apt/jruby.apt @@ -0,0 +1,47 @@ + ------ + Using the RunDeck API from JRuby scripts + ------ + Vincent Behar + ------ + 2011-07-03 + ------ + +Using the RunDeck API from JRuby scripts + + Here are some examples of what you can do with this lib and a few lines of {{{http://www.jruby.org/}Ruby}} (for the rubyist that don't fear running on the JVM !). + You will have to {{{https://github.com/vbehar/rundeck-api-java-client/downloads}download}} the lib (the .jar file) to use it... + +* Running a job (from its name, group and project) + + Save the following script in a file named "<<>>", and execute it with "<<>>". + ++-- +require 'java' +require '/path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar' +java_import org.rundeck.api.RundeckClient + +rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin") + +job = rundeck.findJob("my-project", "main-group/sub-group", "job-name") +puts "Running job : #{job}" + +execution = rundeck.triggerJob(job.id) +puts "Follow the execution at : #{execution.url}" ++-- + + You can also extract all the java-related stuff from the script file : save the following script in a file named "<<>>", and execute it with "<<>>". + ++-- +rundeck = org.rundeck.api.RundeckClient.new("http://localhost:4440", "admin", "admin") + +job = rundeck.findJob("my-project", "main-group/sub-group", "job-name") +puts "Running job : #{job}" + +execution = rundeck.triggerJob(job.id) +puts "Follow the execution at : #{execution.url}" ++-- + +* And more... + + See the API documentation of the {{{./apidocs/org/rundeck/api/RundeckClient.html}RundeckClient}} class for more interactions with your RunDeck instance... + diff --git a/src/site/site.xml b/src/site/site.xml new file mode 100644 index 0000000..7ffb9d9 --- /dev/null +++ b/src/site/site.xml @@ -0,0 +1,18 @@ + + + UA-23435653-1 + + + + + + + + + + + +