Metadata-Version: 2.4
Name: openstack-lb-treeview
Version: 0.1.1
Summary: Display a tree view of OpenStack loadbalancers, pools, and members
Home-page: https://github.com/SamuAlfageme/openstack-lb-treeview
Author: Samuel Alfageme Sainz
Author-email: Samuel Alfageme Sainz <samuel@alfage.me>
License-Expression: MIT
Project-URL: Homepage, https://github.com/SamuAlfageme/openstack-lb-treeview
Project-URL: Repository, https://github.com/SamuAlfageme/openstack-lb-treeview
Project-URL: Issues, https://github.com/SamuAlfageme/openstack-lb-treeview/issues
Keywords: openstack,loadbalancer,octavia,treeview
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: System Administrators
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openstacksdk>=1.0.0
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# OpenStack Load Balancer Tree View

A Python script that displays a tree view of all loadbalancers in an OpenStack project, showing pools and members in a hierarchical structure.

## Features

- Displays loadbalancers as root nodes
- Shows pools as children of loadbalancers
- Shows members as children of pools
- Highlights members with `provisioning_status != ACTIVE` (yellow/bold)
- Displays members with `operating_status != ONLINE` in red
- **Filter mode**: Show only problematic members (not ACTIVE/ONLINE) and pools with no members

## Installation

### Install globally via pip

Install directly from the source directory:
```bash
pip install /path/to/openstack-lb-treeview
```

Or if you've published to PyPI:
```bash
pip install openstack-lb-treeview
```

After installation, the `openstack-lb-treeview` command will be available globally.

### Set up OpenStack credentials

Set up your OpenStack credentials. You can either:
- Set environment variables (OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, etc.)
- Use a `clouds.yaml` file in `~/.config/openstack/` or `/etc/openstack/`

## Usage

After installation, use the `openstack-lb-treeview` command:

Basic usage (uses environment variables for authentication):
```bash
openstack-lb-treeview
```

Specify a cloud from clouds.yaml:
```bash
openstack-lb-treeview --cloud mycloud
```

Filter by project ID:
```bash
openstack-lb-treeview --project-id <project-id>
```

Filter mode (only show problematic members and empty pools):
```bash
openstack-lb-treeview --filter
```

### Development Usage

If running from source without installation:
```bash
python -m openstack_lb_treeview.lb_treeview
```

Or directly:
```bash
python openstack_lb_treeview/lb_treeview.py
```

## Example Output

Normal mode:
```
📦 my-loadbalancer (ID: abc123...)
  ├─ 🏊 pool-1 (ID: def456...)
  │  ├─ 👤 member-1 (provisioning: ACTIVE | operating: ONLINE)
  │  └─ 👤 member-2 (provisioning: PENDING_CREATE | operating: OFFLINE)
  └─ 🏊 pool-2 (ID: ghi789...)
     └─ 👤 member-3 (provisioning: ACTIVE | operating: ONLINE)
```

Filter mode (`--filter`):
```
📦 my-loadbalancer (ID: abc123...)
  ├─ 🏊 pool-1 (ID: def456...)
  │  └─ 👤 member-2 (provisioning: PENDING_CREATE | operating: OFFLINE)
  └─ 🏊 pool-3 (ID: xyz789...)
     └─ No members
```

In filter mode, only pools with problematic members (not ACTIVE or not ONLINE) or pools with no members are shown.

## Requirements

- Python 3.6+
- openstacksdk
- OpenStack credentials with appropriate permissions

