Skip to content

Commit 03b43ef

Browse files
authored
Merge pull request #8783 from hyonholee/march
[Compute] Update Compute library version to 25.0.0
2 parents da6585c + 85eb147 commit 03b43ef

File tree

41 files changed

+5622
-1136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5622
-1136
lines changed

src/Compute/Compute.Test/Compute.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
15-
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="24.1.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="25.0.0" />
1616
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="2.4.2" />
1717
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.9.0-preview" />
1818
</ItemGroup>

src/Compute/Compute.Test/ScenarioTests/DiskRPTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,19 @@ public void TestSnapshot()
3737
{
3838
TestRunner.RunTestScript("Test-Snapshot");
3939
}
40+
41+
[Fact]
42+
[Trait(Category.AcceptanceType, Category.CheckIn)]
43+
public void TestDiskEncrypt()
44+
{
45+
TestRunner.RunTestScript("Test-DiskEncrypt");
46+
}
47+
48+
[Fact]
49+
[Trait(Category.AcceptanceType, Category.CheckIn)]
50+
public void TestSnapshotEncrypt()
51+
{
52+
TestRunner.RunTestScript("Test-SnapshotEncrypt");
53+
}
4054
}
4155
}

src/Compute/Compute.Test/ScenarioTests/DiskRPTests.ps1

Lines changed: 439 additions & 30 deletions
Large diffs are not rendered by default.

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DiskRPTests/TestDisk.json

Lines changed: 501 additions & 435 deletions
Large diffs are not rendered by default.

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DiskRPTests/TestDiskEncrypt.json

Lines changed: 1721 additions & 0 deletions
Large diffs are not rendered by default.

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DiskRPTests/TestSnapshot.json

Lines changed: 491 additions & 398 deletions
Large diffs are not rendered by default.

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DiskRPTests/TestSnapshotEncrypt.json

Lines changed: 1721 additions & 0 deletions
Large diffs are not rendered by default.

src/Compute/Compute/AvailabilitySets/UpdateAzureAvailabilitySetCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using AutoMapper;
1615
using Microsoft.Azure.Commands.Compute.Common;
1716
using Microsoft.Azure.Commands.Compute.Models;
1817
using Microsoft.Azure.Management.Compute.Models;
18+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1919
using System.Collections;
2020
using System.Linq;
2121
using System.Management.Automation;
@@ -46,6 +46,7 @@ public class UpdateAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
4646
HelpMessage = "The Name of Sku")]
4747
public string Sku { get; set; }
4848

49+
[CmdletParameterBreakingChange("Managed", "Parameter is being deprecated. Please use -Sku 'Aligned' instead.")]
4950
[Parameter(
5051
Mandatory = true,
5152
ParameterSetName = ManagedParamterSetName,

src/Compute/Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
-->
2121
## Upcoming Release
2222
* Fix issue with path resolution in Get-AzVmBootDiagnosticsData
23+
* Update Compute client library to 25.0.0.
2324

2425
## Version 1.5.0
2526
* Add wildcard support to Get cmdlets

src/Compute/Compute/Compute.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="AutoMapper" Version="6.2.2" />
16-
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="24.1.0" />
16+
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="25.0.0" />
1717
<PackageReference Include="System.Security.Permissions" Version="4.5.0" />
1818
<PackageReference Include="System.ServiceModel.Primitives" Version="4.4.1" />
1919
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />

src/Compute/Compute/Generated/ContainerService/ContainerServiceGetMethod.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ public override void ExecuteCmdlet()
4343
string resourceGroupName = this.ResourceGroupName;
4444
string containerServiceName = this.Name;
4545

46-
if (ShouldGetByName(ResourceGroupName, Name))
46+
if (ShouldGetByName(resourceGroupName, containerServiceName))
4747
{
4848
var result = ContainerServicesClient.Get(resourceGroupName, containerServiceName);
4949
var psObject = new PSContainerService();
5050
ComputeAutomationAutoMapperProfile.Mapper.Map<ContainerService, PSContainerService>(result, psObject);
5151
WriteObject(psObject);
5252
}
53-
else if (ShouldListByResourceGroup(ResourceGroupName, Name))
53+
else if (ShouldListByResourceGroup(resourceGroupName, containerServiceName))
5454
{
5555
var result = ContainerServicesClient.ListByResourceGroup(resourceGroupName);
5656
var resultList = result.ToList();
@@ -69,7 +69,7 @@ public override void ExecuteCmdlet()
6969
{
7070
psObject.Add(ComputeAutomationAutoMapperProfile.Mapper.Map<ContainerService, PSContainerServiceList>(r));
7171
}
72-
WriteObject(TopLevelWildcardFilter(ResourceGroupName, Name, psObject), true);
72+
WriteObject(TopLevelWildcardFilter(resourceGroupName, containerServiceName, psObject), true);
7373
}
7474
else
7575
{
@@ -90,7 +90,7 @@ public override void ExecuteCmdlet()
9090
{
9191
psObject.Add(ComputeAutomationAutoMapperProfile.Mapper.Map<ContainerService, PSContainerServiceList>(r));
9292
}
93-
WriteObject(TopLevelWildcardFilter(ResourceGroupName, Name, psObject), true);
93+
WriteObject(TopLevelWildcardFilter(resourceGroupName, containerServiceName, psObject), true);
9494
}
9595
});
9696
}

src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using Microsoft.Azure.Commands.Compute.Automation.Models;
2323
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
2424
using Microsoft.Azure.Management.Compute.Models;
25+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2526
using System;
2627
using System.Collections;
2728
using System.Collections.Generic;
@@ -30,6 +31,9 @@
3031

3132
namespace Microsoft.Azure.Commands.Compute.Automation
3233
{
34+
[CmdletOutputBreakingChange(typeof(PSDisk),
35+
DeprecatedOutputProperties = new string[] { "EncryptionSettings" },
36+
NewOutputProperties = new string[] { "EncryptionSettingsCollection", "HyperVGeneration", "DiskState" })]
3337
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DiskConfig", SupportsShouldProcess = true)]
3438
[OutputType(typeof(PSDisk))]
3539
public partial class NewAzureRmDiskConfigCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
@@ -137,8 +141,8 @@ private void Run()
137141
// CreationData
138142
CreationData vCreationData = null;
139143

140-
// EncryptionSettings
141-
EncryptionSettings vEncryptionSettings = null;
144+
// EncryptionSettingsCollection
145+
EncryptionSettingsCollection vEncryptionSettingsCollection = null;
142146

143147
if (this.MyInvocation.BoundParameters.ContainsKey("SkuName"))
144148
{
@@ -196,29 +200,51 @@ private void Run()
196200

197201
if (this.MyInvocation.BoundParameters.ContainsKey("EncryptionSettingsEnabled"))
198202
{
199-
if (vEncryptionSettings == null)
203+
if (vEncryptionSettingsCollection == null)
200204
{
201-
vEncryptionSettings = new EncryptionSettings();
205+
vEncryptionSettingsCollection = new EncryptionSettingsCollection();
202206
}
203-
vEncryptionSettings.Enabled = this.EncryptionSettingsEnabled;
207+
vEncryptionSettingsCollection.Enabled = (bool) this.EncryptionSettingsEnabled;
204208
}
205209

206210
if (this.MyInvocation.BoundParameters.ContainsKey("DiskEncryptionKey"))
207211
{
208-
if (vEncryptionSettings == null)
212+
if (vEncryptionSettingsCollection == null)
209213
{
210-
vEncryptionSettings = new EncryptionSettings();
214+
vEncryptionSettingsCollection = new EncryptionSettingsCollection();
211215
}
212-
vEncryptionSettings.DiskEncryptionKey = this.DiskEncryptionKey;
216+
217+
if (vEncryptionSettingsCollection.EncryptionSettings == null)
218+
{
219+
vEncryptionSettingsCollection.EncryptionSettings = new List<EncryptionSettingsElement>();
220+
}
221+
222+
if (vEncryptionSettingsCollection.EncryptionSettings.Count == 0)
223+
{
224+
vEncryptionSettingsCollection.EncryptionSettings.Add(new EncryptionSettingsElement());
225+
}
226+
227+
vEncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey = this.DiskEncryptionKey;
213228
}
214229

215230
if (this.MyInvocation.BoundParameters.ContainsKey("KeyEncryptionKey"))
216231
{
217-
if (vEncryptionSettings == null)
232+
if (vEncryptionSettingsCollection == null)
218233
{
219-
vEncryptionSettings = new EncryptionSettings();
234+
vEncryptionSettingsCollection = new EncryptionSettingsCollection();
220235
}
221-
vEncryptionSettings.KeyEncryptionKey = this.KeyEncryptionKey;
236+
237+
if (vEncryptionSettingsCollection.EncryptionSettings == null)
238+
{
239+
vEncryptionSettingsCollection.EncryptionSettings = new List<EncryptionSettingsElement>();
240+
}
241+
242+
if (vEncryptionSettingsCollection.EncryptionSettings.Count == 0)
243+
{
244+
vEncryptionSettingsCollection.EncryptionSettings.Add(new EncryptionSettingsElement());
245+
}
246+
247+
vEncryptionSettingsCollection.EncryptionSettings[0].KeyEncryptionKey = this.KeyEncryptionKey;
222248
}
223249

224250
var vDisk = new PSDisk
@@ -232,7 +258,7 @@ private void Run()
232258
Tags = this.MyInvocation.BoundParameters.ContainsKey("Tag") ? this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value) : null,
233259
Sku = vSku,
234260
CreationData = vCreationData,
235-
EncryptionSettings = vEncryptionSettings,
261+
EncryptionSettingsCollection = vEncryptionSettingsCollection,
236262
};
237263

238264
WriteObject(vDisk);

src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using Microsoft.Azure.Commands.Compute.Automation.Models;
2323
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
2424
using Microsoft.Azure.Management.Compute.Models;
25+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2526
using System;
2627
using System.Collections;
2728
using System.Collections.Generic;
@@ -30,6 +31,9 @@
3031

3132
namespace Microsoft.Azure.Commands.Compute.Automation
3233
{
34+
[CmdletOutputBreakingChange(typeof(PSDiskUpdate),
35+
DeprecatedOutputProperties = new string[] { "EncryptionSettings" },
36+
NewOutputProperties = new string[] { "EncryptionSettingsCollection" })]
3337
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DiskUpdateConfig", SupportsShouldProcess = true)]
3438
[OutputType(typeof(PSDiskUpdate))]
3539
public partial class NewAzureRmDiskUpdateConfigCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
@@ -95,37 +99,64 @@ protected override void ProcessRecord()
9599

96100
private void Run()
97101
{
98-
// EncryptionSettings
99-
EncryptionSettings vEncryptionSettings = null;
102+
// EncryptionSettingsCollection
103+
EncryptionSettingsCollection vEncryptionSettingsCollection = null;
104+
105+
// EncryptionSettingsCollection
106+
EncryptionSettingsElement vEncryptionSettingsElement = null;
100107

101108
// Sku
102109
DiskSku vSku = null;
103110

104111
if (this.MyInvocation.BoundParameters.ContainsKey("EncryptionSettingsEnabled"))
105112
{
106-
if (vEncryptionSettings == null)
113+
if (vEncryptionSettingsCollection == null)
107114
{
108-
vEncryptionSettings = new EncryptionSettings();
115+
vEncryptionSettingsCollection = new EncryptionSettingsCollection();
109116
}
110-
vEncryptionSettings.Enabled = this.EncryptionSettingsEnabled;
117+
vEncryptionSettingsCollection.Enabled = (bool)this.EncryptionSettingsEnabled;
111118
}
112119

113120
if (this.MyInvocation.BoundParameters.ContainsKey("DiskEncryptionKey"))
114121
{
115-
if (vEncryptionSettings == null)
122+
if (vEncryptionSettingsCollection == null)
123+
{
124+
vEncryptionSettingsCollection = new EncryptionSettingsCollection();
125+
}
126+
127+
if (vEncryptionSettingsCollection.EncryptionSettings == null)
116128
{
117-
vEncryptionSettings = new EncryptionSettings();
129+
vEncryptionSettingsCollection.EncryptionSettings = new List<EncryptionSettingsElement>();
118130
}
119-
vEncryptionSettings.DiskEncryptionKey = this.DiskEncryptionKey;
131+
132+
if (vEncryptionSettingsElement == null)
133+
{
134+
vEncryptionSettingsElement = new EncryptionSettingsElement();
135+
vEncryptionSettingsCollection.EncryptionSettings.Add(vEncryptionSettingsElement);
136+
}
137+
138+
vEncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey = this.DiskEncryptionKey;
120139
}
121140

122141
if (this.MyInvocation.BoundParameters.ContainsKey("KeyEncryptionKey"))
123142
{
124-
if (vEncryptionSettings == null)
143+
if (vEncryptionSettingsCollection == null)
125144
{
126-
vEncryptionSettings = new EncryptionSettings();
145+
vEncryptionSettingsCollection = new EncryptionSettingsCollection();
127146
}
128-
vEncryptionSettings.KeyEncryptionKey = this.KeyEncryptionKey;
147+
148+
if (vEncryptionSettingsCollection.EncryptionSettings == null)
149+
{
150+
vEncryptionSettingsCollection.EncryptionSettings = new List<EncryptionSettingsElement>();
151+
}
152+
153+
if (vEncryptionSettingsElement == null)
154+
{
155+
vEncryptionSettingsElement = new EncryptionSettingsElement();
156+
vEncryptionSettingsCollection.EncryptionSettings.Add(vEncryptionSettingsElement);
157+
}
158+
159+
vEncryptionSettingsCollection.EncryptionSettings[0].KeyEncryptionKey = this.KeyEncryptionKey;
129160
}
130161

131162
if (this.MyInvocation.BoundParameters.ContainsKey("SkuName"))
@@ -144,7 +175,7 @@ private void Run()
144175
DiskIOPSReadWrite = this.MyInvocation.BoundParameters.ContainsKey("DiskIOPSReadWrite") ? this.DiskIOPSReadWrite : (int?)null,
145176
DiskMBpsReadWrite = this.MyInvocation.BoundParameters.ContainsKey("DiskMBpsReadWrite") ? this.DiskMBpsReadWrite : (int?)null,
146177
Tags = this.MyInvocation.BoundParameters.ContainsKey("Tag") ? this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value) : null,
147-
EncryptionSettings = vEncryptionSettings,
178+
EncryptionSettingsCollection = vEncryptionSettingsCollection,
148179
Sku = vSku,
149180
};
150181

src/Compute/Compute/Generated/Disk/Config/SetAzureRmDiskDiskEncryptionKeyCommand.cs

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
using Microsoft.Azure.Commands.Compute.Automation.Models;
2323
using Microsoft.Azure.Management.Compute.Models;
24+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2425
using System;
2526
using System.Collections;
2627
using System.Collections.Generic;
@@ -29,6 +30,9 @@
2930

3031
namespace Microsoft.Azure.Commands.Compute.Automation
3132
{
33+
[CmdletOutputBreakingChange(typeof(PSDisk),
34+
DeprecatedOutputProperties = new string[] { "EncryptionSettings" },
35+
NewOutputProperties = new string[] { "EncryptionSettingsCollection", "HyperVGeneration", "DiskState" })]
3236
[Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DiskDiskEncryptionKey", SupportsShouldProcess = true)]
3337
[OutputType(typeof(PSDisk))]
3438
public partial class SetAzureRmDiskDiskEncryptionKeyCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
@@ -62,39 +66,47 @@ protected override void ProcessRecord()
6266

6367
private void Run()
6468
{
69+
// EncryptionSettingsCollection
70+
if (this.Disk.EncryptionSettingsCollection == null)
71+
{
72+
this.Disk.EncryptionSettingsCollection = new EncryptionSettingsCollection();
73+
}
74+
75+
// EncryptionSettings
76+
if (this.Disk.EncryptionSettingsCollection.EncryptionSettings == null)
77+
{
78+
this.Disk.EncryptionSettingsCollection.EncryptionSettings = new List<EncryptionSettingsElement>();
79+
}
80+
81+
if (this.Disk.EncryptionSettingsCollection.EncryptionSettings.Count == 0)
82+
{
83+
var vEncryptionSettings = new EncryptionSettingsElement();
84+
this.Disk.EncryptionSettingsCollection.EncryptionSettings.Add(vEncryptionSettings);
85+
}
86+
6587
if (this.MyInvocation.BoundParameters.ContainsKey("SecretUrl"))
6688
{
67-
// EncryptionSettings
68-
if (this.Disk.EncryptionSettings == null)
69-
{
70-
this.Disk.EncryptionSettings = new EncryptionSettings();
71-
}
7289
// DiskEncryptionKey
73-
if (this.Disk.EncryptionSettings.DiskEncryptionKey == null)
90+
if (this.Disk.EncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey == null)
7491
{
75-
this.Disk.EncryptionSettings.DiskEncryptionKey = new KeyVaultAndSecretReference();
92+
this.Disk.EncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey = new KeyVaultAndSecretReference();
7693
}
77-
this.Disk.EncryptionSettings.DiskEncryptionKey.SecretUrl = this.SecretUrl;
94+
this.Disk.EncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey.SecretUrl = this.SecretUrl;
7895
}
7996

8097
if (this.MyInvocation.BoundParameters.ContainsKey("SourceVaultId"))
8198
{
82-
// EncryptionSettings
83-
if (this.Disk.EncryptionSettings == null)
84-
{
85-
this.Disk.EncryptionSettings = new EncryptionSettings();
86-
}
8799
// DiskEncryptionKey
88-
if (this.Disk.EncryptionSettings.DiskEncryptionKey == null)
100+
if (this.Disk.EncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey == null)
89101
{
90-
this.Disk.EncryptionSettings.DiskEncryptionKey = new KeyVaultAndSecretReference();
102+
this.Disk.EncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey = new KeyVaultAndSecretReference();
91103
}
92104
// SourceVault
93-
if (this.Disk.EncryptionSettings.DiskEncryptionKey.SourceVault == null)
105+
if (this.Disk.EncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey.SourceVault == null)
94106
{
95-
this.Disk.EncryptionSettings.DiskEncryptionKey.SourceVault = new SourceVault();
107+
this.Disk.EncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey.SourceVault = new SourceVault();
96108
}
97-
this.Disk.EncryptionSettings.DiskEncryptionKey.SourceVault.Id = this.SourceVaultId;
109+
this.Disk.EncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey.SourceVault.Id = this.SourceVaultId;
98110
}
99111

100112
WriteObject(this.Disk);

0 commit comments

Comments
 (0)