Interactions — python-neutronclient — branch stable/2026.2
Branch
stable/2026.2@596a9d99b188(14.0.0+ 2 maintenance commits) — repository https://opendev.org/openstack/python-neutronclient — analysed on 2026-11-01
The package has no database, message bus, cache, file output or subprocess: a search of the non-test code finds no subprocess, getpass or input(, so no command had to be left out of the probes. It only sends REST calls. [observed] means seen on the local stub, which is not Neutron.
1. Keystone
| Call | When | Library | Source |
|---|---|---|---|
version discovery, POST /v3/auth/tokens | first authenticated request of the process | keystoneauth1, through the OSC session | 07 of the OSC specification |
GET /v3/projects/{name}, then GET /v3/projects?name= | network log create --project only | python-keystoneclient | neutronclient/osc/utils.py:64, [observed] log-create-project-found |
GET /v3/domains/{name}, then GET /v3/domains?name= | network log create --project-domain | python-keystoneclient | neutronclient/osc/utils.py:59 [not run] |
POST {auth_url}/tokens, v2 body | library only, without a session | requests | neutronclient/client.py:221 |
GET {auth_url}/tokens/{token}/endpoints | library only, token without endpoint, no session | requests | neutronclient/client.py:271 |
The legacy v2 frame, [observed] python-api:
{"auth": {"passwordCredentials": {"username": "u", "password": "p"}, "tenantName": "n"}}
2. Neutron
URL building
| Stack | Base URL | /v2.0 comes from | Discovery | Source |
|---|---|---|---|---|
Class Client | catalog URL for type network, region and interface of the CLI | action_prefix, appended to every path | none: no GET /network was seen [observed discovery-log] | neutronclient/v2_0/client.py:260, neutronclient/v2_0/client.py:279 |
| openstacksdk | same catalog URL | _get_hardcoded_endpoint, only if the URL does not already end in v2.0 | none: no GET /network was seen [observed discovery-sfc] | openstacksdk:openstack/config/cloud_region.py:1130, openstacksdk:openstack/config/cloud_region.py:1210 |
A catalog URL ending in /v2.0 therefore gives /network/v2.0/v2.0/log/logs on binding commands (404 on the stub) and /network/v2.0/sfc/port_chains on SDK commands [observed catalog-v2-log, catalog-v2-sfc].
The stub's version document needed no fix for this plugin: neither stack asks for it.
Request headers [observed]
| Header | Class Client | openstacksdk |
|---|---|---|
User-Agent | python-neutronclient (neutronclient/client.py:411) | openstacksdk/4.20.0 keystoneauth1/5.17.0 python-requests/2.34.2 CPython/3.13.0 |
Accept | application/json (neutronclient/client.py:314) | application/json on GET, */* on POST and PUT |
Content-Type | application/json with a body (neutronclient/client.py:327) | application/json with a body |
X-Auth-Token | yes, from the session (neutronclient/client.py:340) | yes |
X-OpenStack-Request-ID | when global_request_id is given (neutronclient/client.py:416); not by the plugin | not set by the plugin |
If-Match: revision_number=N | update_* methods given revision_number (neutronclient/v2_0/client.py:2546); no command does | no |
| OSProfiler headers | when active (neutronclient/client.py:318) | not read |
Query strings and bodies
- List:
GETwithurlencode(params, doseq=1)(neutronclient/v2_0/client.py:282).network log listsends no parameter, and SFC lists send none either [observed]. - Lookup through the class:
?id=<uuid>when the value starts with a UUID, becausere.matchis not anchored at the end (neutronclient/v2_0/client.py:427); then?name=<value>.find_resourceid_by_name_or_idaddsfields=id(neutronclient/neutron/v2_0/__init__.py:53) [observed:/v2.0/security-groups?name=x&fields=id]. - Lookup through the SDK:
GET /sfc/port_chains/{name}, then on 404GET /sfc/port_chains?name=[observed]. Two entries of the same name are refused by the SDK [inferred,openstacksdk:openstack/resource.py:2492]. - Pagination: the class follows the
rel=nextlink of<collection>_links, keeps only its query and re-parses it (neutronclient/v2_0/client.py:383-401) [observedlog-list-pagination]. The SDK does likewise forport_chains_links(openstacksdk:openstack/resource.py:2388) [observedsdk-list-pagination]. Withpage_reverse, the class followsprevious. - Bodies: one envelope key, the singular resource:
{"log": {…}},{"port_chain": {…}}. The exception isonboard_network_subnets, whose body has no envelope:{"network_id": "<id>"}. Serialisation falls back tostr(obj)(neutronclient/common/serializer.py:49).
All routes, with their commands, are in the API surface, and the sample bodies are in § 4 of 01.
Sample exchange [observed log-create-sg]
GET /network/v2.0/security-groups?name=y
User-Agent: python-neutronclient
Accept: application/json
X-Auth-Token: stub-token
POST /network/v2.0/log/logs
Content-Type: application/json
{"log": {"resource_type": "security_group", "resource_id": "9c96e6ac-51f4-5ad3-add1-5f6deffde30f", "event": "DROP", "name": "n"}}
Statuses accepted
The class treats 200, 201, 202 and 204 as success (neutronclient/v2_0/client.py:291-294). Everything else goes through the error path of 02, including a 3xx that keystoneauth did not follow.
Retry and timeout
| Topic | Class Client through the plugin | Library with retries=N |
|---|---|---|
| Retries | 0 (neutronclient/v2_0/client.py:256) | GET, PUT, DELETE, N extra attempts after retry_interval = 1 s, on connection errors only. POST is never retried, to avoid orphans (neutronclient/v2_0/client.py:326-352, neutronclient/v2_0/client.py:362) |
raise_errors=False | not used | still raises, with Failed to connect Neutron server [observed connection-refused-no-raise] |
| Timeout | none set by the plugin; the session's value applies [inferred] | timeout= on HTTPClient (neutronclient/client.py:172) |
| URI length | checked before sending: endpoint + action ≤ 8,192 (neutronclient/client.py:44, neutronclient/client.py:333) | same |
| Service down | keystoneauth ConnectFailure text, exit 1 [observed service-down-log, service-down-sfc] |
Nova and Heat pass connect_retries to the Adapter instead (nova:nova/network/neutron.py:237, heat:heat/engine/clients/os/neutron/__init__.py:66).
Response fields read by the commands
Only what the client reads, not what a service may send.
| Resource | Read by the client | Source |
|---|---|---|
log | id; on list event, target_id, resource_type, resource_id by key; the show and create columns accept any subset | neutronclient/osc/v2/logging/network_log.py:228-233 |
loggable_resources[] | type | neutronclient/osc/v2/logging/network_log.py:45 |
flow_classifier | id; on list protocol, *_ip_prefix, *_port_range_*, logical_*_port, l7_parameters | neutronclient/osc/v2/sfc/sfc_flow_classifier.py:190-225 |
port_chain | id, flow_classifiers, port_pair_groups | neutronclient/osc/v2/sfc/sfc_port_chain.py:216-219, neutronclient/osc/v2/sfc/sfc_port_chain.py:241-244 |
port_pair_group | id, port_pairs; the column Tap Enabled is SDK is_tap_enabled, body tap_enabled | neutronclient/osc/v2/sfc/sfc_port_pair_group.py:38, openstacksdk:openstack/network/v2/sfc_port_pair_group.py:54 |
port_pair, service_graph | id | neutronclient/osc/v2/sfc/sfc_port_pair.py:178, neutronclient/osc/v2/sfc/sfc_service_graph.py:106 |
port, network, subnetpool, security_group, firewall_group | id in the lookup | neutronclient/osc/v2/sfc/sfc_port_pair.py:229, neutronclient/osc/v2/subnet_onboard/subnet_onboard.py:58-59 |
3. Other projects using the library
Details are in 07 § 4. All build a Client from a keystoneauth session, so none uses HTTPClient.
| Project | Construction | Source |
|---|---|---|
| Nova | session, auth, global_request_id, connect_retries, service_type, interface, region_name, endpoint_override | nova:nova/network/neutron.py:230-251 |
| Heat | session, service_type, interface, region_name, connect_retries | heat:heat/engine/clients/os/neutron/__init__.py:57-69 |
| Manila | through client_auth, clientv20.Client | manila:manila/network/neutron/api.py:114 |
| Zun | session, endpoint_type, region_name | zun:zun/common/clients.py:93 |
| ec2-api | session, service_type | ec2-api:ec2api/clients.py:77 |
| Skyline | version, session, endpoint_override, global_request_id | skyline-apiserver:skyline_apiserver/client/utils.py:195 |
| heat-tempest-plugin | session, service_type, region_name, endpoint_type | heat-tempest-plugin:heat_tempest_plugin/services/clients.py:152 |
Source: reverse-spec-python-neutronclient/03-interactions_stable-2026.2.md. The _rewrite/ and _inventory/ files are not published on the site.