{"library":"python-cinderclient","title":"OpenStack Cinder API Client Library","description":"python-cinderclient is the official Python client library for interacting with the OpenStack Block Storage (Cinder) API. It provides both a Python API (the `cinderclient` module) and a command-line interface (`cinder`). It aims to implement 100% of the OpenStack Cinder API. The library is actively maintained as part of the OpenStack ecosystem, with releases typically aligning with OpenStack's development cycle, alongside more frequent patch releases. The current version is 9.9.0.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install python-cinderclient"],"cli":{"name":"cinder","version":"9.9.0"}},"imports":["from cinderclient.v3 import client"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom keystoneauth1 import loading\nfrom keystoneauth1 import session\nfrom cinderclient.v3 import client as cinder_client\n\n# Set environment variables or replace with actual values\nOS_AUTH_URL = os.environ.get('OS_AUTH_URL', 'http://localhost:5000/v3')\nOS_USERNAME = os.environ.get('OS_USERNAME', 'admin')\nOS_PASSWORD = os.environ.get('OS_PASSWORD', 'password')\nOS_PROJECT_ID = os.environ.get('OS_PROJECT_ID', 'project_id') # Or OS_PROJECT_NAME\nOS_REGION_NAME = os.environ.get('OS_REGION_NAME', 'RegionOne')\nOS_VOLUME_API_VERSION = os.environ.get('OS_VOLUME_API_VERSION', '3')\n\n# Load the authentication plugin\nloader = loading.get_plugin_loader('password')\nauth = loader.load_from_options(\n    auth_url=OS_AUTH_URL,\n    username=OS_USERNAME,\n    password=OS_PASSWORD,\n    project_id=OS_PROJECT_ID, # Use project_id or project_name\n    user_domain_name='Default', # Often 'Default' for typical OpenStack setups\n    project_domain_name='Default'\n)\n\n# Create a session\nsess = session.Session(auth=auth)\n\n# Create the Cinder client\ncinder = cinder_client.Client(OS_VOLUME_API_VERSION, session=sess, region_name=OS_REGION_NAME)\n\n# Example: List volumes\ntry:\n    volumes = cinder.volumes.list()\n    print(f\"Successfully listed volumes: {volumes}\")\nexcept Exception as e:\n    print(f\"Error listing volumes: {e}\")","lang":"python","description":"This quickstart demonstrates how to authenticate with OpenStack Keystone using `keystoneauth1` and then create a Cinder client to list volumes. It is recommended to set OpenStack credentials as environment variables (`OS_AUTH_URL`, `OS_USERNAME`, `OS_PASSWORD`, `OS_PROJECT_ID`/`OS_PROJECT_NAME`, `OS_REGION_NAME`, `OS_VOLUME_API_VERSION`) for security and ease of use. The client is initialized for Cinder API v3, which is the recommended version.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"9.7.0","pypi_latest":"9.9.0","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":4.5,"avg_import_s":1.2,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"python-cinderclient","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.12,"mem_mb":15.7,"disk_size":"46.2M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"python-cinderclient","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.5,"import_time_s":0.77,"mem_mb":15.7,"disk_size":"47M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"python-cinderclient","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.51,"mem_mb":17.3,"disk_size":"51.1M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"python-cinderclient","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.2,"import_time_s":1.39,"mem_mb":17.3,"disk_size":"52M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"python-cinderclient","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.32,"mem_mb":16.9,"disk_size":"51.3M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"python-cinderclient","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.3,"import_time_s":1.4,"mem_mb":16.9,"disk_size":"53M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"python-cinderclient","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.26,"mem_mb":17.8,"disk_size":"51.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"python-cinderclient","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.4,"import_time_s":1.25,"mem_mb":17.8,"disk_size":"52M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"python-cinderclient","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.1,"mem_mb":15.2,"disk_size":"48.2M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"python-cinderclient","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.2,"import_time_s":0.91,"mem_mb":15.2,"disk_size":"49M"}]}}