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.
pip install python-neutronclientVerified import paths — ran on the pinned version, not inferred.
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.
Migrate your codebase to use `openstacksdk` (for library usage) or `openstackclient` (for CLI). For example, `openstacksdk.connect()` provides a unified client.
Use the unified `openstack` CLI, which integrates network commands. Example: `openstack network list` instead of `neutron net-list`.
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.
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.
Use the `openstack` command-line client from `python-openstackclient` for OpenStack Networking operations. Example: `openstack network list`.
Refactor your Python code to use the `openstacksdk` library for programmatic OpenStack API interactions. Example: `from openstack import connection`.
Ensure your environment variables (like OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_PROJECT_NAME) are correctly set, or pass the correct credentials directly to the `neutronclient.v2_0.client.Client` constructor. For new development, consider using `openstacksdk` which offers robust authentication mechanisms.