Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for firewall rule handling using NSX-V edge gateway API #247

Merged
merged 23 commits into from
Oct 22, 2019

Conversation

Didainius
Copy link
Collaborator

@Didainius Didainius commented Sep 30, 2019

This PR adds:

  • Support for firewall handling using NSX-V API: CreateNsxvFirewall(), UpdateNsxvFirewall(), GetNsxvFirewallById(), DeleteNsxvFirewallById() and GetAllNsxvFirewallRules()
  • Support for enabling/disabling and altering default firewall rule as edge gateway methods: GetFwGeneralParams(), UpdateFwGeneralParams()
  • Additionally GetAnyVnicIndexByNetworkName() to for easier interface (vNic) lookup in edge gateway
  • New variation of execution function ExecuteParamRequestWithCustomError() which adds query parameter support on top of ExecuteRequestWithCustomError()
  • New types EdgeFirewallRule and FwGeneralParamsWithXml for firewall manipulation

Note Full test suite passed on vCD 9.5 and 10

Copy link
Contributor

@vbauzys vbauzys left a comment

Choose a reason for hiding this comment

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

First scan :) nice work

Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

First pass.

Copy link
Contributor

@dataclouder dataclouder left a comment

Choose a reason for hiding this comment

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

Preliminary review. More after testing

@Didainius
Copy link
Collaborator Author

Acceptance tests passed on 9.5 and 10

Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

Getting close!

Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

LGTM now!

Copy link
Contributor

@dataclouder dataclouder left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@vbauzys vbauzys left a comment

Choose a reason for hiding this comment

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

LGTM, just function description needs improvement

// GetNsxvFirewallRuleById retrieves types.EdgeFirewallRule by firewall rule ID as shown in the UI using proxied
// NSX-V API.
// It returns and error `ErrorEntityNotFound` if the firewall rule is not found
func (egw *EdgeGateway) GetNsxvFirewallRuleById(id string) (*types.EdgeFirewallRule, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Get and delete use internal IDs or UI IDs. From comment I am not sure

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. Improved comments.

@Didainius Didainius merged commit a6af6b4 into vmware:master Oct 22, 2019
funky81 added a commit to funky81/go-vcloud-director that referenced this pull request Oct 22, 2019
…re#253)

* Deprecated find disk functions and added new get Disk functions
* change getDisk to be getDisks
* Improve tests
* Updated to use parent - enforced implementation

Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>

(cherry picked from commit 9f7abf2)
Add support for firewall rule handling using NSX-V edge gateway API (vmware#247)

* Added methods `CreateNsxvFirewallRule()`, `UpdateNsxvFirewallRule()`, `GetNsxvFirewallRuleById()`, `DeleteNsxvFirewallRuleById()`
which use the proxied NSX-V API of advanced edge gateway for handling firewall rules
* Added methods `GetFirewallParams()`, `UpdateFirewallParams()` for changing global firewall settings
* Added method `GetAnyVnicIndexByNetworkName()` to for easier interface (vNic) lookup in edge gateway
* Added method `ExecuteParamRequestWithCustomError()` which adds query parameter support on top of `ExecuteRequestWithCustomError()`

(cherry picked from commit a6af6b4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants