Skip to content

Commit f296d27

Browse files
authored
Added -EdgeZone and -ResourceType parameter to New-AzSnapshotUpdateCo… (#19284)
* 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
1 parent 95f926a commit f296d27

File tree

5 files changed

+61
-7
lines changed

5 files changed

+61
-7
lines changed

src/Compute/Compute/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
2121
-->
2222
## Upcoming Release
23+
* Added `-EdgeZone` optional parameter for `Get-AzComputeResourceSku` and `New-AzSnapshotUpdateConfig` cmdlets.
24+
* Added Disk Delete Optional parameters `OsDisk Deletion Option` and `Delete Option` to the `Set-AzVmssStorageProfile` (OS Disk) and `Add-AzVmssDataDisk` (Data Disk)
25+
* Improved printed output for `Get-AzComputeResourceSku`
2326
* Updated `Get-AzHost` cmdlet logic to return Host for `-ResourceId` parameterset.
2427
* For `New-AzGalleryImageVersion`, update property mapping for `Encryption`.
2528

src/Compute/Compute/Generated/ResourceSku/ResourceSkuListMethod.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ public partial class GetAzureRmComputeResourceSku : ComputeAutomationBaseCmdlet
4444
[LocationCompleter("Microsoft.Compute/locations/publishers")]
4545
public string Location { get; set; }
4646

47+
[Parameter(
48+
Mandatory = false,
49+
ValueFromPipelineByPropertyName = true,
50+
HelpMessage = "Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region.")]
51+
public string EdgeZone { get; set; }
52+
4753
public override void ExecuteCmdlet()
4854
{
4955
base.ExecuteCmdlet();
@@ -53,11 +59,11 @@ public override void ExecuteCmdlet()
5359
if (this.IsParameterBound(c => c.Location))
5460
{
5561
string filter = String.Format("location eq '{0}'", this.Location);
56-
result = ResourceSkusClient.List(filter);
62+
result = ResourceSkusClient.List(filter, this.EdgeZone);
5763
}
5864
else
5965
{
60-
result = ResourceSkusClient.List();
66+
result = ResourceSkusClient.List(includeExtendedLocations: this.EdgeZone);
6167
}
6268
var resultList = result.ToList();
6369
var nextPageLink = result.NextPageLink;

src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ public partial class NewAzureRmSnapshotUpdateConfigCommand : Microsoft.Azure.Com
7878
ValueFromPipelineByPropertyName = true)]
7979
public KeyVaultAndSecretReference DiskEncryptionKey { get; set; }
8080

81+
[Parameter(
82+
Mandatory = false,
83+
ValueFromPipelineByPropertyName = true,
84+
HelpMessage = "Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region.")]
85+
public string EdgeZone { get; set; }
86+
8187
[Parameter(
8288
Mandatory = false,
8389
ValueFromPipelineByPropertyName = true)]
@@ -131,6 +137,9 @@ private void Run()
131137
// Encryption
132138
Encryption vEncryption = null;
133139

140+
// ExtendedLocation
141+
ExtendedLocation vExtendedLocation = null;
142+
134143
// Sku
135144
SnapshotSku vSku = null;
136145

@@ -145,6 +154,11 @@ private void Run()
145154
vEncryptionSettingsCollection.Enabled = (bool) this.EncryptionSettingsEnabled;
146155
}
147156

157+
if (this.IsParameterBound(c => c.EdgeZone))
158+
{
159+
vExtendedLocation = new ExtendedLocation { Name = this.EdgeZone, Type = ExtendedLocationTypes.EdgeZone };
160+
}
161+
148162
if (this.IsParameterBound(c => c.DiskEncryptionKey))
149163
{
150164
if (vEncryptionSettingsCollection == null)

src/Compute/Compute/help/Get-AzComputeResourceSku.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ List all compute resource Skus
1313
## SYNTAX
1414

1515
```
16-
Get-AzComputeResourceSku [[-Location] <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
16+
Get-AzComputeResourceSku [[-Location] <String>] [-EdgeZone <String>] [-DefaultProfile <IAzureContextContainer>]
17+
[<CommonParameters>]
1718
```
1819

1920
## DESCRIPTION
@@ -45,6 +46,21 @@ Accept pipeline input: False
4546
Accept wildcard characters: False
4647
```
4748
49+
### -EdgeZone
50+
Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region.
51+
52+
```yaml
53+
Type: System.String
54+
Parameter Sets: (All)
55+
Aliases:
56+
57+
Required: False
58+
Position: Named
59+
Default value: None
60+
Accept pipeline input: True (ByPropertyName)
61+
Accept wildcard characters: False
62+
```
63+
4864
### -Location
4965
Specifies a location of the available skus to list.
5066

src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Creates a configurable snapshot update object.
1515
```
1616
New-AzSnapshotUpdateConfig [[-SkuName] <String>] [[-OsType] <OperatingSystemTypes>] [[-DiskSizeGB] <Int32>]
1717
[[-Tag] <Hashtable>] [-SupportsHibernation <Boolean>] [-EncryptionSettingsEnabled <Boolean>]
18-
[-DiskEncryptionKey <KeyVaultAndSecretReference>] [-KeyEncryptionKey <KeyVaultAndKeyReference>]
19-
[-DiskEncryptionSetId <String>] [-EncryptionType <String>] [-PublicNetworkAccess <String>]
20-
[-DataAccessAuthMode <String>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
21-
[-Confirm] [<CommonParameters>]
18+
[-DiskEncryptionKey <KeyVaultAndSecretReference>] [-EdgeZone <String>]
19+
[-KeyEncryptionKey <KeyVaultAndKeyReference>] [-DiskEncryptionSetId <String>] [-EncryptionType <String>]
20+
[-PublicNetworkAccess <String>] [-DataAccessAuthMode <String>] [-Architecture <String>]
21+
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2222
```
2323

2424
## DESCRIPTION
@@ -144,6 +144,21 @@ Accept pipeline input: True (ByPropertyName)
144144
Accept wildcard characters: False
145145
```
146146
147+
### -EdgeZone
148+
Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region.
149+
150+
```yaml
151+
Type: System.String
152+
Parameter Sets: (All)
153+
Aliases:
154+
155+
Required: False
156+
Position: Named
157+
Default value: None
158+
Accept pipeline input: True (ByPropertyName)
159+
Accept wildcard characters: False
160+
```
161+
147162
### -EncryptionSettingsEnabled
148163
Enable encryption settings.
149164

0 commit comments

Comments
 (0)