OpenKeel: the sovereign French Cloud solution of the inherent group, with a European reach Discover inherent

Reverse-spec · Clients

python-neutronclient — Interactions

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

CallWhenLibrarySource
version discovery, POST /v3/auth/tokensfirst authenticated request of the processkeystoneauth1, through the OSC session07 of the OSC specification
GET /v3/projects/{name}, then GET /v3/projects?name=network log create --project onlypython-keystoneclientneutronclient/osc/utils.py:64, [observed] log-create-project-found
GET /v3/domains/{name}, then GET /v3/domains?name=network log create --project-domainpython-keystoneclientneutronclient/osc/utils.py:59 [not run]
POST {auth_url}/tokens, v2 bodylibrary only, without a sessionrequestsneutronclient/client.py:221
GET {auth_url}/tokens/{token}/endpointslibrary only, token without endpoint, no sessionrequestsneutronclient/client.py:271

The legacy v2 frame, [observed] python-api:

{"auth": {"passwordCredentials": {"username": "u", "password": "p"}, "tenantName": "n"}}

2. Neutron

URL building

StackBase URL/v2.0 comes fromDiscoverySource
Class Clientcatalog URL for type network, region and interface of the CLIaction_prefix, appended to every pathnone: no GET /network was seen [observed discovery-log]neutronclient/v2_0/client.py:260, neutronclient/v2_0/client.py:279
openstacksdksame catalog URL_get_hardcoded_endpoint, only if the URL does not already end in v2.0none: 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]

HeaderClass Clientopenstacksdk
User-Agentpython-neutronclient (neutronclient/client.py:411)openstacksdk/4.20.0 keystoneauth1/5.17.0 python-requests/2.34.2 CPython/3.13.0
Acceptapplication/json (neutronclient/client.py:314)application/json on GET, */* on POST and PUT
Content-Typeapplication/json with a body (neutronclient/client.py:327)application/json with a body
X-Auth-Tokenyes, from the session (neutronclient/client.py:340)yes
X-OpenStack-Request-IDwhen global_request_id is given (neutronclient/client.py:416); not by the pluginnot set by the plugin
If-Match: revision_number=Nupdate_* methods given revision_number (neutronclient/v2_0/client.py:2546); no command doesno
OSProfiler headerswhen active (neutronclient/client.py:318)not read

Query strings and bodies

  • List: GET with urlencode(params, doseq=1) (neutronclient/v2_0/client.py:282). network log list sends no parameter, and SFC lists send none either [observed].
  • Lookup through the class: ?id=<uuid> when the value starts with a UUID, because re.match is not anchored at the end (neutronclient/v2_0/client.py:427); then ?name=<value>. find_resourceid_by_name_or_id adds fields=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 404 GET /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=next link of <collection>_links, keeps only its query and re-parses it (neutronclient/v2_0/client.py:383-401) [observed log-list-pagination]. The SDK does likewise for port_chains_links (openstacksdk:openstack/resource.py:2388) [observed sdk-list-pagination]. With page_reverse, the class follows previous.
  • Bodies: one envelope key, the singular resource: {"log": {…}}, {"port_chain": {…}}. The exception is onboard_network_subnets, whose body has no envelope: {"network_id": "<id>"}. Serialisation falls back to str(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

TopicClass Client through the pluginLibrary with retries=N
Retries0 (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=Falsenot usedstill raises, with Failed to connect Neutron server [observed connection-refused-no-raise]
Timeoutnone set by the plugin; the session's value applies [inferred]timeout= on HTTPClient (neutronclient/client.py:172)
URI lengthchecked before sending: endpoint + action ≤ 8,192 (neutronclient/client.py:44, neutronclient/client.py:333)same
Service downkeystoneauth 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.

ResourceRead by the clientSource
logid; on list event, target_id, resource_type, resource_id by key; the show and create columns accept any subsetneutronclient/osc/v2/logging/network_log.py:228-233
loggable_resources[]typeneutronclient/osc/v2/logging/network_log.py:45
flow_classifierid; on list protocol, *_ip_prefix, *_port_range_*, logical_*_port, l7_parametersneutronclient/osc/v2/sfc/sfc_flow_classifier.py:190-225
port_chainid, flow_classifiers, port_pair_groupsneutronclient/osc/v2/sfc/sfc_port_chain.py:216-219, neutronclient/osc/v2/sfc/sfc_port_chain.py:241-244
port_pair_groupid, port_pairs; the column Tap Enabled is SDK is_tap_enabled, body tap_enabledneutronclient/osc/v2/sfc/sfc_port_pair_group.py:38, openstacksdk:openstack/network/v2/sfc_port_pair_group.py:54
port_pair, service_graphidneutronclient/osc/v2/sfc/sfc_port_pair.py:178, neutronclient/osc/v2/sfc/sfc_service_graph.py:106
port, network, subnetpool, security_group, firewall_groupid in the lookupneutronclient/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.

ProjectConstructionSource
Novasession, auth, global_request_id, connect_retries, service_type, interface, region_name, endpoint_overridenova:nova/network/neutron.py:230-251
Heatsession, service_type, interface, region_name, connect_retriesheat:heat/engine/clients/os/neutron/__init__.py:57-69
Manilathrough client_auth, clientv20.Clientmanila:manila/network/neutron/api.py:114
Zunsession, endpoint_type, region_namezun:zun/common/clients.py:93
ec2-apisession, service_typeec2-api:ec2api/clients.py:77
Skylineversion, session, endpoint_override, global_request_idskyline-apiserver:skyline_apiserver/client/utils.py:195
heat-tempest-pluginsession, service_type, region_name, endpoint_typeheat-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.