mirror of
https://github.com/Fishwaldo/rundeck-api-java-client.git
synced 2025-07-05 20:49:39 +00:00
Wagon: Deploying site to repository
This commit is contained in:
parent
cc36f89fab
commit
6c8e359891
87 changed files with 3056 additions and 3750 deletions
169
jruby.html
169
jruby.html
|
@ -1,55 +1,18 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!-- Generated by Apache Maven Doxia at Oct 18, 2011 -->
|
||||
<!-- Generated by Apache Maven Doxia at Dec 3, 2011 -->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="./css/bootstrap-1.3.0.min.css" />
|
||||
<link rel="stylesheet" href="./css/maven-base.css" />
|
||||
<link rel="stylesheet" href="./css/maven-theme.css" />
|
||||
<link rel="stylesheet" href="./css/apache-maven-fluido.min.css" />
|
||||
<link rel="stylesheet" href="./css/site.css" />
|
||||
<link rel="stylesheet" href="./css/print.css" media="print" />
|
||||
<style>body{padding-top: 20px;}</style>
|
||||
|
||||
<script type="text/javascript" src="./js/apache-maven-fluido.min.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="./js/jquery-1.6.4.min.js"></script>
|
||||
<script type="text/javascript" src="./js/bootstrap-1.3.0-dropdown.js"></script>
|
||||
<script type="text/javascript">
|
||||
jQuery( document ).ready( function()
|
||||
{
|
||||
// initialize the dropdown menu
|
||||
$( '.topbar' ).dropdown();
|
||||
|
||||
// improve table layout
|
||||
jQuery( 'table.bodyTable' ).each( function()
|
||||
{
|
||||
jQuery( this ).removeClass( 'bodyTable' );
|
||||
jQuery( this ).addClass( 'zebra-striped' );
|
||||
} );
|
||||
|
||||
// add prettyprint class to all 'pre' element child of 'div' whit class="source"
|
||||
var prettify = false;
|
||||
|
||||
jQuery( 'div.source > pre' ).each( function()
|
||||
{
|
||||
jQuery( this ).addClass( 'prettyprint' );
|
||||
prettify = true;
|
||||
} );
|
||||
|
||||
// if code blocks were found, bring in the prettifier ...
|
||||
if ( prettify )
|
||||
{
|
||||
var link = jQuery( document.createElement( 'link' ) );
|
||||
link.attr(
|
||||
{
|
||||
type: 'text/css',
|
||||
rel: 'stylesheet',
|
||||
href: './css/prettify.css'
|
||||
} );
|
||||
jQuery( 'head' ).append( link );
|
||||
jQuery.getScript( './js/prettify.js', function() { prettyPrint(); } );
|
||||
}
|
||||
|
||||
} );
|
||||
</script>
|
||||
<meta name="Date-Revision-yyyymmdd" content="20111018" />
|
||||
<meta name="Date-Revision-yyyymmdd" content="20111203" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
|
||||
<!-- Google Analytics -->
|
||||
|
@ -68,91 +31,35 @@
|
|||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="topbar" class="topbar" data-dropdown="dropdown">
|
||||
<div class="topbar-inner">
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<ul>
|
||||
<li class="dropdown" data-dropdown="dropdown" >
|
||||
<a href="#" class="dropdown-toggle">RunDeck API - Java Client</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li> <a href="index.html" title="Introduction">Introduction</a>
|
||||
</li>
|
||||
<li> <a href="status.html" title="Status">Status</a>
|
||||
</li>
|
||||
<li> <a href="faq.html" title="FAQ">FAQ</a>
|
||||
</li>
|
||||
<li> <a href="download.html" title="Download">Download</a>
|
||||
</li>
|
||||
<li> <a href="changes-report.html" title="Changelog">Changelog</a>
|
||||
</li>
|
||||
<li> <a href="apidocs/index.html" title="API Documentation">API Documentation</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown" data-dropdown="dropdown" >
|
||||
<a href="#" class="dropdown-toggle">Scripting examples</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li> <a href="scripting.html" title="Introduction">Introduction</a>
|
||||
</li>
|
||||
<li> <a href="groovy.html" title="Groovy">Groovy</a>
|
||||
</li>
|
||||
<li> <a href="jruby.html" title="JRuby">JRuby</a>
|
||||
</li>
|
||||
<li> <a href="jython.html" title="Jython">Jython</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown" data-dropdown="dropdown" >
|
||||
<a href="#" class="dropdown-toggle">Older versions</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li> <a href="1.x/index.html" title="1.x (RunDeck 1.2)">1.x (RunDeck 1.2)</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown" data-dropdown="dropdown" >
|
||||
<a href="#" class="dropdown-toggle">Project Documentation</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li> <a href="project-info.html" title="Project Information">Project Information</a>
|
||||
</li>
|
||||
<li> <a href="project-reports.html" title="Project Reports">Project Reports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
|
||||
<div id="breadcrumbs">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
|
||||
|
||||
<li class="">
|
||||
<li class="">
|
||||
<a href="http://rundeck.org" class="externalLink" title="RunDeck">RunDeck</a>
|
||||
<li class="divider ">></li>
|
||||
<li class="divider ">/</li>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="./" title="RunDeck API - Java Client">RunDeck API - Java Client</a>
|
||||
<li class="divider ">></li>
|
||||
<li class="divider ">/</li>
|
||||
</li>
|
||||
<li class=""></li>
|
||||
|
||||
|
||||
|
||||
<li class="divider pull-right">|</li><li id="publishDate" class="pull-right">Last Published: 2011-10-18</li>
|
||||
<li class="divider pull-right">|</li> <li id="projectVersion" class="pull-right">Version: 2.1-SNAPSHOT</li>
|
||||
<li id="publishDate" class="pull-right">Last Published: 2011-12-03</li> <li class="divider pull-right">|</li>
|
||||
<li id="projectVersion" class="pull-right">Version: 2.1-SNAPSHOT</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="leftColumn" class="sidebar">
|
||||
<div id="leftColumn" class="sidebar">
|
||||
<div class="well">
|
||||
|
||||
|
||||
|
||||
<h5>RunDeck API - Java Client</h5>
|
||||
<h5>RunDeck API - Java Client</h5>
|
||||
<ul>
|
||||
<li class="none">
|
||||
<a href="index.html" title="Introduction">Introduction</a>
|
||||
|
@ -205,18 +112,20 @@
|
|||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="poweredBy">
|
||||
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
|
||||
|
||||
|
||||
<div id="poweredBy">
|
||||
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
|
||||
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="bodyColumn" class="content">
|
||||
<div id="contentBox">
|
||||
<div class="section"><h2>Using the RunDeck API from JRuby scripts<a name="Using_the_RunDeck_API_from_JRuby_scripts"></a></h2></div><p>Here are some examples of what you can do with this lib and a few lines of <a class="externalLink" href="http://www.jruby.org/">Ruby</a> (for the rubyist that don't fear running on the JVM !)</p><p>You will have to <a href="./download.html">download</a> the lib (the .jar file) to use it...</p><div class="section"><h3>Basic usage<a name="Basic_usage"></a></h3></div><p>Save the following script in a file named "<tt>rundeck.rb</tt>", and execute it with "<tt>jruby rundeck.rb</tt>".</p><div class="source"><pre>require 'java'
|
||||
|
||||
<div class="section"><h2>Using the RunDeck API from JRuby scripts<a name="Using_the_RunDeck_API_from_JRuby_scripts"></a></h2></div><p>Here are some examples of what you can do with this lib and a few lines of <a class="externalLink" href="http://www.jruby.org/">Ruby</a> (for the rubyist that don't fear running on the JVM !)</p><p>You will have to <a href="./download.html">download</a> the lib (the .jar file) to use it...</p><div class="section"><h3>Basic usage<a name="Basic_usage"></a></h3></div><p>Save the following script in a file named "<tt>rundeck.rb</tt>", and execute it with "<tt>jruby rundeck.rb</tt>".</p><div class="source"><pre class="prettyprint">require 'java'
|
||||
require '/path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar'
|
||||
import org.rundeck.api.RundeckClient
|
||||
|
||||
|
@ -227,7 +136,7 @@ puts "All RunDeck projects : #{rundeck.projects}"
|
|||
puts "All RunDeck nodes : #{rundeck.nodes}"
|
||||
puts "All RunDeck jobs : #{rundeck.jobs}"
|
||||
puts "All RunDeck running executions : #{rundeck.runningExecutions}"
|
||||
</pre></div><p>You can also add the library to the classpath : save the following script in a file named "<tt>rundeck.rb</tt>", and execute it with "<tt>jruby -rjava -J-cp /path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar rundeck.rb</tt>".</p><div class="source"><pre>import org.rundeck.api.RundeckClient
|
||||
</pre></div><p>You can also add the library to the classpath : save the following script in a file named "<tt>rundeck.rb</tt>", and execute it with "<tt>jruby -rjava -J-cp /path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar rundeck.rb</tt>".</p><div class="source"><pre class="prettyprint">import org.rundeck.api.RundeckClient
|
||||
|
||||
rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
|
||||
|
||||
|
@ -236,12 +145,12 @@ puts "All RunDeck projects : #{rundeck.projects}"
|
|||
puts "All RunDeck nodes : #{rundeck.nodes}"
|
||||
puts "All RunDeck jobs : #{rundeck.jobs}"
|
||||
puts "All RunDeck running executions : #{rundeck.runningExecutions}"
|
||||
</pre></div><div class="section"><h3>Authentication<a name="Authentication"></a></h3></div><p>Starting with RunDeck API 2, there are 2 ways to authenticate :</p><ul><li>the <b>login-based authentication</b> : with your login and password</li><li>the <b>token-based authentication</b> : with a unique token that you can generate from the RunDeck webUI</li></ul><div class="source"><pre>// using login-based authentication (admin/admin is the default login/password for a new RunDeck instance) :
|
||||
</pre></div><div class="section"><h3>Authentication<a name="Authentication"></a></h3></div><p>Starting with RunDeck API 2, there are 2 ways to authenticate :</p><ul><li>the <b>login-based authentication</b> : with your login and password</li><li>the <b>token-based authentication</b> : with a unique token that you can generate from the RunDeck webUI</li></ul><div class="source"><pre class="prettyprint">// using login-based authentication (admin/admin is the default login/password for a new RunDeck instance) :
|
||||
rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin");
|
||||
|
||||
// using token-based authentication :
|
||||
rundeck = RundeckClient.new("http://localhost:4440", "PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD");
|
||||
</pre></div><div class="section"><h3>Running a job<a name="Running_a_job"></a></h3></div><div class="source"><pre>import org.rundeck.api.RundeckClient
|
||||
</pre></div><div class="section"><h3>Running a job<a name="Running_a_job"></a></h3></div><div class="source"><pre class="prettyprint">import org.rundeck.api.RundeckClient
|
||||
import org.rundeck.api.OptionsBuilder
|
||||
import org.rundeck.api.NodeFiltersBuilder
|
||||
|
||||
|
@ -264,7 +173,7 @@ execution = rundeck.triggerJob("job-id", OptionsBuilder.new().addOptio
|
|||
// last one : you can run a job and wait until its execution is finished :
|
||||
execution = rundeck.runJob("job-id")
|
||||
puts "Execution finished ! Status : #{execution.status}, duration : #{execution.duration}"
|
||||
</pre></div><div class="section"><h3>Running an ad-hoc command<a name="Running_an_ad-hoc_command"></a></h3></div><div class="source"><pre>import org.rundeck.api.RundeckClient
|
||||
</pre></div><div class="section"><h3>Running an ad-hoc command<a name="Running_an_ad-hoc_command"></a></h3></div><div class="source"><pre class="prettyprint">import org.rundeck.api.RundeckClient
|
||||
import org.rundeck.api.NodeFiltersBuilder
|
||||
|
||||
rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
|
||||
|
@ -274,7 +183,7 @@ execution = rundeck.triggerAdhocCommand("my-project", "uptime&quo
|
|||
|
||||
// run the "uptime" command on all unix nodes
|
||||
execution = rundeck.runAdhocCommand("my-project", "uptime", NodeFiltersBuilder.new().osFamily("unix").toProperties())
|
||||
</pre></div><div class="section"><h3>Running an ad-hoc script<a name="Running_an_ad-hoc_script"></a></h3></div><div class="source"><pre>import org.rundeck.api.RundeckClient
|
||||
</pre></div><div class="section"><h3>Running an ad-hoc script<a name="Running_an_ad-hoc_script"></a></h3></div><div class="source"><pre class="prettyprint">import org.rundeck.api.RundeckClient
|
||||
import org.rundeck.api.OptionsBuilder
|
||||
import org.rundeck.api.NodeFiltersBuilder
|
||||
|
||||
|
@ -285,29 +194,29 @@ execution = rundeck.triggerAdhocScript("my-project", "/tmp/my-scr
|
|||
|
||||
// run a bash script (with options) on all unix nodes
|
||||
execution = rundeck.runAdhocCommand("my-project", "/tmp/my-script-with-options.sh", OptionsBuilder.new().addOption("option1", "value one").toProperties(), NodeFiltersBuilder.new().osFamily("unix").toProperties())
|
||||
</pre></div><div class="section"><h3>Exporting jobs<a name="Exporting_jobs"></a></h3></div><div class="source"><pre>import org.rundeck.api.RundeckClient
|
||||
</pre></div><div class="section"><h3>Exporting jobs<a name="Exporting_jobs"></a></h3></div><div class="source"><pre class="prettyprint">import org.rundeck.api.RundeckClient
|
||||
rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
|
||||
|
||||
rundeck.exportJobsToFile("/tmp/jobs.xml", "xml", "my-project")
|
||||
rundeck.exportJobToFile("/tmp/job.yaml", "yaml", "job-id")
|
||||
</pre></div><div class="section"><h3>Importing jobs<a name="Importing_jobs"></a></h3></div><div class="source"><pre>import org.rundeck.api.RundeckClient
|
||||
</pre></div><div class="section"><h3>Importing jobs<a name="Importing_jobs"></a></h3></div><div class="source"><pre class="prettyprint">import org.rundeck.api.RundeckClient
|
||||
rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
|
||||
|
||||
result = rundeck.importJobs("/tmp/jobs.xml", "xml")
|
||||
puts "#{result.succeededJobs.size} jobs successfully imported, #{result.skippedJobs.size} jobs skipped, and #{result.failedJobs.size} jobs failed"
|
||||
</pre></div><div class="section"><h3>And more...<a name="And_more..."></a></h3></div><p>See the API documentation of the <a href="./apidocs/reference/org/rundeck/api/RundeckClient.html">RundeckClient</a> class for more interactions with your RunDeck instance...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container-fluid">
|
||||
<p>Copyright © 2011.
|
||||
<div class="container-fluid">
|
||||
<div class="row span16">Copyright © 2011.
|
||||
All Rights Reserved.
|
||||
|
||||
</div>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue