-
Notifications
You must be signed in to change notification settings - Fork 4k
Add LocationCompleter to Compute cmdlets #4749
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 LocationCompleter to Compute cmdlets #4749
Conversation
@@ -35,7 +36,7 @@ public class GetAzureVMSizeCommand : VirtualMachineSizeBaseCmdlet | |||
Position = 0, | |||
ParameterSetName = ListVirtualMachineSizeParamSet, | |||
ValueFromPipelineByPropertyName = true, | |||
HelpMessage = "The location name.")] | |||
HelpMessage = "The location name."), LocationCompleter(new string[] { "Microsoft.Compute/locations/vmSizes" })] |
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.
Move LocationCompleter() to [ValidateNotNullOrEmpty] like NewAzureVMCommand.cs
@@ -30,7 +31,7 @@ public class GetAzureVMUsageCommand : VirtualMachineUsageBaseCmdlet | |||
Mandatory = true, | |||
Position = 0, | |||
ValueFromPipelineByPropertyName = true, | |||
HelpMessage = "The location name.")] | |||
HelpMessage = "The location name."), LocationCompleter(new string[] { "Microsoft.Compute/locations/usages" })] |
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.
Move LocationCompleter() to [ValidateNotNullOrEmpty] like NewAzureVMCommand.cs
@@ -46,7 +47,7 @@ public class NewAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet | |||
Mandatory = true, | |||
Position = 2, | |||
ValueFromPipelineByPropertyName = true, | |||
HelpMessage = "The location.")] | |||
HelpMessage = "The location."), LocationCompleter(new string[] { "Microsoft.Compute/availabilitySets" })] |
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.
Move LocationCompleter() to [ValidateNotNullOrEmpty] like NewAzureVMCommand.cs
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 moved all of the LocationCompleter attributes out to a new set of brackets for uniformity - let me know if this looks good to you.
@@ -170,7 +171,7 @@ public class SetAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdlet | |||
[Parameter( | |||
Mandatory = false, | |||
ValueFromPipelineByPropertyName = true, | |||
HelpMessage = "Location of the resource.")] | |||
HelpMessage = "Location of the resource."), LocationCompleter(new string[] { "Microsoft.Storage/storageAccounts" })] |
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.
Move LocationCompleter() to [ValidateNotNullOrEmpty] like NewAzureVMCommand.cs
@@ -104,7 +105,7 @@ public string DiagnosticsConfigurationPath | |||
Mandatory = false, | |||
Position = 7, | |||
ValueFromPipelineByPropertyName = true, | |||
HelpMessage = "The location.")] | |||
HelpMessage = "The location."), LocationCompleter(new string[] { "Microsoft.Storage/storageAccounts" })] |
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.
Move LocationCompleter() to [ValidateNotNullOrEmpty] like NewAzureVMCommand.cs
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.
No [ValidateNotNullOrEmpty] attribute here, so I moved the LocationCompleter out on its own.
@@ -54,7 +55,7 @@ public class SetAzureVMExtensionBaseCmdlet : VirtualMachineExtensionBaseCmdlet | |||
[Parameter( | |||
Mandatory = false, | |||
ValueFromPipelineByPropertyName = true, | |||
HelpMessage = "The location.")] | |||
HelpMessage = "The location."), LocationCompleter(new string[] { "Microsoft.Compute/virtualMachines" })] |
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.
Move LocationCompleter() to [ValidateNotNullOrEmpty] like NewAzureVMCommand.cs
@@ -93,7 +94,7 @@ public class SetAzureSqlServerExtensionCommand : VirtualMachineExtensionBaseCmdl | |||
Mandatory = false, | |||
Position = 8, | |||
ValueFromPipelineByPropertyName = true, | |||
HelpMessage = "Location of the resource.")] | |||
HelpMessage = "Location of the resource."), LocationCompleter(new string[] { "Microsoft.Compute/virtualMachines" })] |
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.
Move LocationCompleter() to [ValidateNotNullOrEmpty] like NewAzureVMCommand.cs
@@ -37,7 +38,7 @@ public class GetAzureVMImageCommand : VirtualMachineImageBaseCmdlet | |||
ValueFromPipelineByPropertyName = true)] | |||
[Parameter(ParameterSetName = GetVMImageDetailParamSetName, | |||
Mandatory = true, | |||
ValueFromPipelineByPropertyName = true)] | |||
ValueFromPipelineByPropertyName = true), LocationCompleter(new string[] { "Microsoft.Compute/locations/publishers" })] |
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.
Move LocationCompleter() to [ValidateNotNullOrEmpty] like NewAzureVMCommand.cs
Thanks, LGTM. |
…nto LocationCompleterNetwork
Optimistic on demand run here: https://azuresdkci.westus2.cloudapp.azure.com/view/PowerShell/job/powershell-demand/32/ |
Description
Add the Location completer to the -Location parameter for all Compute cmdlets with the correct providers.
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThru
parameter.Cmdlet Parameter Guidelines