Skip to content

Add privateendport and publicendport parameters to createPortForwardingRule API #113

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Jun 20, 2025

This PR adds privateendport and publicendport parameters to createPortForwardingRule API.

Fixes #101

@sureshanaparti sureshanaparti requested a review from Copilot June 20, 2025 05:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the createPortForwardingRule API by introducing two new parameters to control end-port ranges for private and public ports.

  • Extended NewCreatePortForwardingRuleParams signatures in interface, implementation, and mocks to include privateendport and publicendport.
  • Updated requiredParams map to mark the new parameters as required.
  • Adjusted existing tests to invoke the method with the new parameters.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
test/FirewallService_test.go Updated test invocation to include privateendport and publicendport.
generate/requiredParams.go Added privateendport and publicendport under createPortForwardingRule.
cloudstack/FirewallService_mock.go Expanded mock signatures and call records for the new parameters.
cloudstack/FirewallService.go Extended interface and implementation methods, mapping new params.
Comments suppressed due to low confidence (3)

test/FirewallService_test.go:96

  • Add assertions in the test to verify that "privateendport" and "publicendport" are correctly set in the params map, ideally using distinct non-zero values to ensure they're passed through.
		p := client.Firewall.NewCreatePortForwardingRuleParams("ipaddressid", 0, 0, "protocol", 0, 0, "virtualmachineid")

cloudstack/FirewallService.go:1415

  • The function comment above this method should be updated to document the new privateendport and publicendport parameters for clarity.
func (s *FirewallService) NewCreatePortForwardingRuleParams(ipaddressid string, privateendport int, privateport int, protocol string, publicendport int, publicport int, virtualmachineid string) *CreatePortForwardingRuleParams {

generate/requiredParams.go:73

  • [nitpick] Indentation of the new createPortForwardingRule entry appears inconsistent with surrounding map entries; aligning tabs/spaces would improve readability.
        "createPortForwardingRule": {

@sureshanaparti sureshanaparti marked this pull request as draft June 20, 2025 06:53
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.

Issue in CloudStack Port Forwarding API Implementation
1 participant