forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Azure/master
Master merge
- Loading branch information
Showing
551 changed files
with
13,378 additions
and
12,903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,12 @@ AutoRest installed successfully. | |
Commencing code generation | ||
Generating CSharp code | ||
Executing AutoRest command | ||
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\Azure-sdk\compute-2020-06\sdk | ||
2020-07-01 17:17:32 UTC | ||
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\workdir\github\azure-sdk-for-net\sdk | ||
2020-07-14 19:06:24 UTC | ||
Azure-rest-api-specs repository information | ||
GitHub fork: Azure | ||
Branch: master | ||
Commit: ab6b4d787190ceb777412ebf79bd57a8dccbec2c | ||
Commit: 00ac1cbffba123ba5e30cb324935100495d0700d | ||
AutoRest information | ||
Requested version: v2 | ||
Bootstrapper version: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,12 @@ AutoRest installed successfully. | |
Commencing code generation | ||
Generating CSharp code | ||
Executing AutoRest command | ||
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/maintenance/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\gautamd-ms\azure-sdk-for-net\sdk | ||
2020-04-28 00:17:36 UTC | ||
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/maintenance/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\NetSDK\azure-sdk-for-net\sdk | ||
2020-07-20 19:00:33 UTC | ||
Azure-rest-api-specs repository information | ||
GitHub fork: Azure | ||
Branch: master | ||
Commit: de43e7fba7da1d2f2212c971d01f790a7afb1ba5 | ||
Commit: 99e5561c9cb7fc63ea693a1b6484a58ff8cd8d7e | ||
AutoRest information | ||
Requested version: v2 | ||
Bootstrapper version: [email protected] |
8 changes: 4 additions & 4 deletions
8
eng/mgmt/mgmtmetadata/recoveryservicesbackup_resource-manager.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Installing AutoRest version: v2 | ||
Installing AutoRest version: v2 | ||
AutoRest installed successfully. | ||
Commencing code generation | ||
Generating CSharp code | ||
Executing AutoRest command | ||
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/recoveryservicesbackup/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\Users\prupadhy\Desktop\l\azure-sdk-for-net\sdk | ||
2020-06-11 11:42:55 UTC | ||
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/recoveryservicesbackup/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-07 --csharp-sdks-folder=C:\SwaggerSDK\azure-sdk-for-net\sdk | ||
2020-07-19 16:53:12 UTC | ||
Azure-rest-api-specs repository information | ||
GitHub fork: Azure | ||
Branch: master | ||
Commit: 92e846e0135bce5f13b37330562714ecb9eaa058 | ||
Commit: 24773c685796a5242117e316bbefef2755869bd3 | ||
AutoRest information | ||
Requested version: v2 | ||
Bootstrapper version: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,11 @@ Commencing code generation | |
Generating CSharp code | ||
Executing AutoRest command | ||
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=. | ||
2020-07-10 15:20:01 UTC | ||
2020-07-15 15:03:48 UTC | ||
Azure-rest-api-specs repository information | ||
GitHub fork: Azure | ||
Branch: master | ||
Commit: 7d2e192d501af0c00e8a13eca5792ab02efcfede | ||
Commit: c831a7922648941648d21cf8b71dd3038d2d9057 | ||
AutoRest information | ||
Requested version: v2 | ||
Bootstrapper version: [email protected] |
10 changes: 9 additions & 1 deletion
10
...ute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineInstanceView.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...mpute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
sdk/compute/Microsoft.Azure.Management.Compute/tests/ScenarioTests/HealthExtensionTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using Microsoft.Azure.Management.Compute; | ||
using Microsoft.Azure.Management.Compute.Models; | ||
using Microsoft.Azure.Management.ResourceManager; | ||
using Microsoft.Rest.ClientRuntime.Azure.TestFramework; | ||
using Newtonsoft.Json.Linq; | ||
using Xunit; | ||
|
||
namespace Compute.Tests | ||
{ | ||
public class VMHealthExtensionTests : VMTestBase | ||
{ | ||
VirtualMachineExtension GetHealthVMExtension() | ||
{ | ||
var vmExtension = new VirtualMachineExtension | ||
{ | ||
Location = ComputeManagementTestUtilities.DefaultLocation, | ||
Tags = new Dictionary<string, string>() { { "extensionTag1", "1" }, { "extensionTag2", "2" } }, | ||
Publisher = "Microsoft.ManagedServices", | ||
VirtualMachineExtensionType = "ApplicationHealthWindows", | ||
TypeHandlerVersion = "1.0", | ||
AutoUpgradeMinorVersion = true, | ||
ForceUpdateTag = "RerunExtension", | ||
Settings = new JRaw("{ \"port\": 3389, \"protocol\": \"tcp\" }"), | ||
ProtectedSettings = "{}" | ||
}; | ||
typeof(Resource).GetRuntimeProperty("Name").SetValue(vmExtension, "vmext01"); | ||
typeof(Resource).GetRuntimeProperty("Type").SetValue(vmExtension, "Microsoft.Compute/virtualMachines/extensions"); | ||
|
||
return vmExtension; | ||
} | ||
|
||
[Fact] | ||
public void TestVMHealthExtensionOperations() | ||
{ | ||
using (MockContext context = MockContext.Start(this.GetType())) | ||
{ | ||
EnsureClientsInitialized(context); | ||
|
||
ImageReference imageRef = GetPlatformVMImage(useWindowsImage: true); | ||
// Create resource group | ||
var rgName = ComputeManagementTestUtilities.GenerateName(TestPrefix); | ||
string storageAccountName = ComputeManagementTestUtilities.GenerateName(TestPrefix); | ||
string asName = ComputeManagementTestUtilities.GenerateName("as"); | ||
VirtualMachine inputVM; | ||
try | ||
{ | ||
// Create VM with storage account | ||
var storageAccountOutput = CreateStorageAccount(rgName, storageAccountName); | ||
var vm = CreateVM(rgName, asName, storageAccountOutput, imageRef, out inputVM); | ||
|
||
// Add an extension to the VM | ||
var vmExtension = GetHealthVMExtension(); | ||
var response = m_CrpClient.VirtualMachineExtensions.CreateOrUpdate(rgName, vm.Name, vmExtension.Name, vmExtension); | ||
ValidateVMExtension(vmExtension, response); | ||
|
||
// Perform a Get operation on the extension | ||
var getVMExtResponse = m_CrpClient.VirtualMachineExtensions.Get(rgName, vm.Name, vmExtension.Name); | ||
ValidateVMExtension(vmExtension, getVMExtResponse); | ||
|
||
// Validate Get InstanceView for the extension | ||
var getVMExtInstanceViewResponse = m_CrpClient.VirtualMachineExtensions.Get(rgName, vm.Name, vmExtension.Name, "instanceView"); | ||
ValidateVMExtensionInstanceView(getVMExtInstanceViewResponse.InstanceView); | ||
|
||
var getVMInstanceViewResponse = m_CrpClient.VirtualMachines.Get(rgName, vm.Name, InstanceViewTypes.InstanceView); | ||
ValidateVMHealthStatusInstanceView(getVMInstanceViewResponse.InstanceView.VmHealth); | ||
|
||
// Validate the extension delete API | ||
m_CrpClient.VirtualMachineExtensions.Delete(rgName, vm.Name, vmExtension.Name); | ||
} | ||
finally | ||
{ | ||
m_ResourcesClient.ResourceGroups.Delete(rgName); | ||
} | ||
} | ||
} | ||
|
||
private void ValidateVMExtension(VirtualMachineExtension vmExtExpected, VirtualMachineExtension vmExtReturned) | ||
{ | ||
Assert.NotNull(vmExtReturned); | ||
Assert.True(!string.IsNullOrEmpty(vmExtReturned.ProvisioningState)); | ||
|
||
Assert.True(vmExtExpected.Publisher == vmExtReturned.Publisher); | ||
Assert.True(vmExtExpected.VirtualMachineExtensionType == vmExtReturned.VirtualMachineExtensionType); | ||
Assert.True(vmExtExpected.AutoUpgradeMinorVersion == vmExtReturned.AutoUpgradeMinorVersion); | ||
Assert.True(vmExtExpected.TypeHandlerVersion == vmExtReturned.TypeHandlerVersion); | ||
} | ||
|
||
private void ValidateVMExtensionInstanceView(VirtualMachineExtensionInstanceView vmExtInstanceView) | ||
{ | ||
Assert.NotNull(vmExtInstanceView); | ||
ValidateInstanceViewStatus(vmExtInstanceView.Statuses[0]); | ||
} | ||
|
||
private void ValidateVMHealthStatusInstanceView(VirtualMachineHealthStatus vmHealthStatus) | ||
{ | ||
Assert.NotNull(vmHealthStatus); | ||
ValidateInstanceViewStatus(vmHealthStatus.Status); | ||
} | ||
|
||
private void ValidateInstanceViewStatus(InstanceViewStatus instanceViewStatus) | ||
{ | ||
Assert.NotNull(instanceViewStatus.DisplayStatus); | ||
Assert.NotNull(instanceViewStatus.Code); | ||
Assert.NotNull(instanceViewStatus.Level); | ||
} | ||
} | ||
} |
Oops, something went wrong.