Code Monkey home page Code Monkey logo

rundeckrun's Introduction

RundeckRun

A client library written in Python to interact with the Rundeck API. It uses the awesome requests library.

Documentation is hosted on Read the Docs

DISCLAIMER: Test suite is not comprehensive, but most features have been tested and should work. Should work on at least Python 2.7 and Python 3.3.

Installation

Requires

$ pip install rundeckrun

Use

>>> from rundeck.client import Rundeck
>>> rd = Rundeck('rundeck.server.com', api_token='SECRET_API_TOKEN')
>>> rd.list_projects()
[{
    'description': None,
    'name': 'TestProject',
    'resources': {'providerURL': 'http://localhost:8000/resources.xml'},
}]
>>> rd.list_jobs('TestProject')
[{'description': 'Hello World!',
  'group': None,
  'id': 'a6e1e0f7-ad32-4b93-ba2c-9387be06a146',
  'name': 'HelloWorld',
  'project': 'TestProject'}]
>>> rd.run_job('a6e1e0f7-ad32-4b93-ba2c-9387be06a146', argString={'from':'RundeckRun'})
{'argstring': '-from RundeckRun',
 'date-started': datetime.datetime(2013, 7, 11, 18, 4, 24),
 'description': 'Plugin[localexec, nodeStep: true]',
 'href': 'http://rundeck.server.com/execution/follow/123',
 'id': '123',
 'job': None,
 'status': 'running',
 'user': 'rundeckrun'}

Running Tests

Note

You'll probably want to create a virtualenv for this.

Running the tests requires a running Rundeck server (the Rundeck standalone jar works well) and an API token for said Rundeck server.

You'll have to at least set the API token environment variable of RUNDECK_API_TOKEN but there are other environment variables to be aware of. The list is below and can be found at the head of the tests/__init__.py file. They should be fairly self-explanatory (OK, RUNDECK_PROTOCOL might not be self-explanatory... use either 'http' or 'https' there).

RUNDECK_API_TOKEN
RUNDECK_SERVER
RUNDECK_PORT
RUNDECK_PROTOCOL

Next clone the repo.

git clone https://github.com/marklap/rundeckrun

Note

activate your virtualenv

Then install the requirements and dev requirements.

pip install -r requirements.txt
pip install -r requirements_dev.txt

Lastly, execute nose tests.

nosetests

rundeckrun's People

Contributors

aodag avatar marklap avatar pgtest2 avatar zyv avatar

Watchers

 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.