-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[Microsoft.Network] DDoS protection plans #5968
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
Conversation
cormacpayne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr a few comments for you to take a look at. If you have any questions about the piping scenarios I touched on, please refer to this document.
|
|
||
| if(!string.IsNullOrEmpty(this.Name)) | ||
| { | ||
| var vDdosProtectionPlan = this.NetworkClient.NetworkManagementClient.DdosProtectionPlans.Get(ResourceGroupName, Name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr does this Get method handle when ResourceGroupName is null? If not, we should have two parameter sets to prevent the user from providing Name without ResourceGroupName:
- One set with an optional
ResourceGroupNameparameter - One set with mandatory
ResourceGroupNameandNameparameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it and it validates it:
PS D:\azure-powershell> Get-AzureRmDdosProtectionPlan -Name DdosProtectionPlanName
Get-AzureRmDdosProtectionPlan : 'resourceGroupName' cannot be null.
At line:1 char:1
+ Get-AzureRmDdosProtectionPlan -Name DdosProtectionPlanName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureRmDdosProtectionPlan], ValidationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.Automation.GetAzureRmDdosProtectionPlan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr the idea is that we don't have a scenario that leads users to get this error ResourceGroupName and Name or an optional ResourceGroupName, then there is no situation where they'd get this error because they'd never be able to provide just the Name parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed :) Added parameter sets
| namespace Microsoft.Azure.Commands.Network.Automation | ||
| { | ||
| [Cmdlet(VerbsCommon.Get, "AzureRmDdosProtectionPlan"), OutputType(typeof(PSDdosProtectionPlan))] | ||
| public partial class GetAzureRmDdosProtectionPlan : NetworkBaseCmdlet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr is this a tracked resource? If so, we should add an additional parameter set that allows the user to pass just ResourceId, and you can use common code to strip out the ResourceGroupName and Name. This allows users to call Get-AzureRmResource and pipe the result to this cmdlet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by tracked resource?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr is this a resource that has a ResourceId that the user can retrieve from a generic REST call? (i.e., using Get-AzureRmResource -- check out this doc)
| [Parameter( | ||
| Mandatory = false, | ||
| HelpMessage = "Do not ask for confirmation if you want to overwrite a resource")] | ||
| public SwitchParameter Force { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr is this Force parameter necessary? The Force parameter should only be needed when you prompt the user for additional confirmation during cmdlet execution. If you are not doing this, then you shouldn't need the Force parameter
|
|
||
| namespace Microsoft.Azure.Commands.Network | ||
| { | ||
| [Cmdlet(VerbsCommon.Remove, "AzureRmDdosProtectionPlan", SupportsShouldProcess = true)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr please ensure that this cmdlet has an output type (in this case bool)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has when I use PassThru parameter.
| [Parameter( | ||
| Mandatory = false, | ||
| HelpMessage = "Do not ask for confirmation if you want to delete resource.")] | ||
| public SwitchParameter Force { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr same comment about if we need the Force parameter
| Gets an application security group. | ||
|
|
||
| ### [Get-AzureRmBgpServiceCommunity](Get-AzureRmBgpServiceCommunity.md) | ||
| {{Manually Enter Get-AzureRmBgpServiceCommunity Description Here}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr would you mind adding a description for this cmdlet since it was removed? (you can just use the description of the cmdlet if it has one)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| --- | ||
| external help file: Microsoft.Azure.Commands.Network.dll-Help.xml | ||
| Module Name: AzureRM.Network | ||
| online version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr please refer to the ValidateHelpIssues.csv file that is a part of your Jenkins build for information about how to resolve the build errors around your help files
|
|
||
| ### Example 1: Get a specific DDoS protection plan | ||
| ``` | ||
| Get-AzureRmDdosProtectionPlan -ResourceGroupName ResourceGroupName -Name DdosProtectionPlanName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr for each of the examples you are providing, please add the corresponding output that the user would see
| --- | ||
| external help file: Microsoft.Azure.Commands.Network.dll-Help.xml | ||
| Module Name: AzureRM.Network | ||
| online version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr same comments in this file about build failures and output for the examples
| --- | ||
| external help file: Microsoft.Azure.Commands.Network.dll-Help.xml | ||
| Module Name: AzureRM.Network | ||
| online version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murilogr same comment in this file about build failures and example output
|
Merged this PR into PR:- #5993 |
|
closing in favor of #5993 |
Description
https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/29
Checklist
CONTRIBUTING.mdplatyPSmodule