Skip to content

[v2] networking/v2/layer3/routers: Add external gateways management#3611

Merged
mandre merged 3 commits intov2from
bp-v2-fd11834-ecbd02f-cab952c
Jan 28, 2026
Merged

[v2] networking/v2/layer3/routers: Add external gateways management#3611
mandre merged 3 commits intov2from
bp-v2-fd11834-ecbd02f-cab952c

Conversation

@gophercloud-backport-bot
Copy link
Copy Markdown

Backport: #3603

For #3567

Description

This PR adds support for managing external gateways on routers in the Neutron networking service. These operations extend the use of router.external_gateway_info to manage multiple external gateways on a single router.

New Functions

  • AddExternalGateways - Add external gateways to a router
  • UpdateExternalGateways - Update external gateways of a router
  • RemoveExternalGateways - Remove external gateways from a router

API Endpoints Implemented

Operation Method Endpoint
Add External Gateways PUT /v2.0/routers/{router_id}/add_external_gateways
Update External Gateways PUT /v2.0/routers/{router_id}/update_external_gateways
Remove External Gateways PUT /v2.0/routers/{router_id}/remove_external_gateways

References

Add support for managing external gateways on routers:
* AddExternalGateways
* UpdateExternalGateways
* RemoveExternalGateways
These operations extend router.external_gateway_info to support
multiple external gateways on a single router.
Ref: https://docs.openstack.org/api-ref/network/v2/index.html#add-external-gateways-to-router
@github-actions github-actions bot added edit:networking This PR updates networking code v2 This PR targets v2 semver:minor Backwards-compatible change labels Jan 22, 2026
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 63.653% (+0.03%) from 63.627%
when pulling 6b32231 on bp-v2-fd11834-ecbd02f-cab952c
into ba3d742 on v2.

addOpts := routers.AddExternalGatewaysOpts{
ExternalGateways: []routers.GatewayInfo{
{
NetworkID: choices.ExternalNetworkID,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how relevant the tests are because we're updating the existing external gateway to be exactly how it was. At least we can confirm this does not return an error :)

@mandre mandre merged commit 26c9c02 into v2 Jan 28, 2026
17 of 18 checks passed
@mandre mandre deleted the bp-v2-fd11834-ecbd02f-cab952c branch January 28, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

edit:networking This PR updates networking code semver:minor Backwards-compatible change v2 This PR targets v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants