Skip to content

Neutron v2: AddGatewayNetwork, RemoveGatewayNetwork and GetAdvertised…#2406

Merged
mandre merged 1 commit intogophercloud:masterfrom
shhgs:2022-05-20
May 26, 2022
Merged

Neutron v2: AddGatewayNetwork, RemoveGatewayNetwork and GetAdvertised…#2406
mandre merged 1 commit intogophercloud:masterfrom
shhgs:2022-05-20

Conversation

@shhgs
Copy link
Copy Markdown
Contributor

@shhgs shhgs commented May 20, 2022

Neutron V2: BGP Dynamic Routing
For #2208

$ git diff --stat official/master                                                                                                                      
 acceptance/openstack/networking/v2/extensions/bgp/speakers/bgpspeakers_test.go | 27 +++++++++++++++++++++++++++                                                                                                   
 openstack/networking/v2/extensions/bgp/speakers/doc.go                         | 42 ++++++++++++++++++++++++++++++++++++++++++
 openstack/networking/v2/extensions/bgp/speakers/requests.go                    | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 openstack/networking/v2/extensions/bgp/speakers/results.go                     | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 openstack/networking/v2/extensions/bgp/speakers/testing/fixture.go             | 25 +++++++++++++++++++++++++
 openstack/networking/v2/extensions/bgp/speakers/testing/requests_test.go       | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 openstack/networking/v2/extensions/bgp/speakers/urls.go                        | 15 +++++++++++++++
 7 files changed, 307 insertions(+)

@shhgs
Copy link
Copy Markdown
Contributor Author

shhgs commented May 20, 2022

This is the last PR for bgp/speakers. There will still be one (hopefully) PR for agents, a.k.a. /v2.0/agents/{agent-id}/bgp-drinstances.

@coveralls
Copy link
Copy Markdown

coveralls commented May 20, 2022

Coverage Status

Coverage increased (+0.02%) to 79.987% when pulling b957a55 on shhgs:2022-05-20 into c596f3b on gophercloud:master.

Example:


opts := speakers.AddGatewayNetworkOpts{NetworkID: networkID}
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.

Nit: it looks like you have a mix of tabs and spaces.

Suggested change
opts := speakers.AddGatewayNetworkOpts{NetworkID: networkID}
opts := speakers.AddGatewayNetworkOpts{NetworkID: networkID}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed the issue.


Example:

opts := speakers.RemoveGatewayNetworkOpts{NetworkID: networkID}
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.

ditto

Suggested change
opts := speakers.RemoveGatewayNetworkOpts{NetworkID: networkID}
opts := speakers.RemoveGatewayNetworkOpts{NetworkID: networkID}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

return
}

// GetAdvertisedRoutes a.k.a. GET /v2.0/bgp-speakers/{bgp-speaker-id}/bgp-dragents
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.

Suggested change
// GetAdvertisedRoutes a.k.a. GET /v2.0/bgp-speakers/{bgp-speaker-id}/bgp-dragents
// GetAdvertisedRoutes a.k.a. GET /bgp-speakers/{id}/get_advertised_routes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

}

// AddGatewayNetwork a.k.a. PUT /v2.0/bgp-speakers/{bgp-speaker-id}/add_gateway_network
func AddGatewayNetwork(c *gophercloud.ServiceClient, bgpSpeakerID string, opts AddGatewayNetworkOpts) (r AddGatewayNetworkResult) {
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.

Same comment as in #2400, we should make use of the AddGatewayNetworkOptsBuilder interface.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

}

// RemoveGatewayNetwork a.k.a. PUT /v2.0/bgp-speakers/{bgp-speaker-id}/remove_gateway_network
func RemoveGatewayNetwork(c *gophercloud.ServiceClient, bgpSpeakerID string, opts RemoveGatewayNetworkOpts) (r RemoveGatewayNetworkResult) {
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.

Same for the RemoveGatewayNetworkOptsBuilder interface.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@shhgs
Copy link
Copy Markdown
Contributor Author

shhgs commented May 24, 2022

Thanks @mandre, I fixed the problems you pointed.

Copy link
Copy Markdown
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

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

LGTM

@mandre mandre merged commit d987a08 into gophercloud:master May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants