Coder Social home page Coder Social logo

hammer_cli_foreman_remote_execution's Introduction

Build Status Gem Version Code Climate

CLI Plugin for Foreman Remote Execution

This Hammer CLI plugin contains commands for foreman_remote_execution.

Examples

Templates

List templates

hammer job-template list

Create a template

hammer job-template create --file /tmp/template.txt --name "Ping a Host"\
  --provider-type SSH --job-category "Commands"

Create a template input

hammer template-input create --template-id 17 --name hostname\
  --input-type user --options www.google.com,www.facebook.com,localhost

Jobs

Show jobs

hammer job-invocation list

Show details:

hammer job-invocation info --id 83

Run a job with command line inputs

hammer job-invocation create --job-template "Run Command - SSH Default" \
  --inputs command="ping -c 50 www.google.com" --search-query "name ~ rex01"
hammer job-invocation create --job-template "Package Action - SSH Default" \
  --inputs package=vim-enhanced,action=install --search-query "name ~ rex01"

Run a job with file inputs

hammer job-invocation create --job-template "Run Command - SSH Default"\
  --input-files command=/tmp/script.sh --search-query "name ~ rex01"

Show output

If the job is currently running, this will refresh until the job completes.

hammer job-invocation output --id 155 --host rex01.example.com

Alternatively, pass the --async option to see the output so far:

hammer job-invocation output --id 155 --host rex01.example.com --async

Developer Information

Updating API docs

In test/data/[foreman_version]/foreman_api.json, we include the Apipie documentation, with generated examples from the tests.

When adding new features to the hammer, you'll need to update this.

  1. From foreman directory, run remote execution tests with examples enabled:

     APIPIE_RECORD=examples rake test:foreman_remote_execution
    
  2. From foreman directory, generate the apipie cache for English:

     FOREMAN_APIPIE_LANGS=en rake apipie:cache
    
  3. Copy the docs to hammer_cli_foreman_remote_execution

     cp public/apipie-cache/apidoc/v2.en.json ~/hammer_cli_foreman_remote_execution/test/data/1.10/foreman_api.json
    

License

This project is licensed under the GPLv3+.

hammer_cli_foreman_remote_execution's People

Contributors

adamruzicka avatar ares avatar bkearney avatar cpeters avatar ekohl avatar evgeni avatar inecas avatar mariaaga avatar ofedoren avatar pkoprda avatar stbenjam avatar stejskalleos avatar upadhyeammit avatar xprazak2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.