Registry / http-networking / python-octaviaclient

python-octaviaclient

JSON →
library3.14.0pypypiunverified

The `python-octaviaclient` library provides a client for interacting with the OpenStack Octavia Load Balancing service API (primarily v2). It allows users to programmatically manage load balancers, listeners, pools, members, and health monitors within an OpenStack environment. The current version is 3.13.0, and releases generally follow OpenStack development cycles, with patch releases occurring as needed.

pip install python-octaviaclient
INSTALL
IMPORT
SIG · PYTHON-OCTAVIACLIE
P
python-octaviaclient
http-networkingpythonv3.14.0
Install
10.9s avg
Import
Disk
136MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.14.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 124.7MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 10.9s · import 0.000s · 126MB
136MB installed
● package 136MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
from octaviaclient.v2.client import Client
from octaviaclient.v2.client import Client

This quickstart demonstrates how to initialize the Octavia client using Keystone v3 authentication, retrieve an authenticated session, and then list existing load balancers. It relies on standard OpenStack environment variables for credentials. Ensure these are set or replace `os.environ.get` calls with your specific values.

import os from keystoneauth1.identity import v3 from keystoneauth1.session import Session from keystoneauth1.adapter import Adapter from octaviaclient.v2.client import Client # Set OpenStack authentication environment variables (e.g., OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, etc.) # Or directly provide credentials auth = v3.Password( auth_url=os.environ.get('OS_AUTH_URL', 'http://localhost:5000/v3'), username=os.environ.get('OS_USERNAME', 'admin'), password=os.environ.get('OS_PASSWORD', 'password'), project_name=os.environ.get('OS_PROJECT_NAME', 'admin'), user_domain_name=os.environ.get('OS_USER_DOMAIN_NAME', 'Default'), project_domain_name=os.environ.get('OS_PROJECT_DOMAIN_NAME', 'Default') ) sess = Session(auth=auth) # Create an Octavia client adapter octavia_client = Client( session=sess, region_name=os.environ.get('OS_REGION_NAME', None), service_type='load-balancer', interface='public' ) try: # Example: List all load balancers load_balancers = octavia_client.loadbalancer.list() print(f"Found {len(load_balancers)} load balancers:") for lb in load_balancers: print(f" - ID: {lb['id']}, Name: {lb['name']}, Provisioning Status: {lb['provisioning_status']}") except Exception as e: print(f"Error connecting to Octavia or listing load balancers: {e}") print("Please ensure your OpenStack environment variables are correctly set.")
openstack --version
Debug
Known issues
gotchaAuthentication requires `keystoneauth1`. Users commonly forget to install it or configure it correctly, leading to authentication errors or `ImportError`.
fix
Ensure `pip install keystoneauth1` is run and that OpenStack environment variables (e.g., `OS_AUTH_URL`, `OS_USERNAME`, `OS_PASSWORD`, `OS_PROJECT_NAME`, etc.) are correctly set or provided programmatically.
affects: All versions
breakingThe client is designed for Octavia API v2. Direct support for any hypothetical Octavia API v1 is not present in this client. Attempting to use older API versions or endpoints will result in errors.
fix
Ensure that the Octavia service endpoint configured in your OpenStack environment (or passed to the client) corresponds to API v2, typically `/v2.0` suffix. The client's imports explicitly use `v2`.
affects: All 3.x versions
gotchaThe client methods return dictionaries (or lists of dictionaries) representing API resources, not custom object classes. This means direct attribute access (e.g., `lb.name`) will not work; dictionary key access (e.g., `lb['name']`) is required.
fix
Always access resource properties using dictionary syntax, e.g., `load_balancer['id']` or `load_balancer['name']`. If you prefer object-like access, consider wrapping the dictionaries in a custom class or using `openstacksdk` which provides object abstractions.
affects: All 3.x versions
Upgrade
Version history
3.14.0latest on PyPI · released May 13, 2026
Audit
Dependencies
keystoneauth1requiredRequired for authentication with OpenStack Keystone.
Agent activity
16 hits · last 30 days
node
16
Resources
python-octaviaclient — pip install python-octaviaclient · libregistry