A Rundeck API Python client
Project description
arundeckrun
===========
|codecov.io|
|wercker status|
A fork of the client library written in Python to interact with the
Rundeck API, the majority of which was created by Mark LaPerriere.
The fork exists mostly because the environment Antillion use it requires
it to be hosted on pypi, so updates must be pushed quickly. In addition,
the requirement to run tests against a live Rundeck is a no-no.
Rundeck (API) version compatibility:
Some calls are under active use/development, primarily:
- Job imports: API v1+
- Project archive imports: API v14+
All other calls *should* work correctly as long as they are not
deprecated or if Rundeck fail to correctly implement backwards
compatibility.
Target python version: 2.7 Should work (but not tested aagainst): 3
Installation
============
pip install arundeckrun
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':'arundeckrun'})
{'argstring': '-from arundeckrun',
'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': 'arundeckrun'}
Tests
=====
Unit tests
----------
Unit tests are performed via tox.
To install tox and then run the tests:
::
pip install tox
tox
Integration tests
-----------------
*Note:* currently the integrations are not up-to-date and are not under
continous integration. Soon though…
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).
.. code-block:: bash
::
RUNDECK_API_TOKEN
RUNDECK_SERVER
RUNDECK_PORT
RUNDECK_PROTOCOL
Next clone the repo.
.. code-block:: bash
::
git clone https://github.com/marklap/arundeckrun
.. note:: act
.. |codecov.io| image:: https://codecov.io/github/Antillion/rundeckrun/coverage.svg?branch=master
:target: https://codecov.io/github/Antillion/rundeckrun?branch=master
.. |wercker status| image:: https://app.wercker.com/status/57e663b27aba00b9b7aabe4ea7b8208a/m/master
:target: https://app.wercker.com/project/bykey/57e663b27aba00b9b7aabe4ea7b8208a
===========
|codecov.io|
|wercker status|
A fork of the client library written in Python to interact with the
Rundeck API, the majority of which was created by Mark LaPerriere.
The fork exists mostly because the environment Antillion use it requires
it to be hosted on pypi, so updates must be pushed quickly. In addition,
the requirement to run tests against a live Rundeck is a no-no.
Rundeck (API) version compatibility:
Some calls are under active use/development, primarily:
- Job imports: API v1+
- Project archive imports: API v14+
All other calls *should* work correctly as long as they are not
deprecated or if Rundeck fail to correctly implement backwards
compatibility.
Target python version: 2.7 Should work (but not tested aagainst): 3
Installation
============
pip install arundeckrun
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':'arundeckrun'})
{'argstring': '-from arundeckrun',
'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': 'arundeckrun'}
Tests
=====
Unit tests
----------
Unit tests are performed via tox.
To install tox and then run the tests:
::
pip install tox
tox
Integration tests
-----------------
*Note:* currently the integrations are not up-to-date and are not under
continous integration. Soon though…
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).
.. code-block:: bash
::
RUNDECK_API_TOKEN
RUNDECK_SERVER
RUNDECK_PORT
RUNDECK_PROTOCOL
Next clone the repo.
.. code-block:: bash
::
git clone https://github.com/marklap/arundeckrun
.. note:: act
.. |codecov.io| image:: https://codecov.io/github/Antillion/rundeckrun/coverage.svg?branch=master
:target: https://codecov.io/github/Antillion/rundeckrun?branch=master
.. |wercker status| image:: https://app.wercker.com/status/57e663b27aba00b9b7aabe4ea7b8208a/m/master
:target: https://app.wercker.com/project/bykey/57e663b27aba00b9b7aabe4ea7b8208a
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
arundeckrun-0.2.3.tar.gz
(25.2 kB
view details)
File details
Details for the file arundeckrun-0.2.3.tar.gz
.
File metadata
- Download URL: arundeckrun-0.2.3.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 457331e2dda78133c76d6db014039dbb9d303e71728e8529d211f25b441dbcf9 |
|
MD5 | ec8d04bfd47fbb6cbff422734110b5c8 |
|
BLAKE2b-256 | 5b0d4c65e171824d12d24f27443d6e9e4c8d078720e4dfaa7f5086f7e88a1478 |