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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

rlockertools-0.3.10-py3.8.egg (17.9 kB view details)

Uploaded Source

rlockertools-0.3.10-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rlockertools-0.3.10-py3.8.egg
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.0 importlib_metadata/3.7.3 packaging/20.8 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for rlockertools-0.3.10-py3.8.egg
Algorithm Hash digest
SHA256 db1362226217dedd626217841976b3c260d0025a0b42835f8e8fa2e61b4f55fb
MD5 58bca22e949140a536960222a758ba97
BLAKE2b-256 a7ba590242eabb8387ba6a98ed92faf4c689b1ff51c0585e478c8194865f630a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rlockertools-0.3.10-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

File hashes

Hashes for rlockertools-0.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 19e64c08af65c1afeb468124eb81ace0f74709d67f0ae8c7d6469a8124770e48
MD5 9195c3366717911fd8cc427c3838aa7d
BLAKE2b-256 b8d4e9d83233ad2cf8b97312fe3f75d2bc19728204f137c86d167a9460c1c9e6

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