python-designateclient is a Python client library for OpenStack's DNS-as-a-Service (Designate) API. It provides a Python API for programmatic interaction with Designate and also ships with a command-line tool. The current version is 6.4.0. The library follows the OpenStack release cycle, typically seeing new versions every six months, aligned with OpenStack major releases.
Install & Compatibility
Where this runs
tested against v6.4.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
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.871s · 108.2MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 9.8s · import 0.805s · 109MB
116MB installed
● package 116MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Always import the v2 client explicitly as v1 APIs are older and may be deprecated or have different functionality.
from designateclient.v2 import client
While v3 is still functional, `keystoneauth1.identity.generic` is the recommended and more flexible way to handle password-based authentication for OpenStack SDKs and clients.
from keystoneauth1.identity import generic
This quickstart demonstrates how to authenticate with an OpenStack cloud using environment variables and then initialize the Designate v2 client. It proceeds to list existing DNS zones. Ensure your OpenStack environment variables (OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_PROJECT_NAME, OS_PROJECT_DOMAIN_NAME, OS_USER_DOMAIN_NAME) are set for authentication.
import os
from keystoneauth1.identity import generic
from keystoneauth1 import session as keystone_session
from designateclient.v2 import client
# OpenStack credentials from environment variables
auth_url = os.environ.get('OS_AUTH_URL', 'https://your-openstack-cloud.com:5000/v3')
username = os.environ.get('OS_USERNAME', 'your-username')
password = os.environ.get('OS_PASSWORD', 'your-password')
project_name = os.environ.get('OS_PROJECT_NAME', 'your-project')
project_domain_name = os.environ.get('OS_PROJECT_DOMAIN_NAME', 'Default')
user_domain_name = os.environ.get('OS_USER_DOMAIN_NAME', 'Default')
if not all([auth_url, username, password, project_name, project_domain_name, user_domain_name]):
print("Please set OpenStack environment variables (OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_PROJECT_NAME, OS_PROJECT_DOMAIN_NAME, OS_USER_DOMAIN_NAME)")
exit(1)
# Authenticate with Keystone
auth = generic.Password(
auth_url=auth_url,
username=username,
password=password,
project_name=project_name,
project_domain_name=project_domain_name,
user_domain_name=user_domain_name
)
session = keystone_session.Session(auth=auth)
# Initialize Designate client
desig_client = client.Client(session=session)
try:
# List all zones
zones = desig_client.zones.list()
print(f"Found {len(zones)} DNS zones:")
for zone in zones:
print(f" - {zone.name} (ID: {zone.id})")
# Example: Create a new zone (replace with your domain and email)
# new_zone_name = 'example.com.'
# new_zone_email = 'admin@example.com'
# new_zone = desig_client.zones.create(new_zone_name, email=new_zone_email)
# print(f"Created new zone: {new_zone.name} (ID: {new_zone.id})")
except Exception as e:
print(f"An error occurred: {e}")
designate --version
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.