{"id":6839,"library":"python-neutronclient","title":"OpenStack Neutron Client (Deprecated)","description":"python-neutronclient is a client library for the OpenStack Networking (Neutron) API. It provides Python API bindings and previously included a command-line interface. As of version 11.8.0, the project is deprecated; its CLI code has been removed, and no new features will be added. All new development and migrations under OpenStack governance are directed towards using OpenStackSDK and OpenStack Client.","status":"deprecated","version":"11.8.0","language":"en","source_language":"en","source_url":"https://github.com/openstack/python-neutronclient","tags":["openstack","networking","neutron","client","deprecated","cloud"],"install":[{"cmd":"pip install python-neutronclient","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required Python version","package":"python","optional":false},{"reason":"Required for authentication with OpenStack Identity (Keystone)","package":"keystoneauth1","optional":false},{"reason":"Increasingly used as a dependency, also the recommended migration path","package":"openstacksdk","optional":false},{"reason":"Underlying HTTP client library","package":"requests","optional":false}],"imports":[{"symbol":"Client","correct":"from neutronclient.v2_0 import client"}],"quickstart":{"code":"import os\nfrom keystoneauth1 import identity\nfrom keystoneauth1 import session\nfrom neutronclient.v2_0 import client\n\n# Set these environment variables or replace with actual values\nOS_AUTH_URL = os.environ.get('OS_AUTH_URL', 'http://auth.example.com:5000/v3')\nOS_USERNAME = os.environ.get('OS_USERNAME', 'your_username')\nOS_PASSWORD = os.environ.get('OS_PASSWORD', 'your_password')\nOS_PROJECT_NAME = os.environ.get('OS_PROJECT_NAME', 'your_project_name')\nOS_USER_DOMAIN_NAME = os.environ.get('OS_USER_DOMAIN_NAME', 'Default')\nOS_PROJECT_DOMAIN_NAME = os.environ.get('OS_PROJECT_DOMAIN_NAME', 'Default')\n\n# Authenticate using Keystone v3 password flow\nauth = identity.Password(\n    auth_url=OS_AUTH_URL,\n    username=OS_USERNAME,\n    password=OS_PASSWORD,\n    project_name=OS_PROJECT_NAME,\n    user_domain_name=OS_USER_DOMAIN_NAME,\n    project_domain_name=OS_PROJECT_DOMAIN_NAME\n)\nsess = session.Session(auth=auth)\n\n# Create a Neutron client instance\nneutron_client = client.Client(session=sess)\n\n# Example: List networks\ntry:\n    networks = neutron_client.list_networks()\n    print(\"Networks:\")\n    for net in networks['networks']:\n        print(f\"  - {net['name']} ({net['id']})\")\nexcept Exception as e:\n    print(f\"Error listing networks: {e}\")","lang":"python","description":"This quickstart demonstrates how to authenticate with OpenStack Keystone using environment variables and then initialize the Neutron client to list networks. It uses `keystoneauth1` for robust session management."},"warnings":[{"fix":"Migrate your codebase to use `openstacksdk` (for library usage) or `openstackclient` (for CLI). For example, `openstacksdk.connect()` provides a unified client.","message":"The `python-neutronclient` project is officially deprecated. Its command-line interface (CLI) code has been deleted, and no new features will be added to the Python API bindings. Users are strongly encouraged to migrate to `openstacksdk` for Python API interactions and `openstackclient` for CLI operations.","severity":"breaking","affected_versions":"All versions, explicitly stated as deprecated from 11.x.x onwards."},{"fix":"Use the unified `openstack` CLI, which integrates network commands. Example: `openstack network list` instead of `neutron net-list`.","message":"The `neutron` CLI (provided by older versions of `python-neutronclient`) was deprecated from the OpenStack Ocata release. While `python-neutronclient` provided extensions for the unified `openstackclient`, the primary CLI for networking functionality is now `openstackclient`.","severity":"deprecated","affected_versions":"All versions since OpenStack Ocata (approx. 2017), explicitly from `python-neutronclient` versions where CLI was removed (e.g., 11.x.x)."},{"fix":"Ensure your authentication uses Keystone v3.0. This involves providing domain-specific parameters (e.g., `user_domain_name`, `project_domain_name`) when configuring the `keystoneauth1.identity.Password` plugin.","message":"Authenticating with OpenStack Identity (Keystone) v2.0 is deprecated. Using v2.0 may lead to authentication issues or limited functionality as OpenStack services increasingly require v3.0.","severity":"gotcha","affected_versions":"All versions, especially when interacting with modern OpenStack clouds."},{"fix":"Double-check that all required environment variables are correctly set and accessible to your application. If tokens are managed manually, ensure they are fresh. Using `keystoneauth1.session.Session` is the recommended way to handle token refresh automatically.","message":"Common authentication failures, such as `Unauthorized` or `EndpointNotFound`, often result from incorrect or missing OpenStack environment variables (e.g., `OS_AUTH_URL`, `OS_USERNAME`, `OS_PASSWORD`, `OS_PROJECT_NAME`, `OS_USER_DOMAIN_NAME`, `OS_PROJECT_DOMAIN_NAME`) or an expired authentication token.","severity":"gotcha","affected_versions":"All versions."}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}