Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gambol99/rundeck-api
Rundeck API library for ruby
https://github.com/gambol99/rundeck-api
Last synced: 11 days ago
JSON representation
Rundeck API library for ruby
- Host: GitHub
- URL: https://github.com/gambol99/rundeck-api
- Owner: gambol99
- Created: 2014-07-04T11:11:22.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-28T15:54:06.000Z (about 10 years ago)
- Last Synced: 2024-04-17T15:10:31.504Z (9 months ago)
- Language: Ruby
- Homepage:
- Size: 410 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Rundeck API
===========A simple api into rundeck - note, this was written quickly ... needs some polish so to speak :-)
$:.unshift File.join(File.dirname(__FILE__),'.','../lib')
require 'rundeck-cli'
require 'optionscrapper'
require 'pp'@options = {
:rundeck => 'https://rundeck.domain.com',
:api_token => 'token_key',
:project => 'orchestration',
:args => {}
}api = Rundeck::API.new @options
orchestration = api.project 'orchestration'orchestration.jobs do |job|
puts "job: #{job.name}"
endputs "checking for the launch job"
launch = orchestration.job 'delete'
puts "running the launch job"
execution = launch.run :hostname => 'rohith333'
puts "ran the job"
puts "checking the execution status"
execution.waitfor
puts "status"
puts execution.statusDecker
======Is a command line utility for interacting it rundeck
Usage: ./decker.rb command [options]
-h, --help display this usage menu
-c, --config CONFIG the path / location of the configuration file (/home/jest/.rundeck.yaml)
-r, --rundeck RUNDECK the configuration can contain multiple rundeckscommands : -------------------------------------------------------------
list (ls) list all the jobs with the selected project
exec (r) run / execute a job within the project
activity (his) interrogate the rundeck activity and history
import (imp) import a jobs or jobs into the current project
export (exp) export the jobs from the project in the specified format
------------------------------------------------------------------------list : description: list all the jobs with the selected project
-------------------------------------------------------------------------n, --name NAME the name of the job you wish to export, regex
-g, --group GROUP list job only within this group, regexexec : description: run / execute a job within the project
-------------------------------------------------------------------------n, --name NAME perform an execution of the job
-t, --tail tail the output of the execution and print to screen
-h, --help display the options for this jobactivity : description: interrogate the rundeck activity and history
-------------------------------------------------------------------------n, --name JOB_NAME filter the activity by the job name, regex
-i, --id ID the id of the activity you are interested in
-g, --group GROUP filter the activity by the group name, regex
-R, --running only show activity which is current running
-S, --stopped only show activity which has stopped
-F, --failed only show activity which has failed
-o, --output view the output of the activity or tail the running jobimport : description: import a jobs or jobs into the current project
-------------------------------------------------------------------------j, --jobs JOBS the location of the file contains the job/jobs
-f, --format FORMAT the format the jobs file is in (yaml/xml)
-u, --uuid OPTIONS preserve or remove options for uuids
-r, --remove remove the uuid from jobs, allows updateto succeed (default is true)
-D, --dupe OPTION the behavior when importing jobs which exist (skip/create/update)export : description: export the jobs from the project in the specified format
-------------------------------------------------------------------------f, --format FORMAT the format of the jobs, either yaml or xml (defaults to yaml)
-n, --name NAME the name of the job you wish to export
-d, --directory DIRECTORY the directory to place the single jobs
-s, --single export the jobs in single filesThe configuration file resembles the following
default: deck0 # if you have multiple and dont specify the -r|--rundeck option, this one will be used
rundecks:
deck0:
rundeck: https://rundeck.deck0.domain.com
api_token: SOME_TOKEN
project: SOME_PROJECT
deck1:
rundeck: https://rundeck.deck1.domain.com
api_token: SOME_TOKEN
project: SOME_PROJECT