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

Added VIPGRP functions matching *-AddressGroup* #89

Merged
merged 24 commits into from
Oct 6, 2020

Conversation

poundy
Copy link
Contributor

@poundy poundy commented Mar 5, 2020

No description provided.

@poundy poundy mentioned this pull request Mar 5, 2020
@alagoutte
Copy link
Contributor

Thanks !, it will make a quick review,

do you have try all cmdlet ?

@poundy poundy requested a review from alagoutte March 6, 2020 00:10
@poundy
Copy link
Contributor Author

poundy commented Mar 6, 2020

Thanks !, it will make a quick review,

do you have try all cmdlet ?

Yes, I've tested the full cmdlet suite. Not extensively, but I've done tests on everything on my FW setup.

I've made amendments based on changes requested, but I am not familiar with whether these changes have now been re-submitted into this for approval again or if my "request review" has just been done on the older commit? I saw it re-do the automated checks so I assume at some level those updates have made it here. (sorry for being such a newbie on github and contributions)

@alagoutte
Copy link
Contributor

Thanks Brett ! it will make some test (i think no before next week)
but look (very) good !

You can also update README.(md) for add example ;-)

There is no yet unit test (but it is on my roadmap for next release...)

@poundy poundy requested a review from alagoutte March 7, 2020 21:22
@alagoutte
Copy link
Contributor

Thanks, i will try this week !

@alagoutte alagoutte added this to the 0.5.0 milestone Mar 10, 2020
@alagoutte alagoutte mentioned this pull request Mar 14, 2020
[string]$name,
[Parameter (Mandatory = $true)]
[string[]]$member,
[Parameter (Mandatory = $true)]
Copy link
Contributor

Choose a reason for hiding this comment

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

interface is really needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can you check the API docs to confirm it's shown as mandatory there? I am pretty sure that you can't define it without a bound interface via GUI/CLI... just checked and confirmed that Interface is required:
config firewall vipgrp
edit "Brett_Test"
(Brett_Test) # next
Attribute 'interface' MUST be set.
Command fail. Return code 1

Copy link
Contributor

Choose a reason for hiding this comment

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

it is no specified on API :-/
after, we can use the same idea like for VIP cmdlet (and also GUI), set any by default https://github.com/FortiPower/PowerFGT/blob/master/PowerFGT/Public/cmdb/firewall/vip.ps1#L49

}
$vipgrp | add-member -name "member" -membertype NoteProperty -Value $members

if ( $PsBoundParameters.ContainsKey('interface') ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if interface is really needed, you need to remove this if

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, but functionally it works, because there always will be an interface, this tests true always.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(so a more correct statement would be "if interface is really needed, you should remove this redundant if")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

amendment complete

@alagoutte alagoutte force-pushed the master branch 2 times, most recently from d04ddc0 to aa5e8ec Compare August 25, 2020 07:05
@alagoutte
Copy link
Contributor

Hi @poundy can you look if it is ok for you ? (i have some test and fix some issue found with when write test...)

@CedricMoreau, can look review too ?

@poundy
Copy link
Contributor Author

poundy commented Sep 14, 2020

Just commenting in here because I am kind of stuck at the moment, not really understanding the push-pull status here on what I can use to test.
I am happy to re-load a cut of the code just can't be sure where I should be grabbing it from? If you could help guide me there, I will get it into my env and test against a 6.2.x device.

@alagoutte
Copy link
Contributor

Hi @poundy, i prepare to merge soon this patch (and why i have fix a typo and rebase change!)

@poundy
Copy link
Contributor Author

poundy commented Sep 14, 2020

Hi @poundy, i prepare to merge soon this patch (and why i have fix a typo and rebase change!)

I am happy to load again and add to my (production) tests if that helps; I have been using it in the original form I originally committed although vipgrps aren't something I create a lot of!

README.md Outdated
@@ -21,6 +21,7 @@ With this module (version 0.4.1) you can manage:
- System Global (Get)
- [VDOM](#VDOM) (Get)
- [Virtual IP](#Virtual-IP) (Get/Add/Remove object type static-nat)
- VirtualIPGroup (Add/Get/Copy/Set/Remove and Add/Remove Member)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the same format as the one above

Added example for backing up the configuration
Initial commit; untested
Added Confirm-FGTVipGroup for VipGroup operations
AddFGTFirewallVipGroup requires interface in creation
revert unnecessary change
Feedback from PR
@alagoutte alagoutte merged commit 701eb88 into FortiPower:master Oct 6, 2020
@alagoutte
Copy link
Contributor

Thanks @poundy and sorry for delay ;-)

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