wtsi-hgi/openstack-info

Name: openstack-info

Owner: Wellcome Trust Sanger Institute - Human Genetics Informatics

Description: Gets information about what is in an OpenStack tenant

Created: 2017-08-30 10:16:24.0

Updated: 2017-09-11 10:16:21.0

Pushed: 2017-10-10 14:55:13.0

Homepage:

Size: 82

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status codecov

OpenStack Info

Gets information about what is in an OpenStack tenant.

Installation

Prerequisites:

The tool can be installed from PyPi:

install openstackinfo

Bleeding edge versions can be installed directly from GitHub:

clone https://github.com/wtsi-hgi/openstack-info.git
penstack-tenant-cleaner
on setup.py install

or using pip:

install git+https://github.com/wtsi-hgi/openstack-info.git@master#egg=openstackinfo
Usage
CLI

Set environment variables:

rt OS_USERNAME=user
rt OS_TENANT_NAME=tenant
rt OS_AUTH_URL=http://example.com:5000/v2.0/
rt OS_PASSWORD=password

Then call:

stackinfo

The available options can be found with openstackinfo -h:

e: openstackinfo [-h] [-i {type,id}] [--max-connections MAX_CONNECTIONS]
                 [--retries RETRIES] [--retry-wait RETRY_WAIT]
                 [--retry-wait-multiplier RETRY_WAIT_MULTIPLIER]

stack tenant information retriever

onal arguments:
, --help            show this help message and exit
 {type,id}, --index {type,id}
                    What the OpenStack information should be index by
                    (default: type)
max-connections MAX_CONNECTIONS
                    Maximum number of simultaneous connections to make to
                    OpenStack. Configured automatically if not set
                    (default: None)
retries RETRIES     Number of times to retry getting information about a
                    particular tpye of OpenStack resource (default: 3)
retry-wait RETRY_WAIT
                    Initial amount of time (in seconds) to wait after a
                    failure before retrying (default: 1.0)
retry-wait-multiplier RETRY_WAIT_MULTIPLIER
                    Multiplier that is applied to the wait time after each
                    failure. e.g. An initial wait time of 1.0s, a wait
                    multiplier of 5.0, and a maximum of 3 retries will
                    result in the waits between retries of [1.0s, 5.0s,
                    25.0s] (default: 5.0)
retry-wait-deviation RETRY_WAIT_DEVIATION
                    To minimise collisions, the wait time before retrying
                    a request is randomised to plus or minus the value of
                    this parameter as a percentage of the total wait time.
                    e.g. A wait time of 1.0s and max deviation percentage
                    of 10.0 will result in an actual wait between 0.9s and
                    1.1s (default: 10.0)
Python
 openstackinfo.retriever.models import Credentials
 openstackinfo.retriever.retrievers import ShadeInformationRetriever
 openstackinfo.helpers import get_information, RunConfiguration
 openstackinfo.indexers import InformationIndexerByType

iever = ShadeInformationRetriever(credentials=Credentials(username, password, auth_url, tenant))
iguration = RunConfiguration(retriever=retriever, indexer=InformationIndexerByType)
stack_info = get_information(configuration)
Alternatives

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.