Skip to content

Commit

Permalink
Generated SDK modules and recorded tests for UltraSSDCapability prope…
Browse files Browse the repository at this point in the history
…rty in Dedicated Hosts for API version 2022-03-01 Compute #27949 (#27984)

* generated

* updated code

Co-authored-by: Theodore Chang <thchan@microsoft.com>
  • Loading branch information
hari-bodicherla and grizzlytheodore committed May 10, 2022
1 parent 0f06c1c commit 4229cd6
Show file tree
Hide file tree
Showing 7 changed files with 769 additions and 224 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Provides developers with libraries for the updated compute platform under Azure Resource manager to deploy virtual machine, virtual machine extensions and availability set management capabilities. Launch, restart, scale, capture and manage VMs, VM Extensions and more. Note: This client library is for Virtual Machines under Azure Resource Manager.
Development of this library has shifted focus to the Azure Unified SDK. The future development will be focused on "Azure.ResourceManager.Compute" (https://www.nuget.org/packages/Azure.ResourceManager.Compute/). Please see the package changelog for more information.
</Description>
<Version>54.1.0-preview.1</Version>
<Version>54.0.0</Version>
<AssemblyName>Microsoft.Azure.Management.Compute</AssemblyName>
<PackageTags>management;virtual machine;compute;</PackageTags>
<PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public void TestDedicatedHostOperations()
string baseRGName = ComputeManagementTestUtilities.GenerateName(TestPrefix);
string rgName = baseRGName + "DH";
string dhgName = "DHG-1";
string dhgWithUltraSSDName = "DHG-UltraSSD-1";
string dhName = "DH-1";

try
Expand Down Expand Up @@ -64,7 +65,7 @@ public void TestDedicatedHostOperations()
var createdDH = CreateDedicatedHost(rgName, dhgName, dhName, "ESv3-Type1");
var returnedDH = m_CrpClient.DedicatedHosts.Get(rgName, dhgName, dhName);
ValidateDedicatedHost(createdDH, returnedDH);

//List DedicatedHosts
var listDHsResponse = m_CrpClient.DedicatedHosts.ListByHostGroup(rgName, dhgName);
Assert.Single(listDHsResponse);
Expand All @@ -74,6 +75,10 @@ public void TestDedicatedHostOperations()
m_CrpClient.DedicatedHosts.Delete(rgName, dhgName, dhName);
m_CrpClient.DedicatedHostGroups.Delete(rgName, dhgName);

// Create a dedicated host group with ultraSSDCapabilty set to true, then get the dedicated host group and validate that they match
createdDHG = CreateDedicatedHostGroup(rgName, dhgWithUltraSSDName, ultraSSDCapability: true);
returnedDHG = m_CrpClient.DedicatedHostGroups.Get(rgName, dhgWithUltraSSDName);
ValidateDedicatedHostGroup(createdDHG, returnedDHG);
}
finally
{
Expand Down Expand Up @@ -192,6 +197,12 @@ private void ValidateDedicatedHostGroup(DedicatedHostGroup expectedDHG, Dedicate
Assert.Equal(expectedDHG.Location, actualDHG.Location);
Assert.Equal(expectedDHG.Name, actualDHG.Name);
Assert.Equal(expectedDHG.SupportAutomaticPlacement, actualDHG.SupportAutomaticPlacement);

if(expectedDHG.AdditionalCapabilities != null)
{
Assert.NotNull(actualDHG.AdditionalCapabilities);
Assert.Equal(expectedDHG.AdditionalCapabilities.UltraSSDEnabled, actualDHG.AdditionalCapabilities.UltraSSDEnabled);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ protected VirtualMachine CreateDefaultVMInput(string rgName, string storageAccou
return vm;
}

protected DedicatedHostGroup CreateDedicatedHostGroup( string rgName, string dedicatedHostGroupName, int? availabilityZone = 1)
protected DedicatedHostGroup CreateDedicatedHostGroup(string rgName, string dedicatedHostGroupName, int? availabilityZone = 1, bool ultraSSDCapability = false)
{
m_ResourcesClient.ResourceGroups.CreateOrUpdate(
rgName,
Expand All @@ -1042,7 +1042,11 @@ protected DedicatedHostGroup CreateDedicatedHostGroup( string rgName, string ded
Location = m_location,
Zones = availabilityZone == null ? null : new List<string> { availabilityZone.ToString() },
PlatformFaultDomainCount = 1,
SupportAutomaticPlacement = true
SupportAutomaticPlacement = true,
AdditionalCapabilities = new DedicatedHostGroupPropertiesAdditionalCapabilities
{
UltraSSDEnabled = ultraSSDCapability
}
};
return m_CrpClient.DedicatedHostGroups.CreateOrUpdate(rgName, dedicatedHostGroupName, dedicatedHostGroup);
}
Expand Down
Loading

0 comments on commit 4229cd6

Please sign in to comment.