Skip to main content

Useful tools to interact with Resource Locker Project

Project description

Useful tools to work with Rlocker project API

Quick Start

Normal installation

pip install rlockertools

Setup

git clone https://github.com/red-hat-storage/rlockertools.git
cd rlockertools
python -m venv venv
source venv/bin/activate
pip install ./
rlock --help

usage: rlock [-h] --server-url SERVER_URL --token TOKEN [--release] [--lock] [--resume-on-connection-error] [--signoff SIGNOFF] [--priority PRIORITY] [--search-string SEARCH_STRING] [--link LINK] [--interval INTERVAL] [--attempts ATTEMPTS]

optional arguments: -h, --help show this help message and exit --server-url SERVER_URL The URL of the Resource Locker Server --token TOKEN Token of the user that creates API calls --release Use this argument to release a resource --lock Use this argument to lock a resource --resume-on-connection-error Use this argument in case you don't want to break queue execution in the middle of waiting for queue status being FINISHED --signoff SIGNOFF Use this when lock=True, locking a resource requires signoff --priority PRIORITY Use this when lock=True, specify the level of priority the resource should be locked --search-string SEARCH_STRING Use this when lock=True, specify the lable or the name of the lockable resource --link LINK Use this when lock=True, specify the link of the CI/CD pipeline that locks the resource --interval INTERVAL Use this when lock=True, how many seconds to wait between each call while checking for a free resource --attempts ATTEMPTS Use this when lock=True, how many times to create an API call that will check for a free resource


## Usage Examples

### To add a queue for locking a resource

```bash
rlock --lock --server-url=your.rlocker.instance.com --token=YOURTOKEN --search-string=nameorlabel --signoff=YOURUNIQUESIGNOFF --priority=3 --interval=15 --attempts=15

To release a locked resource (filtration by signoff only)

rlock --release --server-url=your.rlocker.instance.com --token=YOURTOKEN --signoff=YOURUNIQUESIGNOFF

Change log

[0.3.8] - 2021-03-15

Initial build

[0.3.9] - 2021-07-15

Move to new repo + bug fix

[0.3.10] - 2021-07-15

Fix build issue

[0.3.11] - 2021-07-19

Suppress the logs Show safe errors when beating a queue returns !=200 status code

[0.4] - 2022-04-12

Allow **datakwargs in the change queue method. This is necessary to allow modification of the data section once a queue is changing

[0.4.1] - 2022-04-13

Show more output in get_queue method in case of non 200 status code

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rlockertools-0.4.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distributions

rlockertools-0.4.1-py3.8.egg (18.5 kB view details)

Uploaded Source

rlockertools-0.4.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file rlockertools-0.4.1.tar.gz.

File metadata

  • Download URL: rlockertools-0.4.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.5

File hashes

Hashes for rlockertools-0.4.1.tar.gz
Algorithm Hash digest
SHA256 e19ae45a1f780035223a91d219dd7818714d87b2067eee2b91544655af81f664
MD5 77e8644ea52a1a324f392875cfd65148
BLAKE2b-256 71fdb3d6038013f29f9070bb310623659ce6258cb910a1458c1013295e803062

See more details on using hashes here.

File details

Details for the file rlockertools-0.4.1-py3.8.egg.

File metadata

  • Download URL: rlockertools-0.4.1-py3.8.egg
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.5

File hashes

Hashes for rlockertools-0.4.1-py3.8.egg
Algorithm Hash digest
SHA256 3d5c1e1c5a4cdc4d5f479c4c677eb5f1ce27a9871e3a96c8f18c710aea236497
MD5 1a7024ee56c2bdf56db674945a95cdc9
BLAKE2b-256 85fd7beaa1bc6ce9ff387cbd613d4ec220b58c37de5d6ab01b96d62d09ddd104

See more details on using hashes here.

File details

Details for the file rlockertools-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rlockertools-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d4171a5644e96d3a5655a976481876f14f96e2c88618ef51a9f29d3ce3370bce
MD5 c2ae0d41cd7710278a2d9f7188f94089
BLAKE2b-256 a2ec0379ac9e1e12aa44b93cb0459f82841da6905ad0736e19d112ab45f7dd18

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page