A script to display OpenStack Load Balancer resource details.
Project description
openstack-lb-info - A command-line tool for displaying OpenStack Load Balancer resource details.
About
This Python script interacts with an OpenStack cloud infrastructure and retrieve information about load balancers and their components such as listeners, pools, health monitors, members, and amphorae. It displays the information in a visually appealing and user-friendly way and provide a clear representation of the load balancer resources.
Below are the key features and components:
Features
- Query and display information about OpenStack load balancers.
- Display detailed attributes and information about listeners, pools, health monitors, members, and amphorae.
- Filter results based on various criteria, such as load balancer name, ID, tags, availability zone, VIP network, and VIP subnet.
- Present information in a structured and colorful format using the Rich library.
- Support output in different formats, including Rich text, plain text, and JSON.
Information Display
The program provides two main modes for displaying information:
-
Load Balancer Information: When the resource type is specified as "lb", it retrieves and displays details about OpenStack load balancers. The displayed information includes load balancer IDs, VIP addresses, provisioning status, operating status, and other optional details. If no load balancers match the filter criteria, it will indicate that no load balancers were found.
-
Amphora Information: When the resource type is specified as "amphora", it retrieves and displays information about amphoras associated with load balancers. Amphoras are responsible for handling load balancing operations. The displayed information includes amphora IDs, roles, status, load balancer network IP addresses, associated images, server information, and optional details. If no amphoras match the filter criteria, it will indicate that no amphoras were found.
CLI Options
$ openstack-lb-info --help
usage: openstack-lb-info [-h] [-d] [--os-cloud OS_CLOUD] -t {lb,amphora}
[-o {plain,rich,json}] [--name NAME] [--id ID]
[--tags TAGS] [--flavor-id FLAVOR_ID]
[--vip-address VIP_ADDRESS]
[--availability-zone AVAILABILITY_ZONE]
[--vip-network-id VIP_NETWORK_ID]
[--vip-subnet-id VIP_SUBNET_ID] [--details]
[--no-members] [--max-workers MAX_WORKERS]
A script to show OpenStack load balancers information.
options:
-h, --help show this help message and exit
--os-cloud OS_CLOUD Name of the cloud to load from clouds.yaml.
(Default 'envvars', which uses OS_* env vars)
-t {lb,amphora}, --type {lb,amphora}
Show information about load balancers or amphoras
-o {plain,rich,json}, --output-format {plain,rich,json}
Output format. (default: rich)
--name NAME Filter load balancers name
--id ID Filter load balancers id (UUID)
--tags TAGS Filter load balancers tags
--flavor-id FLAVOR_ID
Filter load balancers flavor id (UUID)
--vip-address VIP_ADDRESS
Filter load balancers VIP address
--availability-zone AVAILABILITY_ZONE
Filter load balancers AZ
--vip-network-id VIP_NETWORK_ID
Filter load balancers network id (UUID)
--vip-subnet-id VIP_SUBNET_ID
Filter load balancers subnet id (UUID)
--details Show all load balancers/amphora details. (default: False)
--no-members Do not show load balancers pool members information.
(default: False)
--max-workers MAX_WORKERS
Max number of concurrent threads to fetch members details (1-32).
(default: 4)
Example of use:
openstack-lb-info
openstack-lb-info --type lb --name my_lb
openstack-lb-info --type lb --id load_balancer_id
openstack-lb-info --type amphora --id load_balancer_id
openstack-lb-info --type amphora --id load_balancer_id --details
Example
Authentication Methods
Environment Variables
You can manually set the required environment variables or source an OpenStack RC file.
clouds.yaml Configuration
Alternatively, you can use a clouds.yaml and export "OS_CLOUD" environment variable to pass the cloud name,
or specify it directly using the --os-cloud option.
For more information: https://docs.openstack.org/python-openstackclient/latest/cli/man/openstack.html
Installation
Install from PyPI:
pip install openstack-lb-info
Or, clone the repository and install from source in development mode:
git clone https://github.com/thobiast/openstack-loadbalancer-info.git
cd openstack-loadbalancer-info
python3 -m venv venv
source venv/bin/activate
pip install -e .
You can also use pipx to install it in an isolated environment automatically:
pipx install -e .
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openstack_lb_info-0.2.2.tar.gz.
File metadata
- Download URL: openstack_lb_info-0.2.2.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c821463f2fc4917ca647b2068be41aa4447678681a37d7254d8752f3cc7a106
|
|
| MD5 |
7f4898229d8785de817f3f92a8202785
|
|
| BLAKE2b-256 |
0905ba18132024a1b580afb1e07a95763efd01958740cbf2e05c4c8dcd655f5e
|
Provenance
The following attestation bundles were made for openstack_lb_info-0.2.2.tar.gz:
Publisher:
publish.yml on thobiast/openstack-loadbalancer-info
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openstack_lb_info-0.2.2.tar.gz -
Subject digest:
8c821463f2fc4917ca647b2068be41aa4447678681a37d7254d8752f3cc7a106 - Sigstore transparency entry: 725214399
- Sigstore integration time:
-
Permalink:
thobiast/openstack-loadbalancer-info@bd29d9b254b55c013adba2f80ab0ecaf5555064a -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/thobiast
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bd29d9b254b55c013adba2f80ab0ecaf5555064a -
Trigger Event:
release
-
Statement type:
File details
Details for the file openstack_lb_info-0.2.2-py3-none-any.whl.
File metadata
- Download URL: openstack_lb_info-0.2.2-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67508207dfa9228b2ab5c79dcdbb00acb58e633451e81166d7686c6568090f7a
|
|
| MD5 |
89105626b98a4f68fe13e042464d184e
|
|
| BLAKE2b-256 |
0e13c968e8672ec3c2d644057edef3266104e95345243d13d80ef1c09a957304
|
Provenance
The following attestation bundles were made for openstack_lb_info-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on thobiast/openstack-loadbalancer-info
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openstack_lb_info-0.2.2-py3-none-any.whl -
Subject digest:
67508207dfa9228b2ab5c79dcdbb00acb58e633451e81166d7686c6568090f7a - Sigstore transparency entry: 725214405
- Sigstore integration time:
-
Permalink:
thobiast/openstack-loadbalancer-info@bd29d9b254b55c013adba2f80ab0ecaf5555064a -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/thobiast
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bd29d9b254b55c013adba2f80ab0ecaf5555064a -
Trigger Event:
release
-
Statement type: