Skip to content

Add ResourceName completer to compute #7471

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

Merged
merged 10 commits into from
Oct 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class GetAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The availability set name.")]
[ResourceNameCompleter("Microsoft.Compute/availabilitySets", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class RemoveAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The availability set name.")]
[ResourceNameCompleter("Microsoft.Compute/availabilitySets", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
1 change: 1 addition & 0 deletions src/ResourceManager/Compute/Commands.Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
-->
## Current Release
* Added new sizes to the whitelist of VM sizes for which Accel Net will be turned on when using the simple param set for `New-AzureRmVm`
* Added ResourceName argument completer to all cmdlets.

## Version 5.7.0
* Fix Get-AzureRmVM -ResourceGroupName <rg> to return more than 50 results if needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class GetAzureVMADDomainExtensionCommand : VirtualMachineExtensionBaseCmd
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -50,6 +51,7 @@ public class GetAzureVMADDomainExtensionCommand : VirtualMachineExtensionBaseCmd
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The extension name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class GetAzureRmVMAEMExtension : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -51,6 +52,7 @@ public class GetAzureRmVMAEMExtension : VirtualMachineExtensionBaseCmdlet
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Extension Name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
public string Name { get; set; }

[Parameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class RemoveAzureRmVMAEMExtension : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -59,6 +60,7 @@ public class RemoveAzureRmVMAEMExtension : VirtualMachineExtensionBaseCmdlet
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Name of the ARM resource that represents the extension.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class SetAzureRmVMAEMExtension : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class TestAzureRmVMAEMExtension : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class DisableAzureDiskEncryptionCommand : VirtualMachineExtensionBaseCmdl
Position = 0,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The resource group name to which the VM belongs to")]
[ResourceGroupCompleter()]
[ResourceGroupCompleter]
[ValidateNotNullOrEmpty]
public string ResourceGroupName { get; set; }

Expand All @@ -45,6 +45,7 @@ public class DisableAzureDiskEncryptionCommand : VirtualMachineExtensionBaseCmdl
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Name of the virtual machine")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -65,6 +66,7 @@ public class DisableAzureDiskEncryptionCommand : VirtualMachineExtensionBaseCmdl
Position = 3,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The extension name. If this parameter is not specified, default values used are AzureDiskEncryption for windows VMs and AzureDiskEncryptionForLinux for Linux VMs")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class GetAzureDiskEncryptionStatusCommand : VirtualMachineExtensionBaseCm
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -54,6 +55,7 @@ public class GetAzureDiskEncryptionStatusCommand : VirtualMachineExtensionBaseCm
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The extension name. If this parameter is not specified, default values used are AzureDiskEncryption for Windows VMs and AzureDiskEncryptionForLinux for Linux VMs")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class RemoveAzureDiskEncryptionExtensionCommand : VirtualMachineExtension
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -50,6 +51,7 @@ public class RemoveAzureDiskEncryptionExtensionCommand : VirtualMachineExtension
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The extension name. If this parameter is not specified, default values used are AzureDiskEncryption for windows VMs and AzureDiskEncryptionForLinux for Linux VMs")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class SetAzureDiskEncryptionExtensionCommand : VirtualMachineExtensionBas
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Name of the virtual machine")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class RemoveAzureVMBackup : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class SetAzureVMBackupExtension : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -49,6 +50,7 @@ public class SetAzureVMBackupExtension : VirtualMachineExtensionBaseCmdlet
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The extension name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class GetAzureRmVMChefExtension : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -58,6 +59,7 @@ public class GetAzureRmVMChefExtension : VirtualMachineExtensionBaseCmdlet
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Extension Name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
public string Name { get; set; }

[Parameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class RemoveAzureRmVMChefExtension : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -60,6 +61,7 @@ public class RemoveAzureRmVMChefExtension : VirtualMachineExtensionBaseCmdlet
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Extension Name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
public string Name
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand Down Expand Up @@ -212,6 +213,7 @@ public string Location
Position = 8,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The extension name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
public string Name
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class GetAzureVMCustomScriptExtensionCommand : VirtualMachineExtensionBas
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -50,6 +51,7 @@ public class GetAzureVMCustomScriptExtensionCommand : VirtualMachineExtensionBas
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The extension name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class RemoveAzureVMCustomScriptExtensionCommand : VirtualMachineExtension
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -48,6 +49,7 @@ public class RemoveAzureVMCustomScriptExtensionCommand : VirtualMachineExtension
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The extension name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class GetAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -40,6 +41,7 @@ public class GetAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdlet
HelpMessage = "Name of the ARM resource that represents the extension. The Set-AzureRmVMDscExtension cmdlet sets this name to " +
"'Microsoft.Powershell.DSC', which is the same value used by Get-AzureRmVMDscExtension. Specify this parameter only if you changed " +
"the default name in the Set cmdlet or used a different resource name in an ARM template.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class GetAzureVMDscExtensionStatusCommand : VirtualMachineExtensionBaseCm
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -46,6 +47,7 @@ public class GetAzureVMDscExtensionStatusCommand : VirtualMachineExtensionBaseCm
HelpMessage = "Name of the ARM resource that represents the extension. The Set-AzureVMDscExtension cmdlet sets this name to " +
"'Microsoft.Powershell.DSC', which is the same value used by Get-AzureVMDscExtension. Specify this parameter only if you changed " +
"the default name in the Set cmdlet or used a different resource name in an ARM template.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class RemoveAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdle
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The name of the virtual machine.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -42,6 +43,7 @@ public class RemoveAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdle
HelpMessage = "Name of the ARM resource that represents the extension. The Set-AzureRmVMDscExtension cmdlet sets this name to " +
"'Microsoft.Powershell.DSC', which is the same value used by Get-AzureRmVMDscExtension. Specify this parameter only if you changed " +
"the default name in the Set cmdlet or used a different resource name in an ARM template.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class SetAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdlet
Position = 3,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Name of the virtual machine where dsc extension handler would be installed.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class GetAzureRmVMDiagnosticsExtensionCommand : VirtualMachineExtensionBa
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -51,6 +52,7 @@ public class GetAzureRmVMDiagnosticsExtensionCommand : VirtualMachineExtensionBa
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Extension Name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
public string Name { get; set; }

[Parameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class RemoveAzureRmVMDiagnosticsExtensionCommand : VirtualMachineExtensio
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -53,6 +54,7 @@ public class RemoveAzureRmVMDiagnosticsExtensionCommand : VirtualMachineExtensio
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Extension Name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
public string Name { get; set; }

public override void ExecuteCmdlet()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class SetAzureRmVMDiagnosticsExtensionCommand : VirtualMachineExtensionBa
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand Down Expand Up @@ -127,6 +128,7 @@ public string Location
Position = 8,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The extension name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
public string Name
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class GetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The virtual machine name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")]
[ValidateNotNullOrEmpty]
public string VMName { get; set; }

Expand All @@ -47,6 +48,7 @@ public class GetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
Position = 2,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The extension name.")]
[ResourceNameCompleter("Microsoft.Compute/virtualMachines/extensions", "ResourceGroupName", "VMName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Loading