From f296d277004fa0a99fa0c9dfa49696bec9763f2d Mon Sep 17 00:00:00 2001 From: Priyam Selugar <108355091+pselugar@users.noreply.github.com> Date: Mon, 17 Oct 2022 02:26:03 -0400 Subject: [PATCH] =?UTF-8?q?Added=20-EdgeZone=20and=20-ResourceType=20param?= =?UTF-8?q?eter=20to=20New-AzSnapshotUpdateCo=E2=80=A6=20(#19284)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added -EdgeZone and -ResourceType parameter to New-AzSnapshotUpdateConfig and Get-AzComputeResourceSku * Removed Space * Refactored code in ResourceSkuMethod and updated Help docs * Updated Changelog.md file * Removed unused ResourceType parameter --- src/Compute/Compute/ChangeLog.md | 3 +++ .../ResourceSku/ResourceSkuListMethod.cs | 10 ++++++-- .../NewAzureRmSnapshotUpdateConfigCommand.cs | 14 +++++++++++ .../Compute/help/Get-AzComputeResourceSku.md | 18 ++++++++++++++- .../help/New-AzSnapshotUpdateConfig.md | 23 +++++++++++++++---- 5 files changed, 61 insertions(+), 7 deletions(-) diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index 07a4a47726b6..646a869a350b 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -20,6 +20,9 @@ --> ## Upcoming Release +* Added `-EdgeZone` optional parameter for `Get-AzComputeResourceSku` and `New-AzSnapshotUpdateConfig` cmdlets. +* Added Disk Delete Optional parameters `OsDisk Deletion Option` and `Delete Option` to the `Set-AzVmssStorageProfile` (OS Disk) and `Add-AzVmssDataDisk` (Data Disk) +* Improved printed output for `Get-AzComputeResourceSku` * Updated `Get-AzHost` cmdlet logic to return Host for `-ResourceId` parameterset. * For `New-AzGalleryImageVersion`, update property mapping for `Encryption`. diff --git a/src/Compute/Compute/Generated/ResourceSku/ResourceSkuListMethod.cs b/src/Compute/Compute/Generated/ResourceSku/ResourceSkuListMethod.cs index 14b44c6af412..aafb8aafbd21 100644 --- a/src/Compute/Compute/Generated/ResourceSku/ResourceSkuListMethod.cs +++ b/src/Compute/Compute/Generated/ResourceSku/ResourceSkuListMethod.cs @@ -44,6 +44,12 @@ public partial class GetAzureRmComputeResourceSku : ComputeAutomationBaseCmdlet [LocationCompleter("Microsoft.Compute/locations/publishers")] public string Location { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region.")] + public string EdgeZone { get; set; } + public override void ExecuteCmdlet() { base.ExecuteCmdlet(); @@ -53,11 +59,11 @@ public override void ExecuteCmdlet() if (this.IsParameterBound(c => c.Location)) { string filter = String.Format("location eq '{0}'", this.Location); - result = ResourceSkusClient.List(filter); + result = ResourceSkusClient.List(filter, this.EdgeZone); } else { - result = ResourceSkusClient.List(); + result = ResourceSkusClient.List(includeExtendedLocations: this.EdgeZone); } var resultList = result.ToList(); var nextPageLink = result.NextPageLink; diff --git a/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs b/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs index 7f47bb3c1f41..d250463df4e1 100644 --- a/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs +++ b/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs @@ -78,6 +78,12 @@ public partial class NewAzureRmSnapshotUpdateConfigCommand : Microsoft.Azure.Com ValueFromPipelineByPropertyName = true)] public KeyVaultAndSecretReference DiskEncryptionKey { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region.")] + public string EdgeZone { get; set; } + [Parameter( Mandatory = false, ValueFromPipelineByPropertyName = true)] @@ -131,6 +137,9 @@ private void Run() // Encryption Encryption vEncryption = null; + // ExtendedLocation + ExtendedLocation vExtendedLocation = null; + // Sku SnapshotSku vSku = null; @@ -145,6 +154,11 @@ private void Run() vEncryptionSettingsCollection.Enabled = (bool) this.EncryptionSettingsEnabled; } + if (this.IsParameterBound(c => c.EdgeZone)) + { + vExtendedLocation = new ExtendedLocation { Name = this.EdgeZone, Type = ExtendedLocationTypes.EdgeZone }; + } + if (this.IsParameterBound(c => c.DiskEncryptionKey)) { if (vEncryptionSettingsCollection == null) diff --git a/src/Compute/Compute/help/Get-AzComputeResourceSku.md b/src/Compute/Compute/help/Get-AzComputeResourceSku.md index faaf2f8bc414..8d9325630ced 100644 --- a/src/Compute/Compute/help/Get-AzComputeResourceSku.md +++ b/src/Compute/Compute/help/Get-AzComputeResourceSku.md @@ -13,7 +13,8 @@ List all compute resource Skus ## SYNTAX ``` -Get-AzComputeResourceSku [[-Location] ] [-DefaultProfile ] [] +Get-AzComputeResourceSku [[-Location] ] [-EdgeZone ] [-DefaultProfile ] + [] ``` ## DESCRIPTION @@ -45,6 +46,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -EdgeZone +Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -Location Specifies a location of the available skus to list. diff --git a/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md b/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md index ba08d87b62ca..fae46f3e3101 100644 --- a/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md +++ b/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md @@ -15,10 +15,10 @@ Creates a configurable snapshot update object. ``` New-AzSnapshotUpdateConfig [[-SkuName] ] [[-OsType] ] [[-DiskSizeGB] ] [[-Tag] ] [-SupportsHibernation ] [-EncryptionSettingsEnabled ] - [-DiskEncryptionKey ] [-KeyEncryptionKey ] - [-DiskEncryptionSetId ] [-EncryptionType ] [-PublicNetworkAccess ] - [-DataAccessAuthMode ] [-Architecture ] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] + [-DiskEncryptionKey ] [-EdgeZone ] + [-KeyEncryptionKey ] [-DiskEncryptionSetId ] [-EncryptionType ] + [-PublicNetworkAccess ] [-DataAccessAuthMode ] [-Architecture ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -144,6 +144,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -EdgeZone +Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -EncryptionSettingsEnabled Enable encryption settings.