Metadata-Version: 2.4
Name: devnest
Version: 0.0.5
Summary: TBD
Home-page: https://github.com/rhos-infra/devnest
Author: Michal Pryc
Author-email: rhos-ci@redhat.com
Maintainer: Michal Pryc
Maintainer-email: rhos-ci@redhat.com
License: BSD
Keywords: jenkins
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Other Environment
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: colorlog>=2.6.1
Requires-Dist: jenkinsapi
Requires-Dist: terminaltables>=3.1.0
Requires-Dist: urllib3
Requires-Dist: requests
Requires-Dist: distro
Requires-Dist: selinux
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: requires-dist
Dynamic: summary

# Devnest Tool

A simple CLI to manage "reservations" for the hardware in devnest.

The primary use case for this tool is to reserve shared node
for debugging and development work.

Current implementation uses Jenkins APIs and metadata stored inside
Jenkins to manage lifecycle of hardware in the DevNest.

Once the node is reserved it's being put offline, so no other Jenkins
user is able to use it, until reservation expires and it's being cleaned.

### Usage

## Config File

By default, devnest looks for ~/.config/jenkins_jobs/jenkins_jobs.ini,
or /etc/jenkins_jobs/jenkins_jobs.ini (in that order).

It is possible to replace CLI arguments such as user, password and url
with config file containing this information and pass path to this file
using --conf flag.:

```
[jenkins]
user=JENKINS_USERNAME
password=JENKINS_API_TOKEN
url=https://JENKINS_URL
```

JENKINS_API_TOKEN can be found using Jenkins at:
    https://JENKINS_URL/user/JENKINS_USERNAME/configure

## Run DevNest CLI

Running in virtual environment:

```
git clone https://github.com/rhos-infra/devnest.git
virtualenv my-devnest-virtenv
source my-devnest-virtenv/bin/activate
pushd devnest
pip install .
devnest --help
```

## Sample commands

To list based on regexp in a "shared" pool of servers
```
devnest --conf config.ini list -g shared "*my_node_0?"
```

To list all i a "shared" pool of servers
```
devnest --conf config.ini list -g shared
```

To reserve node from "shared" pool for 4h (regex must match only 1 node)
```
devnest --conf config.ini reserve -g shared -t 4 *my_node_03
```

To release reservation
```
devnest --conf config.ini release *my_node_03
```

CHANGES
=======

0.0.5
-----

* Unescape html content from offline reason

0.0.4
-----

* Fix error devnest command py313
* Add timeout option for Jenkins operations

0.0.3
-----

* Catch all exceptions from nodes
* Catch AttributeError from node
* Add noqe for import in setup.py
* add 'distro' and 'selinux' to setup\_requires
* latest changes and improvments (offline, post\_xml)
* Improve error handling
* Lint fix in setup.py
* Python3.8 deprecates platform.linux\_distribution
* add hostname to the devnest offline message

0.0.2
-----

* offline the slave after it's been set up
* offline the slave after it's been set up
* add support for 'disconnect' from Jenkins master cli command - lint fix
* add support for 'disconnect' from Jenkins master cli command

0.0.1.dev49
-----------

* Add IP address to the list column
* Add dump config options
* Add directory options to update multiply slaves at once
* Ensure force reservation is only for not reserved nodes
* Add force reserve without specific node
* Add host to json output when reserving
* Pep8 simple fix
* If no regex is specified to match the host, reserve first available within group
* Add json output to management command
* Few tox fixes
* Add python3 compability
* Allow to extend node which is already reserved
* Add option to force reserve node which is currently running CI job
* Add new status for the node which isn't idle
* Allows loading params from environment variables
* Use CrumbRequester instead of Requester
* Ensure node is temporary offline before bringing it online
* Ensure node is temp offline before marking it online
* Add option to list nodes based on state
* Updated links after moving devnest from private to rhos-infra repo
* Fix linting
* Fix parsing of json if one contains wrong quotes
* Add functions to setup slave based on XML file
* Fix function argument name
* Added AUTHORS file
* Added option to set reprovision pending state
* Enhance groups in columns to be comma separated list
* Updated options to be more user friendly
* Enable packaging
* User can select parseable type output
* Default location for config file
* Rename Jenkins to DevNest
* Added extra metadata to easy login to the box
* Rename jenkinsnodecli to devnest
* Added vCPU capability
* Introduced node capabilities
* Changed column names in the output
* Changed termnology for the node status
* Add option to specify owner who reserved the node
* Fixed issue where node was not in sync with description
* Added options to manage node groups/labels
* Changed CLI arguments and supporting functions to be more restrictive for standard user, e.g. one user can't release box of another user
* Added info for the better user experience
* Fix improper call to Jenkins.node (performance)
* Fixed function get\_reservation\_endtime\_epoch
* Added error when no argument is specified
* Initial commit of Jenkins Node CLI

