Merge branch 'preview' into Subscriptions1.5.0
This commit is contained in:
Коммит
1a5afbe4e0
|
@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27130.2024
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.AzureBridge.Admin", "Module\Azs.AzureBridge.Admin.csproj", "{1AFDCC75-D74A-4954-B1A8-29C851EB9F25}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.AzureBridge.Admin", "Module\Azs.AzureBridge.Admin.csproj", "{28801220-912A-40E4-A705-97EA33BD0264}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.AzureBridge.Admin.Tests", "Tests\Azs.AzureBridge.Admin.Tests.csproj", "{CDBCF50E-2BEC-41DD-A9BE-32BFE87B0751}"
|
||||
EndProject
|
||||
|
@ -12,20 +12,26 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
|
|||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1AFDCC75-D74A-4954-B1A8-29C851EB9F25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1AFDCC75-D74A-4954-B1A8-29C851EB9F25}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1AFDCC75-D74A-4954-B1A8-29C851EB9F25}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1AFDCC75-D74A-4954-B1A8-29C851EB9F25}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{28801220-912A-40E4-A705-97EA33BD0264}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{28801220-912A-40E4-A705-97EA33BD0264}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{28801220-912A-40E4-A705-97EA33BD0264}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{28801220-912A-40E4-A705-97EA33BD0264}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CDBCF50E-2BEC-41DD-A9BE-32BFE87B0751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CDBCF50E-2BEC-41DD-A9BE-32BFE87B0751}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CDBCF50E-2BEC-41DD-A9BE-32BFE87B0751}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CDBCF50E-2BEC-41DD-A9BE-32BFE87B0751}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -53,16 +53,21 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -43,17 +43,6 @@
|
|||
<Reference Include="Microsoft.AzureStack.Management.AzureBridge.Admin, Version=0.1.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.AzureBridge.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.AzureBridge.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -69,6 +58,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.AzureBridge.Admin.csproj">
|
||||
<Project>{28801220-912a-40e4-a705-97ea33bd0264}</Project>
|
||||
<Name>Azs.AzureBridge.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
||||
</Project>
|
|
@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
|
|||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -26,8 +28,15 @@ Global
|
|||
{30AC1D59-E029-47F2-B0F6-7F0548612F22}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{30AC1D59-E029-47F2-B0F6-7F0548612F22}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{30AC1D59-E029-47F2-B0F6-7F0548612F22}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {B04D4E68-3497-46E2-84C8-A546A1B0C906}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -53,16 +53,21 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy ContinueOnError='true' SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy ContinueOnError="true" SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -43,17 +43,6 @@
|
|||
<Reference Include="Microsoft.AzureStack.Management.Backup.Admin, Version=0.2.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Backup.Admin.0.2.0-preview\lib\net452\Microsoft.AzureStack.Management.Backup.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -69,6 +58,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.Backup.Admin.csproj">
|
||||
<Project>{1afdcc75-d74a-4954-b1a8-29c851eb9f25}</Project>
|
||||
<Name>Azs.Backup.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
||||
</Project>
|
|
@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
|
|||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -26,8 +28,15 @@ Global
|
|||
{06B6D2CF-7B0B-40BC-857B-E89001B5FABB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{06B6D2CF-7B0B-40BC-857B-E89001B5FABB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{06B6D2CF-7B0B-40BC-857B-E89001B5FABB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {088A3B44-D5D2-485C-A12E-132BAD3DEFA5}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -53,14 +53,19 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -43,17 +43,6 @@
|
|||
<Reference Include="Microsoft.AzureStack.Management.Commerce.Admin, Version=0.2.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Commerce.Admin.0.2.0-preview\lib\net452\Microsoft.AzureStack.Management.Commerce.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -69,6 +58,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.Commerce.Admin.csproj">
|
||||
<Project>{b092aff8-1bee-4f42-880c-add69cadb77d}</Project>
|
||||
<Name>Azs.Commerce.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
|
|||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -26,8 +28,15 @@ Global
|
|||
{ADFFEFF9-3540-4F75-9984-BD877A4DC9FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{ADFFEFF9-3540-4F75-9984-BD877A4DC9FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{ADFFEFF9-3540-4F75-9984-BD877A4DC9FB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {816A435E-A30C-4135-ADE4-B19F58F8F2E3}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -8,7 +8,7 @@ Locale: en-US
|
|||
|
||||
# Azs.Compute.Admin Module
|
||||
## Description
|
||||
Preview release of the AzureStack Compute administrator module which provides functionality to manage compute quotas, platform images, and virtual machine extensions
|
||||
Preview release of the AzureStack Compute administrator module which provides functionality to manage compute quotas, platform images, and virtual machine extensions, as well as managed disks migration jobs to rebalance storage.
|
||||
|
||||
## Azs.Compute.Admin Cmdlets
|
||||
### [Add-AzsPlatformImage](Add-AzsPlatformImage.md)
|
||||
|
@ -20,6 +20,12 @@ Create a new virtual machine extension image.
|
|||
### [Get-AzsComputeQuota](Get-AzsComputeQuota.md)
|
||||
Returns quotas specifying the quota limits for compute objects.
|
||||
|
||||
### [Get-AzsDisk](Get-AzsDisk.md)
|
||||
Returns the list of managed disks which can be migrated in the specified share.
|
||||
|
||||
### [Get-AzsDiskMigrationJob](Get-AzsDiskMigrationJob.md)
|
||||
Returns the list of managed disk migration jobs.
|
||||
|
||||
### [Get-AzsPlatformImage](Get-AzsPlatformImage.md)
|
||||
Returns virtual machine images loaded into the platform image repository.
|
||||
|
||||
|
@ -29,6 +35,9 @@ Returns virtual machine image extensions currently available.
|
|||
### [New-AzsComputeQuota](New-AzsComputeQuota.md)
|
||||
Create a new compute quota used to limit compute resources.
|
||||
|
||||
### [New-AzsDiskMigrationJob](New-AzsDiskMigrationJob.md)
|
||||
Starts a managed disk migration job to migrate managed disks to the specified destination share.
|
||||
|
||||
### [New-DataDiskObject](New-DataDiskObject.md)
|
||||
Creates a data disk which is used to create a new virtual machine platform image.
|
||||
|
||||
|
@ -44,3 +53,6 @@ Deletes a virtual machine extension image.
|
|||
### [Set-AzsComputeQuota](Set-AzsComputeQuota.md)
|
||||
Update an existing compute quota using the provided parameters.
|
||||
|
||||
### [Stop-AzsDiskMigrationJob](Stop-AzsDiskMigrationJob.md)
|
||||
Cancel a managed disk migration job.
|
||||
|
||||
|
|
|
@ -0,0 +1,183 @@
|
|||
---
|
||||
external help file: Azs.Compute.Admin-help.xml
|
||||
Module Name: Azs.Compute.Admin
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-AzsDisk
|
||||
|
||||
## SYNOPSIS
|
||||
Returns the list of managed disks which can be migrated in the specified share.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### List (Default)
|
||||
```
|
||||
Get-AzsDisk [-Location <String>] [-Start <Int32>] [-SharePath <String>] [-Count <Int32>]
|
||||
[-UserSubscriptionId <String>] [-Status <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### ResourceId
|
||||
```
|
||||
Get-AzsDisk -ResourceId <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### Get
|
||||
```
|
||||
Get-AzsDisk [-Location <String>] -Name <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Returns a list of disks.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> Get-AzsDisk -location local
|
||||
```
|
||||
|
||||
Returns a list of managed disks at the location local. By default, it will the first 100 disks
|
||||
|
||||
### Example 2
|
||||
```
|
||||
Get-AzsDisk -location local -name $DiskId
|
||||
```
|
||||
|
||||
Get a specific managed disk.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Count
|
||||
The maximum number of disks to return.
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Location
|
||||
Location of the resource.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: List, Get
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
The disk guid as identity.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Get
|
||||
Aliases: DiskId
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ResourceId
|
||||
The resource id.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: ResourceId
|
||||
Aliases: Id
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByPropertyName)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SharePath
|
||||
The source share which the resource belongs to.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Start
|
||||
The start index of disks in query.
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Status
|
||||
The parameters of disk state.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UserSubscriptionId
|
||||
Tenant Subscription Id which the resource belongs to.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Microsoft.AzureStack.Management.Compute.Admin.Models.Disk
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
|
@ -0,0 +1,122 @@
|
|||
---
|
||||
external help file: Azs.Compute.Admin-help.xml
|
||||
Module Name: Azs.Compute.Admin
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-AzsDiskMigrationJob
|
||||
|
||||
## SYNOPSIS
|
||||
Returns the list of managed disk migration jobs.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### List (Default)
|
||||
```
|
||||
Get-AzsDiskMigrationJob [-Status <String>] [-Location <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### ResourceId
|
||||
```
|
||||
Get-AzsDiskMigrationJob -ResourceId <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### Get
|
||||
```
|
||||
Get-AzsDiskMigrationJob [-Location <String>] -Name <String> [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Returns a list of disk migration jobs.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> Get-AzsDiskMigrationJob -location local
|
||||
```
|
||||
|
||||
Returns a list of managed disk migration jobs at the location local.
|
||||
|
||||
### Example 2
|
||||
```
|
||||
Get-AzsDiskMigrationJob -location local -Name "mymigrationName"
|
||||
```
|
||||
|
||||
Get a specific managed disk migration job.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Location
|
||||
Location of the resource.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: List, Get
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
The migration job guid name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Get
|
||||
Aliases: MigrationId
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ResourceId
|
||||
The resource id.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: ResourceId
|
||||
Aliases: Id
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByPropertyName)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Status
|
||||
The parameters of disk migration job status.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: List
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
|
@ -0,0 +1,106 @@
|
|||
---
|
||||
external help file: Azs.Compute.Admin-help.xml
|
||||
Module Name: Azs.Compute.Admin
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-AzsDiskMigrationJob
|
||||
|
||||
## SYNOPSIS
|
||||
Starts a managed disk migration job to migrate managed disks to the specified destination share.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
New-AzsDiskMigrationJob [-Disks] <Disk[]> [-TargetShare] <String> [[-Location] <String>] [-Name] <String>
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Create a disk migration job.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> $disks = Get-AzsDisk -location local -Count 20
|
||||
PS C:\> New-AzsDiskMigrationJob -Name "MyMigrationJob" -Disks $disks -location local -TargetShare "\\SU1FileServer.azurestack.local\SU1_ObjStore"
|
||||
```
|
||||
|
||||
Start a managed disk migration job for the first 20 disks
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Disks
|
||||
The parameters of disk list.
|
||||
|
||||
```yaml
|
||||
Type: Disk[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Location
|
||||
Location of the resource.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
The migration job guid name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases: MigrationId
|
||||
|
||||
Required: True
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -TargetShare
|
||||
The target share name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
|
@ -0,0 +1,75 @@
|
|||
---
|
||||
external help file: Azs.Compute.Admin-help.xml
|
||||
Module Name: Azs.Compute.Admin
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Stop-AzsDiskMigrationJob
|
||||
|
||||
## SYNOPSIS
|
||||
Cancel a managed disk migration job.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Stop-AzsDiskMigrationJob [[-Location] <String>] [[-Name] <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Cancel a disk migration job.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> $migration =New-AzsDiskMigrationJob -Name "mymigrationJob" -Disks $list -location local -TargetShare "\\SU1FileServer.azurestack.local\SU1_ObjStore"
|
||||
PS C:\> Stop-AzsDiskMigrationJob -Location local -Name $migration.MigrationId
|
||||
```
|
||||
|
||||
Cancel a managed disk migration job.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Location
|
||||
Location of the resource.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
The migration job guid name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases: MigrationId
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -40,8 +40,8 @@
|
|||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AzureStack.Management.Admin.Compute, Version=0.1.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Compute.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.Compute.Admin.dll</HintPath>
|
||||
<Reference Include="Microsoft.AzureStack.Management.Admin.Compute, Version=0.3.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Compute.Admin.0.3.0-preview\lib\net452\Microsoft.AzureStack.Management.Compute.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -53,14 +53,19 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
|
|
|
@ -80,7 +80,9 @@ Licensed under the MIT License. See License.txt in the project root for license
|
|||
'Remove-AzsVMExtension',
|
||||
'Get-AzsPlatformImage', 'Get-AzsComputeQuota',
|
||||
'Add-AzsVMExtension', 'Set-AzsComputeQuota',
|
||||
'Remove-AzsPlatformImage', 'New-DataDiskObject'
|
||||
'Remove-AzsPlatformImage', 'New-DataDiskObject',
|
||||
'Get-AzsDisk','Get-AzsDiskMigrationJob',
|
||||
'New-AzsDiskMigrationJob', 'Stop-AzsDiskMigrationJob'
|
||||
|
||||
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
|
||||
CmdletsToExport = @()
|
||||
|
@ -89,7 +91,7 @@ Licensed under the MIT License. See License.txt in the project root for license
|
|||
# VariablesToExport = @()
|
||||
|
||||
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
|
||||
AliasesToExport = @()
|
||||
AliasesToExport = @('Start-AzsDiskMigrationJob')
|
||||
|
||||
# DSC resources to export from this module
|
||||
# DscResourcesToExport = @()
|
||||
|
|
|
@ -0,0 +1,188 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
Code generated by Microsoft (R) PSSwagger
|
||||
Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Returns the list of managed disks which can be migrated in the specified share.
|
||||
|
||||
.DESCRIPTION
|
||||
Returns a list of disks.
|
||||
|
||||
.PARAMETER ResourceId
|
||||
The resource id.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER Start
|
||||
The start index of disks in query.
|
||||
|
||||
.PARAMETER SharePath
|
||||
The source share which the resource belongs to.
|
||||
|
||||
.PARAMETER Count
|
||||
The maximum number of disks to return.
|
||||
|
||||
.PARAMETER UserSubscriptionId
|
||||
Tenant Subscription Id which the resource belongs to.
|
||||
|
||||
.PARAMETER Status
|
||||
The parameters of disk state.
|
||||
|
||||
.PARAMETER Name
|
||||
The disk guid as identity.
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
PS C:\> $disks = Get-AzsDisk -location local
|
||||
PS C:\> $disk = Get-AzsDisk -location local -name $DiskId
|
||||
#>
|
||||
function Get-AzsDisk
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.Disk])]
|
||||
[CmdletBinding(DefaultParameterSetName='List')]
|
||||
param(
|
||||
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ResourceId')]
|
||||
[System.String]
|
||||
[Alias('Id')]
|
||||
$ResourceId,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'Get')]
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.Nullable`1[System.Int32]]
|
||||
$Start = $null,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.String]
|
||||
$SharePath,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.Nullable`1[System.Int32]]
|
||||
$Count = $null,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.String]
|
||||
$UserSubscriptionId,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.String]
|
||||
$Status,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'Get')]
|
||||
[Alias('DiskId')]
|
||||
[System.String]
|
||||
$Name
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
$DiskId = $Name
|
||||
|
||||
|
||||
if('ResourceId' -eq $PsCmdlet.ParameterSetName) {
|
||||
$GetArmResourceIdParameterValue_params = @{
|
||||
IdTemplate = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute.Admin/locations/{location}/disks/{DiskId}'
|
||||
}
|
||||
$GetArmResourceIdParameterValue_params['Id'] = $ResourceId
|
||||
|
||||
$ArmResourceIdParameterValues = Get-ArmResourceIdParameterValue @GetArmResourceIdParameterValue_params
|
||||
$location = $ArmResourceIdParameterValues['location']
|
||||
|
||||
$DiskId = $ArmResourceIdParameterValues['DiskId']
|
||||
}elseif (-not $PSBoundParameters.ContainsKey('Location')) {
|
||||
$Location = (Get-AzureRMLocation).Location
|
||||
}
|
||||
|
||||
$filterInfos = @(
|
||||
@{
|
||||
'Type' = 'powershellWildcard'
|
||||
'Value' = $DiskId
|
||||
'Property' = 'Name'
|
||||
})
|
||||
$applicableFilters = Get-ApplicableFilters -Filters $filterInfos
|
||||
if ($applicableFilters | Where-Object { $_.Strict }) {
|
||||
Write-Verbose -Message 'Performing server-side call ''Get-AzsDisk -'''
|
||||
$serverSideCall_params = @{
|
||||
|
||||
}
|
||||
|
||||
$serverSideResults = Get-AzsDisk @serverSideCall_params
|
||||
foreach ($serverSideResult in $serverSideResults) {
|
||||
$valid = $true
|
||||
foreach ($applicableFilter in $applicableFilters) {
|
||||
if (-not (Test-FilteredResult -Result $serverSideResult -Filter $applicableFilter.Filter)) {
|
||||
$valid = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if ($valid) {
|
||||
$serverSideResult
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
if ('List' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation ListWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.Disks.ListWithHttpMessagesAsync($Location, $(if ($PSBoundParameters.ContainsKey('UserSubscriptionId')) { $UserSubscriptionId } else { [NullString]::Value }), $(if ($PSBoundParameters.ContainsKey('Status')) { $Status } else { [NullString]::Value }), $(if ($PSBoundParameters.ContainsKey('SharePath')) { $SharePath } else { [NullString]::Value }), $Count, $Start)
|
||||
} elseif ('Get' -eq $PsCmdlet.ParameterSetName -or 'ResourceId' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation GetWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.Disks.GetWithHttpMessagesAsync($Location, $DiskId)
|
||||
} else {
|
||||
Write-Verbose -Message 'Failed to map parameter set to operation method.'
|
||||
throw 'Module failed to find operation to execute.'
|
||||
}
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
Code generated by Microsoft (R) PSSwagger
|
||||
Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Returns the list of managed disk migration jobs.
|
||||
|
||||
.DESCRIPTION
|
||||
Returns a list of disk migration jobs.
|
||||
|
||||
.PARAMETER ResourceId
|
||||
The resource id.
|
||||
|
||||
.PARAMETER Status
|
||||
The parameters of disk migration job status.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER Name
|
||||
The migration job guid name.
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
PS C:\> $migrations = Get-AzsDiskMigrationJob -location local
|
||||
PS C:\> $migration = Get-AzsDiskMigrationJob -location local -Name "mymigrationName"
|
||||
#>
|
||||
function Get-AzsDiskMigrationJob
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob])]
|
||||
[CmdletBinding(DefaultParameterSetName='List')]
|
||||
param(
|
||||
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ResourceId')]
|
||||
[System.String]
|
||||
[Alias('Id')]
|
||||
$ResourceId,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.String]
|
||||
$Status,
|
||||
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'Get')]
|
||||
[Parameter(Mandatory = $false, ParameterSetName = 'List')]
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'Get')]
|
||||
[Alias('MigrationId')]
|
||||
[System.String]
|
||||
$Name
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
$MigrationId = $Name
|
||||
|
||||
|
||||
if('ResourceId' -eq $PsCmdlet.ParameterSetName) {
|
||||
$GetArmResourceIdParameterValue_params = @{
|
||||
IdTemplate = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute.Admin/locations/{location}/diskmigrationjobs/{migrationId}'
|
||||
}
|
||||
$GetArmResourceIdParameterValue_params['Id'] = $ResourceId
|
||||
|
||||
$ArmResourceIdParameterValues = Get-ArmResourceIdParameterValue @GetArmResourceIdParameterValue_params
|
||||
$location = $ArmResourceIdParameterValues['location']
|
||||
|
||||
$migrationId = $ArmResourceIdParameterValues['migrationId']
|
||||
}elseif (-not $PSBoundParameters.ContainsKey('Location')) {
|
||||
$Location = (Get-AzureRMLocation).Location
|
||||
}
|
||||
|
||||
$filterInfos = @(
|
||||
@{
|
||||
'Type' = 'powershellWildcard'
|
||||
'Value' = $MigrationId
|
||||
'Property' = 'Name'
|
||||
})
|
||||
$applicableFilters = Get-ApplicableFilters -Filters $filterInfos
|
||||
if ($applicableFilters | Where-Object { $_.Strict }) {
|
||||
Write-Verbose -Message 'Performing server-side call ''Get-AzsDiskMigrationJob -'''
|
||||
$serverSideCall_params = @{
|
||||
|
||||
}
|
||||
|
||||
$serverSideResults = Get-AzsDiskMigrationJob @serverSideCall_params
|
||||
foreach ($serverSideResult in $serverSideResults) {
|
||||
$valid = $true
|
||||
foreach ($applicableFilter in $applicableFilters) {
|
||||
if (-not (Test-FilteredResult -Result $serverSideResult -Filter $applicableFilter.Filter)) {
|
||||
$valid = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if ($valid) {
|
||||
$serverSideResult
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
if ('List' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation ListWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.ListWithHttpMessagesAsync($Location, $(if ($PSBoundParameters.ContainsKey('Status')) { $Status } else { [NullString]::Value }))
|
||||
} elseif ('Get' -eq $PsCmdlet.ParameterSetName -or 'ResourceId' -eq $PsCmdlet.ParameterSetName) {
|
||||
Write-Verbose -Message 'Performing operation GetWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.GetWithHttpMessagesAsync($Location, $MigrationId)
|
||||
} else {
|
||||
Write-Verbose -Message 'Failed to map parameter set to operation method.'
|
||||
throw 'Module failed to find operation to execute.'
|
||||
}
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
Code generated by Microsoft (R) PSSwagger
|
||||
Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Starts a managed disk migration job to migrate managed disks to the specified destination share.
|
||||
|
||||
.DESCRIPTION
|
||||
Create a disk migration job.
|
||||
|
||||
.PARAMETER ResourceId
|
||||
The resource id.
|
||||
|
||||
.PARAMETER Disks
|
||||
The parameters of disk list.
|
||||
|
||||
.PARAMETER TargetShare
|
||||
The target share name.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER Name
|
||||
The migration job guid name.
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
PS C:\> $disks = Get-AzsDisk -location local
|
||||
PS C:\> New-AzsDiskMigrationJob -Name "MyMigrationJob" -Disks $disks -location local -TargetShare "\\SU1FileServer.azurestack.local\SU1_ObjStore"
|
||||
#>
|
||||
function New-AzsDiskMigrationJob
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob])]
|
||||
[Alias('Start-AzsDiskMigrationJob')]
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[Microsoft.AzureStack.Management.Compute.Admin.Models.Disk[]]
|
||||
$Disks,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[System.String]
|
||||
$TargetShare,
|
||||
|
||||
[Parameter(Mandatory = $false)]
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[Alias('MigrationId')]
|
||||
[System.String]
|
||||
$Name
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
$MigrationId = $Name
|
||||
|
||||
|
||||
if (-not $PSBoundParameters.ContainsKey('Location')) {
|
||||
$Location = (Get-AzureRMLocation).Location
|
||||
}
|
||||
|
||||
Write-Verbose -Message 'Performing operation CreateWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.CreateWithHttpMessagesAsync($Location, $MigrationId, $TargetShare, $Disks)
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
<#
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
Code generated by Microsoft (R) PSSwagger
|
||||
Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
#>
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Cancel a managed disk migration job.
|
||||
|
||||
.DESCRIPTION
|
||||
Cancel a disk migration job.
|
||||
|
||||
.PARAMETER Location
|
||||
Location of the resource.
|
||||
|
||||
.PARAMETER Name
|
||||
The migration job guid name.
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
PS C:\> $migration =New-AzsDiskMigrationJob -Name "mymigrationJob" -Disks $list -location local -TargetShare "\\SU1FileServer.azurestack.local\SU1_ObjStore"
|
||||
PS C:\> Stop-AzsDiskMigrationJob -Location local -MigrationId $migration.MigrationId
|
||||
|
||||
#>
|
||||
function Stop-AzsDiskMigrationJob
|
||||
{
|
||||
[OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.DiskMigrationJob])]
|
||||
param(
|
||||
[System.String]
|
||||
$Location,
|
||||
|
||||
[Alias('MigrationId')]
|
||||
[System.String]
|
||||
$Name
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
Initialize-PSSwaggerDependencies -Azure
|
||||
$tracerObject = $null
|
||||
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
|
||||
$oldDebugPreference = $global:DebugPreference
|
||||
$global:DebugPreference = "continue"
|
||||
$tracerObject = New-PSSwaggerClientTracing
|
||||
Register-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
|
||||
$NewServiceClient_params = @{
|
||||
FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient'
|
||||
}
|
||||
|
||||
$GlobalParameterHashtable = @{}
|
||||
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
|
||||
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $null
|
||||
if($PSBoundParameters.ContainsKey('SubscriptionId')) {
|
||||
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
|
||||
}
|
||||
|
||||
$ComputeAdminClient = New-ServiceClient @NewServiceClient_params
|
||||
|
||||
if (-not $PSBoundParameters.ContainsKey('Location')) {
|
||||
$Location = (Get-AzureRMLocation).Location
|
||||
}
|
||||
|
||||
Write-Verbose -Message 'Performing operation CancelWithHttpMessagesAsync on $ComputeAdminClient.'
|
||||
$TaskResult = $ComputeAdminClient.DiskMigrationJobs.CancelWithHttpMessagesAsync($Location, $Name)
|
||||
|
||||
if ($TaskResult) {
|
||||
$GetTaskResult_params = @{
|
||||
TaskResult = $TaskResult
|
||||
}
|
||||
|
||||
Get-TaskResult @GetTaskResult_params
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
End {
|
||||
if ($tracerObject) {
|
||||
$global:DebugPreference = $oldDebugPreference
|
||||
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.AzureStack.Management.Compute.Admin" version="0.1.0-preview" targetFramework="net45" />
|
||||
<package id="Microsoft.AzureStack.Management.Compute.Admin" version="0.3.0-preview" targetFramework="net45" />
|
||||
</packages>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -40,19 +40,8 @@
|
|||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AzureStack.Management.Compute.Admin, Version=0.1.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Compute.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.Compute.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Microsoft.AzureStack.Management.Compute.Admin, Version=0.3.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Compute.Admin.0.3.0-preview\lib\net452\Microsoft.AzureStack.Management.Compute.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -69,6 +58,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,355 @@
|
|||
{
|
||||
"Entries": [
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/disks?api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza3M/YXBpLXZlcnNpb249MjAxOC0wNy0zMC1wcmV2aWV3",
|
||||
"RequestMethod": "GET",
|
||||
"RequestBody": "",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"805db210-5d5e-49fc-9d59-e8f84a47c6dc"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 08:25:22 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvxJ7lxO+6/+ugzZtTW9JWA8SLaHAn4R/Mt3cSesxpwbnpgwjiS7bV0scTtd5a113ri4sI8nf81CeA3No0fJPFsw+kBjqswGo+oVcak8/1/pjMInRvgpXCv6k95Ga8l3vMLjjvnpA7h1Z5muyk6GPI"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"63edde96-9353-4e87-bd2e-38069a11b332"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-reads": [
|
||||
"14979"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"63edde96-9353-4e87-bd2e-38069a11b332"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T082522Z:63edde96-9353-4e87-bd2e-38069a11b332"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"813"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/disks/2811b3ba-dc71-4a96-8c99-b300a35f46e8\",\r\n \"name\": \"local/2811b3ba-dc71-4a96-8c99-b300a35f46e8\",\r\n \"type\": \"Microsoft.Compute.Admin/locations/disks\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"diskId\": \"2811b3ba-dc71-4a96-8c99-b300a35f46e8\",\r\n \"status\": \"Unattached\",\r\n \"sharePath\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\",\r\n \"actualSizeGB\": 1,\r\n \"provisionSizeGB\": 4,\r\n \"userResourceId\": \"/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/resourceGroups/SYSTEM/providers/Microsoft.Compute/Disks/testdisk\",\r\n \"diskType\": \"Disk\",\r\n \"diskSku\": \"Standard_LRS\"\r\n }\r\n }\r\n ]\r\n}",
|
||||
"StatusCode": 200
|
||||
},
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2?targetShare=%5C%5CSU1FileServer.azurestack.local%5CSU1_ObjStore_Invalid%5C&api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza21pZ3JhdGlvbmpvYnMvQTUwRTlFNkItQ0ZDMi00QkM3LTk1NkItMEY3QzM1MDM1REYyP3RhcmdldFNoYXJlPSU1QyU1Q1NVMUZpbGVTZXJ2ZXIuYXp1cmVzdGFjay5sb2NhbCU1Q1NVMV9PYmpTdG9yZV9JbnZhbGlkJTVDJmFwaS12ZXJzaW9uPTIwMTgtMDctMzAtcHJldmlldw==",
|
||||
"RequestMethod": "PUT",
|
||||
"RequestBody": "[\r\n {\r\n \"properties\": {\r\n \"diskId\": \"2811b3ba-dc71-4a96-8c99-b300a35f46e8\",\r\n \"status\": \"Unattached\",\r\n \"sharePath\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\"\r\n },\r\n \"location\": \"local\"\r\n }\r\n]",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"1e18d2b9-8e7c-4d57-a8ae-f856e91e4f9d"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Content-Length": [
|
||||
"227"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 08:25:22 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvQ8nnMqu9QJBgAGniGT9cEuFfAXGX7CP1qFkO1nlFTmF/SSUkYfmJvdv/FEMT8GHlHlq56Wbw8zs4FvDGCq6NFPxU39kudJ/rE3o4W15PGcWqGlO+VVOomCeGZ1Xc9YeNZwBZfCbx6XFKUivoBSIG"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"eb709fd9-84ac-4f2c-a21a-3341aac62346"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-writes": [
|
||||
"1195"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"eb709fd9-84ac-4f2c-a21a-3341aac62346"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T082523Z:eb709fd9-84ac-4f2c-a21a-3341aac62346"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"150"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"BadRequest\",\r\n \"message\": \"Share path \\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore_Invalid is not found.\"\r\n }\r\n}",
|
||||
"StatusCode": 400
|
||||
},
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2?api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza21pZ3JhdGlvbmpvYnMvQTUwRTlFNkItQ0ZDMi00QkM3LTk1NkItMEY3QzM1MDM1REYyP2FwaS12ZXJzaW9uPTIwMTgtMDctMzAtcHJldmlldw==",
|
||||
"RequestMethod": "GET",
|
||||
"RequestBody": "",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"99753c04-c43f-4873-87e0-42e55cec1783"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 08:25:28 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvlzU+nqCmAdc8wnezD4pEQtH2YsCmqGkyDNx0c9I7EAkVVV/fa0ITqGuZ8VueUqmYI9a74useEzJvOXfTTNnG7QHigWiFK6gSUS6qUaUwB4nJCI9gknfZuBaNfu/9PJa/6MeBS95rmdE8NxkTKugd"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"b41e431b-8871-479b-8807-41c0949c2238"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-reads": [
|
||||
"14978"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"b41e431b-8871-479b-8807-41c0949c2238"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T082528Z:b41e431b-8871-479b-8807-41c0949c2238"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"92"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\": \"The entity was not found.\"\r\n }\r\n}",
|
||||
"StatusCode": 404
|
||||
},
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2?api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza21pZ3JhdGlvbmpvYnMvQTUwRTlFNkItQ0ZDMi00QkM3LTk1NkItMEY3QzM1MDM1REYyP2FwaS12ZXJzaW9uPTIwMTgtMDctMzAtcHJldmlldw==",
|
||||
"RequestMethod": "GET",
|
||||
"RequestBody": "",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"0f0872fd-d184-4e0e-9183-c57e338e6c25"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 08:25:33 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvnY22FDLaSr6nXG6OuBxaq3x8JqbJnTUdv//mCK1raNO5xkS8j4Xu/u7fuzt+KzDcXAyb2xg4ZIzCvPKUZkcQFiVV1/DhG2JaEizFe2JyXKsiAEEpowABcTmmxsmiwigEBSsUwY39mNa1bOekdGyS"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"8aebb728-305f-4444-a09a-7c28ee1692f5"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-reads": [
|
||||
"14977"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"8aebb728-305f-4444-a09a-7c28ee1692f5"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T082533Z:8aebb728-305f-4444-a09a-7c28ee1692f5"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"1209"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"id\": \"/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"name\": \"local/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"type\": \"Microsoft.Compute.Admin/locations/diskmigrationjobs\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"migrationId\": \"A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"status\": \"Running\",\r\n \"subtasks\": [\r\n {\r\n \"migrationSubTaskId\": \"3c049aca-b16c-4938-90ef-8d623e508fc1\",\r\n \"properties\": {\r\n \"migrationSubtaskStatus\": \"Skipped\",\r\n \"reason\": \"Disk 454e5e28-8d5e-41f9-929e-bff6a7e1a253 not found.\",\r\n \"startTime\": \"2018-08-09T08:25:30.6667894Z\",\r\n \"targetShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\",\r\n \"sourceShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\",\r\n \"targetDiskStateForMigration\": \"Unattached\",\r\n \"diskId\": \"454e5e28-8d5e-41f9-929e-bff6a7e1a253\"\r\n }\r\n }\r\n ],\r\n \"creationTime\": \"2018-08-09T08:25:30.6667894Z\",\r\n \"startTime\": \"2018-08-09T08:25:30.6667894Z\",\r\n \"targetShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\"\r\n }\r\n}",
|
||||
"StatusCode": 200
|
||||
},
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2?targetShare=%5C%5CSU1FileServer.azurestack.local%5CSU1_ObjStore%5C&api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza21pZ3JhdGlvbmpvYnMvQTUwRTlFNkItQ0ZDMi00QkM3LTk1NkItMEY3QzM1MDM1REYyP3RhcmdldFNoYXJlPSU1QyU1Q1NVMUZpbGVTZXJ2ZXIuYXp1cmVzdGFjay5sb2NhbCU1Q1NVMV9PYmpTdG9yZSU1QyZhcGktdmVyc2lvbj0yMDE4LTA3LTMwLXByZXZpZXc=",
|
||||
"RequestMethod": "PUT",
|
||||
"RequestBody": "[\r\n {\r\n \"properties\": {\r\n \"diskId\": \"454E5E28-8D5E-41F9-929E-BFF6A7E1A253\",\r\n \"status\": \"Unattached\",\r\n \"sharePath\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\"\r\n },\r\n \"location\": \"local\"\r\n }\r\n]",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"1738df09-9138-4101-9f94-959f35a6cbeb"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Content-Length": [
|
||||
"227"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 08:25:30 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvU+xULFYWzMcZiEbccHJF8QK01573XIeoXAJ6e2v85SNHFrE+8fb9OE2KxJ5LxEVUxfk80JTXyDmvRYcMjUTe/SIUuU+zYLrMahnn/pxBTpk/qRgpNY3GPHoQ8CMwnGdp9Iee0MdDKTnBnk8j53IU"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"6b9dd42a-3696-4c33-88d0-08bf8ac597e7"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-writes": [
|
||||
"1194"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"6b9dd42a-3696-4c33-88d0-08bf8ac597e7"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T082530Z:6b9dd42a-3696-4c33-88d0-08bf8ac597e7"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"1026"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"id\": \"/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/diskmigrationjobs/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"name\": \"local/A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"type\": \"Microsoft.Compute.Admin/locations/diskmigrationjobs\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"migrationId\": \"A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2\",\r\n \"status\": \"Pending\",\r\n \"subtasks\": [\r\n {\r\n \"migrationSubTaskId\": \"3c049aca-b16c-4938-90ef-8d623e508fc1\",\r\n \"properties\": {\r\n \"migrationSubtaskStatus\": \"Pending\",\r\n \"targetShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\",\r\n \"sourceShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\",\r\n \"targetDiskStateForMigration\": \"Unattached\",\r\n \"diskId\": \"454e5e28-8d5e-41f9-929e-bff6a7e1a253\"\r\n }\r\n }\r\n ],\r\n \"creationTime\": \"2018-08-09T08:25:30.6667894Z\",\r\n \"targetShare\": \"\\\\\\\\SU1FileServer.azurestack.local\\\\SU1_ObjStore\"\r\n }\r\n}",
|
||||
"StatusCode": 200
|
||||
}
|
||||
],
|
||||
"Names": {},
|
||||
"Variables": {
|
||||
"SubscriptionId": "c69f350f-01b9-417d-bb90-08a397934964"
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
"Entries": [
|
||||
{
|
||||
"RequestUri": "/subscriptions/c69f350f-01b9-417d-bb90-08a397934964/providers/Microsoft.Compute.Admin/locations/local/disks/454E5E28-8D5E-41F9-929E-BFF6A7E1A253?api-version=2018-07-30-preview",
|
||||
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYzY5ZjM1MGYtMDFiOS00MTdkLWJiOTAtMDhhMzk3OTM0OTY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS5BZG1pbi9sb2NhdGlvbnMvbG9jYWwvZGlza3MvNDU0RTVFMjgtOEQ1RS00MUY5LTkyOUUtQkZGNkE3RTFBMjUzP2FwaS12ZXJzaW9uPTIwMTgtMDctMzAtcHJldmlldw==",
|
||||
"RequestMethod": "GET",
|
||||
"RequestBody": "",
|
||||
"RequestHeaders": {
|
||||
"x-ms-client-request-id": [
|
||||
"4e863a57-76fb-452d-88a0-0f02536482c4"
|
||||
],
|
||||
"accept-language": [
|
||||
"en-US"
|
||||
],
|
||||
"User-Agent": [
|
||||
"FxVersion/4.6.26020.03",
|
||||
"Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient/0.3.0.0"
|
||||
]
|
||||
},
|
||||
"ResponseHeaders": {
|
||||
"Cache-Control": [
|
||||
"no-cache"
|
||||
],
|
||||
"Date": [
|
||||
"Thu, 09 Aug 2018 06:05:35 GMT"
|
||||
],
|
||||
"Pragma": [
|
||||
"no-cache"
|
||||
],
|
||||
"Server": [
|
||||
"Microsoft-HTTPAPI/2.0"
|
||||
],
|
||||
"WWW-Authenticate": [
|
||||
"oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvjIutUf86si1PznOxO46jZQoJpHzmbKpfCyvgxna+bM0QZeMSLg3+oXjDYvFcH4XZZO7xel4mEqfwVL014pnxwvP4Wbw7Y76vkIsHL5yXg+zw12stsD3/bGcayVkZVHeb1psmHvCI7swotWiODA3x"
|
||||
],
|
||||
"Strict-Transport-Security": [
|
||||
"max-age=31536000; includeSubDomains"
|
||||
],
|
||||
"x-ms-served-by": [
|
||||
"00000000-0000-0000-0000-000000000000_0"
|
||||
],
|
||||
"x-ms-correlation-request-id": [
|
||||
"cbe90dad-de09-4f3d-8266-9c494514767e"
|
||||
],
|
||||
"x-ms-ratelimit-remaining-subscription-reads": [
|
||||
"14972"
|
||||
],
|
||||
"x-ms-request-id": [
|
||||
"cbe90dad-de09-4f3d-8266-9c494514767e"
|
||||
],
|
||||
"x-ms-routing-request-id": [
|
||||
"LOCAL:20180809T060536Z:cbe90dad-de09-4f3d-8266-9c494514767e"
|
||||
],
|
||||
"X-Content-Type-Options": [
|
||||
"nosniff"
|
||||
],
|
||||
"Content-Length": [
|
||||
"92"
|
||||
],
|
||||
"Content-Type": [
|
||||
"application/json; charset=utf-8"
|
||||
],
|
||||
"Expires": [
|
||||
"-1"
|
||||
]
|
||||
},
|
||||
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\": \"The entity was not found.\"\r\n }\r\n}",
|
||||
"StatusCode": 404
|
||||
}
|
||||
],
|
||||
"Names": {},
|
||||
"Variables": {
|
||||
"SubscriptionId": "c69f350f-01b9-417d-bb90-08a397934964"
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.AzureStack.Management.Compute.Admin" version="0.1.0-preview" targetFramework="net45" />
|
||||
<package id="Microsoft.AzureStack.Management.Compute.Admin" version="0.3.0-preview" targetFramework="net45" />
|
||||
<package id="Microsoft.Rest.ClientRuntime.Azure.TestFramework" version="1.6.0" targetFramework="net45" />
|
||||
</packages>
|
|
@ -0,0 +1,180 @@
|
|||
# ----------------------------------------------------------------------------------
|
||||
#
|
||||
# Copyright Microsoft Corporation
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Run AzureStack Compute admin managed disk tests.
|
||||
|
||||
.DESCRIPTION
|
||||
Run AzureStack Compute admin managed disk tests using either mock client or our client.
|
||||
The mock client allows for recording and playback. This allows for offline tests.
|
||||
|
||||
.PARAMETER RunRaw
|
||||
Run using our client creation path.
|
||||
|
||||
.EXAMPLE
|
||||
PS C:\> .\src\Disk.Tests.ps1
|
||||
Describing Disks
|
||||
[+] TestListDisks 3.01s
|
||||
[+] TestGetDisk 648ms
|
||||
|
||||
.NOTES
|
||||
Author: Shanshan Wang
|
||||
Copyright: Microsoft
|
||||
Date: July 11, 2018
|
||||
#>
|
||||
param(
|
||||
[bool]$RunRaw = $false,
|
||||
[bool]$UseInstalled = $false
|
||||
)
|
||||
$Global:UseInstalled = $UseInstalled
|
||||
$global:RunRaw = $RunRaw
|
||||
|
||||
. $PSScriptRoot\CommonModules.ps1
|
||||
|
||||
$global:Location = "local"
|
||||
$global:TestName = ""
|
||||
|
||||
InModuleScope Azs.Compute.Admin {
|
||||
|
||||
Describe "Disks" -Tags @('Disks', 'Azs.Compute.Admin') {
|
||||
|
||||
BeforeEach {
|
||||
|
||||
. $PSScriptRoot\Common.ps1
|
||||
|
||||
function ValidateDisk {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
$Disk
|
||||
)
|
||||
|
||||
$Disk | Should Not Be $null
|
||||
$Disk.Id | Should Not Be $null
|
||||
$Disk.Type | Should Not Be $null
|
||||
$Disk.Name | Should Not Be $null
|
||||
$Disk.ActualSizeGB | Should Not Be $null
|
||||
$Disk.ProvisionSizeGB | Should Not Be $null
|
||||
$Disk.DiskSku | Should Not Be $null
|
||||
$Disk.DiskType | Should Not Be $null
|
||||
$Disk.SharePath | Should Not Be $null
|
||||
$Disk.Status | Should Not Be $null
|
||||
$Disk.UserResourceId | Should Not Be $null
|
||||
$Disk.Location | Should Not Be $null
|
||||
$Disk.DiskId | Should Not Be $null
|
||||
}
|
||||
|
||||
function ValidateDisksTheSame {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
$DisksRight,
|
||||
[Parameter(Mandatory = $true)]
|
||||
$DisksLeft
|
||||
)
|
||||
$DisksRight | Should Not Be $null
|
||||
$DisksLeft | Should Not Be $null
|
||||
$DisksRight.Count -eq $DisksLeft.Count | Should Be $true
|
||||
|
||||
$DisksRight | % {CheckDisksInList -List $DisksLeft -Disk $_ | Should Be $true}
|
||||
}
|
||||
|
||||
function CheckDisksInList {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
$List,
|
||||
[Parameter(Mandatory = $true)]
|
||||
$Disk
|
||||
)
|
||||
$List | Should Not Be $null
|
||||
$Disk | Should Not Be $null
|
||||
|
||||
$diskInList = $List | ?{$_.UserResourceId.Equals($Disk.UserResourceId)}
|
||||
if($diskInList)
|
||||
{
|
||||
$true
|
||||
}
|
||||
else
|
||||
{
|
||||
$false
|
||||
}
|
||||
}
|
||||
|
||||
function ValidateDiskTheSame {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
$DiskRight,
|
||||
[Parameter(Mandatory = $true)]
|
||||
$DiskLeft
|
||||
)
|
||||
$DiskRight | Should Not Be $null
|
||||
$DiskLeft | Should Not Be $null
|
||||
|
||||
$DiskLeft.Id -eq $DiskRight.Id | Should Be $true
|
||||
}
|
||||
}
|
||||
|
||||
It "TestListDisks" {
|
||||
$global:TestName = 'TestListDisks'
|
||||
|
||||
$disks = Get-AzsDisk -Location $global:Location
|
||||
|
||||
$disks | Should Not Be $null
|
||||
foreach ($disk in $disks) {
|
||||
ValidateDisk -Disk $disk
|
||||
}
|
||||
if($disks.Count -gt 0)
|
||||
{
|
||||
$firstDisk = $disks[0]
|
||||
$tenantSubscriptionId = $($firstDisk.UserResourceId.Split("/", [System.StringSplitOptions]::RemoveEmptyEntries))[1]
|
||||
$disksForSubscription = Get-AzsDisk -Location $global:Location -UserSubscriptionId $tenantSubscriptionId
|
||||
ValidateDisksTheSame -DisksRight $($disks | ?{$_.UserResourceId.Contains($tenantSubscriptionId)}) -DisksLeft $disksForSubscription
|
||||
|
||||
$disksForStatus = Get-AzsDisk -Location $global:Location -Status $firstDisk.Status
|
||||
ValidateDisksTheSame -DisksRight $($disks | ?{$_.Status.Equals($firstDisk.Status)}) -DisksLeft $disksForStatus
|
||||
|
||||
$disksForShare = Get-AzsDisk -Location $global:Location -SharePath $firstDisk.SharePath
|
||||
ValidateDisksTheSame -DisksRight $($disks | ?{$_.SharePath.Equals($firstDisk.SharePath)}) -DisksLeft $disksForShare
|
||||
|
||||
if ($disks.Count -ge 2)
|
||||
{
|
||||
$disksWithCountAndStart = Get-AzsDisk -Location $global:Location -Start 1 -Count 1
|
||||
ValidateDisksTheSame -DisksRight @($disks[1]) -DisksLeft @($disksWithCountAndStart)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
It "TestGetDisk" {
|
||||
$global:TestName = 'TestGetDisk'
|
||||
|
||||
$disks = Get-AzsDisk -Location $global:Location
|
||||
|
||||
$disks | Should Not Be $null
|
||||
foreach ($disk in $disks) {
|
||||
ValidateDisk -Disk $disk
|
||||
}
|
||||
if($disks.Count -gt 0)
|
||||
{
|
||||
$firstDisk = $disks[0]
|
||||
$diskFromServer = Get-AzsDisk -Location $global:Location -Name $firstDisk.DiskId
|
||||
ValidateDiskTheSame -DiskRight $firstDisk -DiskLeft $diskFromServer
|
||||
}
|
||||
}
|
||||
|
||||
It "TestGetDiskInvalid" {
|
||||
$global:TestName = 'TestGetDiskInvalid'
|
||||
|
||||
{Get-AzsDisk -Location $global:Location -Name "454E5E28-8D5E-41F9-929E-BFF6A7E1A253"} | Should Throw
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
# ----------------------------------------------------------------------------------
|
||||
#
|
||||
# Copyright Microsoft Corporation
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Run AzureStack Compute admin managed disk migration tests.
|
||||
|
||||
.DESCRIPTION
|
||||
Run AzureStack Compute admin managed disk migration tests using either mock client or our client.
|
||||
The mock client allows for recording and playback. This allows for offline tests.
|
||||
|
||||
.PARAMETER RunRaw
|
||||
Run using our client creation path.
|
||||
|
||||
.EXAMPLE
|
||||
PS C:\> .\src\DiskMigration.Tests.ps1
|
||||
Describing DiskMigrations
|
||||
[+] TestDiskMigration 1.61s
|
||||
|
||||
.NOTES
|
||||
Author: Shanshan Wang
|
||||
Copyright: Microsoft
|
||||
Date: July 11, 2018
|
||||
#>
|
||||
param(
|
||||
[bool]$RunRaw = $false,
|
||||
[bool]$UseInstalled = $false
|
||||
)
|
||||
$Global:UseInstalled = $UseInstalled
|
||||
$global:RunRaw = $RunRaw
|
||||
|
||||
. $PSScriptRoot\CommonModules.ps1
|
||||
|
||||
$global:Location = "local"
|
||||
$global:TestName = ""
|
||||
$global:TargetShare = "\\SU1FileServer.azurestack.local\SU1_ObjStore\"
|
||||
|
||||
InModuleScope Azs.Compute.Admin {
|
||||
|
||||
Describe "DiskMigrations" -Tags @('DiskMigrations', 'Azs.Compute.Admin') {
|
||||
|
||||
BeforeEach {
|
||||
|
||||
. $PSScriptRoot\Common.ps1
|
||||
|
||||
function ValidateDiskMigration {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
$DiskMigration
|
||||
)
|
||||
|
||||
$DiskMigration | Should Not Be $null
|
||||
$DiskMigration.Id | Should Not Be $null
|
||||
$DiskMigration.Type | Should Not Be $null
|
||||
$DiskMigration.Name | Should Not Be $null
|
||||
$DiskMigration.CreationTime | Should Not Be $null
|
||||
$DiskMigration.TargetShare | Should Not Be $null
|
||||
$DiskMigration.Status | Should Not Be $null
|
||||
$DiskMigration.Location | Should Not Be $null
|
||||
$DiskMigration.MigrationId | Should Not Be $null
|
||||
}
|
||||
}
|
||||
|
||||
It "TestDiskMigration" {
|
||||
$global:TestName = 'TestDiskMigration'
|
||||
|
||||
$disks = Get-AzsDisk -Location $global:Location
|
||||
$disks | Should Not Be $null
|
||||
$toMigrationDisks = @()
|
||||
foreach($disk in $disks)
|
||||
{
|
||||
if ($toMigrationDisks.Count -lt 3)
|
||||
{
|
||||
$toMigrationDisks +=$disk;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
$migrationId = "ba0644a4-c2ed-4e3c-a167-089a32865297"; # this should be the same as session Records
|
||||
|
||||
$migration = Start-AzsDiskMigrationJob -Location $global:Location -Name $migrationId -TargetShare $global:TargetShare -Disks $disks
|
||||
ValidateDiskMigration -DiskMigration $migration
|
||||
|
||||
$migration = Stop-AzsDiskMigrationJob -Location $global:Location -Name $migration.MigrationId
|
||||
ValidateDiskMigration -DiskMigration $migration
|
||||
|
||||
$migrationFromGet = Get-AzsDiskMigrationJob -Location $global:Location -Name $migrationId
|
||||
ValidateDiskMigration -DiskMigration $migrationFromGet
|
||||
|
||||
$migrationList = Get-AzsDiskMigrationJob -Location $global:Location
|
||||
$migrationList | %{ValidateDiskMigration -DiskMigration $_ }
|
||||
|
||||
$migrationSucceededList = Get-AzsDiskMigrationJob -Location $global:Location -Status "Succeeded"
|
||||
$migrationSucceededList | %{ValidateDiskMigration -DiskMigration $_ }
|
||||
}
|
||||
|
||||
It "TestDiskMigrationInvalidInput" {
|
||||
$global:TestName = 'TestDiskMigrationInvalidInput'
|
||||
|
||||
$InvalidtTargetShare = "\\SU1FileServer.azurestack.local\SU1_ObjStore_Invalid\"
|
||||
$disks = @()
|
||||
$disks += Get-AzsDisk -Location $global:Location
|
||||
$disks | Should Not Be $null
|
||||
if($disks.Count -gt 0)
|
||||
{
|
||||
$toMigrationDisks = @($disks[0])
|
||||
$migrationId = "A50E9E6B-CFC2-4BC7-956B-0F7C35035DF2"; # This guid should be the same as the ones in sessionRecord
|
||||
{Start-AzsDiskMigrationJob -Location $global:Location -Name $migrationId -TargetShare $InvalidtTargetShare -Disks $toMigrationDisks} | Should throw
|
||||
{Get-AzsDiskMigrationJob -Location $global:Location -Name $migrationId }| Should throw
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,15 +3,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26430.13
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Fabric.Admin", "Module/Azs.Fabric.Admin.csproj", "{94678CB3-8F0B-44D6-8B65-39B4AE43568F}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Fabric.Admin", "Module\Azs.Fabric.Admin.csproj", "{94678CB3-8F0B-44D6-8B65-39B4AE43568F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Fabrc.Admin.Tests", "Tests/Azs.Fabric.Admin.Tests.csproj", "{88DCE80E-D019-460F-B4AD-B332E8700B96}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Fabric.Admin.Tests", "Tests\Azs.Fabric.Admin.Tests.csproj", "{88DCE80E-D019-460F-B4AD-B332E8700B96}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{060D6F31-AF9F-459B-A01B-F7B18726A72D}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -26,8 +28,15 @@ Global
|
|||
{88DCE80E-D019-460F-B4AD-B332E8700B96}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{88DCE80E-D019-460F-B4AD-B332E8700B96}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{88DCE80E-D019-460F-B4AD-B332E8700B96}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {0C3CA3B6-8611-456F-8B3F-C10AFF736CA8}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -53,14 +53,19 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<AssemblyName>Azs.Fabric.Admin.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>f747f8a7</NuGetPackageImportStamp>
|
||||
|
@ -43,17 +43,6 @@
|
|||
<Reference Include="Microsoft.AzureStack.Management.Fabric.Admin, Version=0.2.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Fabric.Admin.0.2.0-preview\lib\net452\Microsoft.AzureStack.Management.Fabric.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -69,6 +58,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.Fabric.Admin.csproj">
|
||||
<Project>{94678cb3-8f0b-44d6-8b65-39b4ae43568f}</Project>
|
||||
<Name>Azs.Fabric.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
|
@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution FIles", "Solution
|
|||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -26,6 +28,10 @@ Global
|
|||
{D6505A7D-F353-4673-8285-9BE8FF494407}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D6505A7D-F353-4673-8285-9BE8FF494407}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D6505A7D-F353-4673-8285-9BE8FF494407}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -53,14 +53,19 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.AzureStack.Management.Gallery.Admin" version="0.1.0-preview" targetFramework="net45" />
|
||||
<package id="Microsoft.AzureStack.Management.Gallery.Admin" version="0.1.0-preview" targetFramework="net452" />
|
||||
</packages>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="repositorypath" value="..\..\..\..\packages" />
|
||||
<add key="repositorypath" value="..\..\packages" />
|
||||
</config>
|
||||
</configuration>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<AssemblyName>Azs.Gallery.Admin.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\</SolutionDir>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>f747f8a7</NuGetPackageImportStamp>
|
||||
|
@ -43,17 +43,6 @@
|
|||
<Reference Include="Microsoft.AzureStack.Management.Gallery.Admin, Version=0.1.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Gallery.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.Gallery.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -68,6 +57,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.Gallery.Admin.csproj">
|
||||
<Project>{08d0d1a3-d0fb-4db6-b0c0-6ab6d6fe4152}</Project>
|
||||
<Name>Azs.Gallery.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.AzureStack.Management.Gallery.Admin" version="0.1.0-preview" targetFramework="net45" />
|
||||
<package id="Microsoft.AzureStack.Management.Gallery.Admin" version="0.1.0-preview" targetFramework="net452" />
|
||||
<package id="Microsoft.Rest.ClientRuntime.Azure.TestFramework" version="1.6.0" targetFramework="net45" />
|
||||
|
||||
</packages>
|
|
@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution FIles", "Solution
|
|||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -26,8 +28,15 @@ Global
|
|||
{318C3F12-4742-477C-BED0-B6E8475AC304}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{318C3F12-4742-477C-BED0-B6E8475AC304}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{318C3F12-4742-477C-BED0-B6E8475AC304}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F58FA0A5-5503-4035-BBA3-D3F64FED3EF9}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -53,14 +53,19 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.AzureStack.Management.InfrastructureInsights.Admin" version="0.2.0-preview" targetFramework="net45" />
|
||||
<package id="Microsoft.AzureStack.Management.InfrastructureInsights.Admin" version="0.2.0-preview" targetFramework="net452" />
|
||||
</packages>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="repositorypath" value="..\..\..\..\packages" />
|
||||
<add key="repositorypath" value="..\..\packages" />
|
||||
</config>
|
||||
</configuration>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -39,17 +40,6 @@
|
|||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.AzureStack.Management.InfrastructureInsights.Admin, Version=0.2.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.InfrastructureInsights.Admin.0.2.0-preview\lib\net452\Microsoft.AzureStack.Management.InfrastructureInsights.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -68,6 +58,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.InfrastructureInsights.Admin.csproj">
|
||||
<Project>{10627a66-4cdc-45a4-b199-955d30194a67}</Project>
|
||||
<Name>Azs.InfrastructureInsights.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
|
@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
|
|||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -26,8 +28,15 @@ Global
|
|||
{3F8DB36F-CF0B-46EB-B80F-4AFD1EDA236E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3F8DB36F-CF0B-46EB-B80F-4AFD1EDA236E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3F8DB36F-CF0B-46EB-B80F-4AFD1EDA236E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2FD447C8-DF2D-4C32-BFA5-57D6349B0BED}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -53,14 +53,19 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build"
|
||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -43,17 +43,6 @@
|
|||
<Reference Include="Microsoft.AzureStack.Management.KeyVault.Admin, Version=0.1.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.KeyVault.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.KeyVault.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -69,6 +58,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.KeyVault.Admin.csproj">
|
||||
<Project>{f07ca19c-4dd9-49b9-89ec-ee552953e126}</Project>
|
||||
<Name>Azs.KeyVault.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -52,14 +53,19 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
|
|
|
@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution FIles", "Solution
|
|||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -26,6 +28,10 @@ Global
|
|||
{3EB05490-F1C9-4129-B42B-C0E65E0DF0EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3EB05490-F1C9-4129-B42B-C0E65E0DF0EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3EB05490-F1C9-4129-B42B-C0E65E0DF0EA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="repositorypath" value="..\..\..\..\packages" />
|
||||
<add key="repositorypath" value="..\..\packages" />
|
||||
</config>
|
||||
</configuration>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -42,17 +43,6 @@
|
|||
<Reference Include="Microsoft.AzureStack.Management.Network.Admin">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Network.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.Network.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -67,6 +57,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.Network.Admin.csproj">
|
||||
<Project>{500c0581-193e-43f9-b818-4a97f0ab5012}</Project>
|
||||
<Name>Azs.Network.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -52,16 +53,21 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
|
@ -3,31 +3,40 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26430.13
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Storage.Admin", "Module/Azs.Storage.Admin.csproj", "{94678CB3-8F0B-44D6-8B65-39B4AE43568F}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Storage.Admin", "Module\Azs.Storage.Admin.csproj", "{0EFE4B31-93F3-4390-8413-286D7E9F3A30}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Fabrc.Admin.Tests", "Tests/Azs.Storage.Admin.Tests.csproj", "{88DCE80E-D019-460F-B4AD-B332E8700B96}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Storage.Admin.Tests", "Tests\Azs.Storage.Admin.Tests.csproj", "{BDF9F606-E419-4F24-B84F-B3BE6A92E9FA}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{060D6F31-AF9F-459B-A01B-F7B18726A72D}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{94678CB3-8F0B-44D6-8B65-39B4AE43568F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{94678CB3-8F0B-44D6-8B65-39B4AE43568F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{94678CB3-8F0B-44D6-8B65-39B4AE43568F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{94678CB3-8F0B-44D6-8B65-39B4AE43568F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{88DCE80E-D019-460F-B4AD-B332E8700B96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{88DCE80E-D019-460F-B4AD-B332E8700B96}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{88DCE80E-D019-460F-B4AD-B332E8700B96}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{88DCE80E-D019-460F-B4AD-B332E8700B96}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0EFE4B31-93F3-4390-8413-286D7E9F3A30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0EFE4B31-93F3-4390-8413-286D7E9F3A30}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0EFE4B31-93F3-4390-8413-286D7E9F3A30}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0EFE4B31-93F3-4390-8413-286D7E9F3A30}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BDF9F606-E419-4F24-B84F-B3BE6A92E9FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BDF9F606-E419-4F24-B84F-B3BE6A92E9FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BDF9F606-E419-4F24-B84F-B3BE6A92E9FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BDF9F606-E419-4F24-B84F-B3BE6A92E9FA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {5B8FB787-2736-44CF-9133-5DFEAE762E2A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -42,17 +43,6 @@
|
|||
<Reference Include="Microsoft.AzureStack.Management.Storage.Admin, Version=0.1.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Storage.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.Storage.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.7.2\lib\net452\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.8.1\lib\net452\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -68,6 +58,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.Storage.Admin.csproj">
|
||||
<Project>{0efe4b31-93f3-4390-8413-286d7e9f3a30}</Project>
|
||||
<Name>Azs.Storage.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -52,14 +53,19 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="repositorypath" value="..\..\..\..\packages" />
|
||||
<add key="repositorypath" value="..\..\packages" />
|
||||
</config>
|
||||
</configuration>
|
||||
|
|
|
@ -3,31 +3,40 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26430.13
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Subscriptions.Admin", "Module\Azs.Subscriptions.Admin.csproj", "{10627A66-4CDC-45A4-B199-955D30194A67}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Subscriptions.Admin", "Module\Azs.Subscriptions.Admin.csproj", "{8BD19B99-FB6B-40C9-AEEE-A09C15000E56}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Subscriptions.Admin.Tests", "Tests\Azs.Subscriptions.Admin.Tests.csproj", "{318C3F12-4742-477C-BED0-B6E8475AC304}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azs.Subscriptions.Admin.Tests", "Tests\Azs.Subscriptions.Admin.Tests.csproj", "{D9672546-145A-439B-9D16-11D60FB2C1FD}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution FIles", "Solution Files", "{060D6F31-AF9F-459B-A01B-F7B18726A72D}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution FIles", "Solution FIles", "{060D6F31-AF9F-459B-A01B-F7B18726A72D}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{10627A66-4CDC-45A4-B199-955D30194A67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{10627A66-4CDC-45A4-B199-955D30194A67}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{10627A66-4CDC-45A4-B199-955D30194A67}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{10627A66-4CDC-45A4-B199-955D30194A67}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{318C3F12-4742-477C-BED0-B6E8475AC304}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{318C3F12-4742-477C-BED0-B6E8475AC304}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{318C3F12-4742-477C-BED0-B6E8475AC304}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{318C3F12-4742-477C-BED0-B6E8475AC304}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8BD19B99-FB6B-40C9-AEEE-A09C15000E56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8BD19B99-FB6B-40C9-AEEE-A09C15000E56}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8BD19B99-FB6B-40C9-AEEE-A09C15000E56}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8BD19B99-FB6B-40C9-AEEE-A09C15000E56}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D9672546-145A-439B-9D16-11D60FB2C1FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D9672546-145A-439B-9D16-11D60FB2C1FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D9672546-145A-439B-9D16-11D60FB2C1FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D9672546-145A-439B-9D16-11D60FB2C1FD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {227E0A16-472B-4543-A442-281912EF61A7}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -42,17 +43,6 @@
|
|||
<Reference Include="Microsoft.AzureStack.Management.Subscriptions.Admin">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Subscriptions.Admin.0.2.0-preview\lib\net452\Microsoft.AzureStack.Management.Subscriptions.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.7.2\lib\net452\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.10.0\lib\net452\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -88,6 +78,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.Subscriptions.Admin.csproj">
|
||||
<Project>{8bd19b99-fb6b-40c9-aeee-a09c15000e56}</Project>
|
||||
<Name>Azs.Subscriptions.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -53,14 +54,19 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="repositorypath" value="..\..\..\..\packages" />
|
||||
<add key="repositorypath" value="..\..\packages" />
|
||||
</config>
|
||||
</configuration>
|
||||
|
|
|
@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution FIles", "Solution
|
|||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -26,6 +28,10 @@ Global
|
|||
{B709EB4D-1AC7-4DED-8B51-89C023F27283}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B709EB4D-1AC7-4DED-8B51-89C023F27283}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B709EB4D-1AC7-4DED-8B51-89C023F27283}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -43,17 +44,6 @@
|
|||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Subscription.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.Subscription.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -73,6 +63,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.Subscriptions.csproj">
|
||||
<Project>{ba6dd2e9-365e-4918-9b67-5b4f0eaf2ab8}</Project>
|
||||
<Name>Azs.Subscriptions</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -52,14 +53,19 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)..\Help\*.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*"/>
|
||||
<OutFiles Include="$(ProjectDir)$(RootNameSpace)\**\*.*" Exclude="$(ProjectDir)$(RootNameSpace)\ref\fullclr\$(RootNameSpace).*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(OutFiles)" DestinationFiles="@(OutFiles->'..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="..\..\..\Stack\$(Configuration)\ResourceManager\AzureResourceManager\$(RootNameSpace)\help\" ContinueOnError="false" />
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.Test.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -42,17 +43,6 @@
|
|||
<Reference Include="Microsoft.AzureStack.Management.Update.Admin, Version=0.1.0-preview">
|
||||
<HintPath>..\..\..\packages\Microsoft.AzureStack.Management.Update.Admin.0.1.0-preview\lib\net452\Microsoft.AzureStack.Management.Update.Admin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.6.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.7.0\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -73,6 +63,11 @@
|
|||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Module\Azs.Update.Admin.csproj">
|
||||
<Project>{0149cee0-ee2d-4ba2-90e0-caee2db24f9a}</Project>
|
||||
<Name>Azs.Update.Admin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
</Project>
|
|
@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
|
|||
nuget.config = nuget.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -26,6 +28,10 @@ Global
|
|||
{E3F4FE4B-108C-4369-8237-0EDBD9DDA369}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E3F4FE4B-108C-4369-8237-0EDBD9DDA369}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E3F4FE4B-108C-4369-8237-0EDBD9DDA369}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Microsoft.Azure.Management.Compute;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute
|
||||
{
|
||||
public abstract class AvailabilitySetBaseCmdlet : ComputeClientBaseCmdlet
|
||||
{
|
||||
public IAvailabilitySetsOperations AvailabilitySetClient
|
||||
{
|
||||
get
|
||||
{
|
||||
return ComputeClient.ComputeManagementClient.AvailabilitySets;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using AutoMapper;
|
||||
using Microsoft.Azure.Commands.Compute.Common;
|
||||
using Microsoft.Azure.Commands.Compute.Models;
|
||||
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
|
||||
using System.Collections.Generic;
|
||||
using System.Management.Automation;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute
|
||||
{
|
||||
[Cmdlet(VerbsCommon.Get, ProfileNouns.AvailabilitySet)]
|
||||
[OutputType(typeof(PSAvailabilitySet))]
|
||||
public class GetAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
|
||||
{
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 0,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The resource group name.")]
|
||||
[ResourceGroupCompleter()]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string ResourceGroupName { get; set; }
|
||||
|
||||
[Alias("ResourceName", "AvailabilitySetName")]
|
||||
[Parameter(
|
||||
Position = 1,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The availability set name.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string Name { get; set; }
|
||||
|
||||
public override void ExecuteCmdlet()
|
||||
{
|
||||
base.ExecuteCmdlet();
|
||||
|
||||
ExecuteClientAction(() =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.Name))
|
||||
{
|
||||
var result = this.AvailabilitySetClient.ListWithHttpMessagesAsync(this.ResourceGroupName).GetAwaiter().GetResult();
|
||||
|
||||
var psResultList = new List<PSAvailabilitySet>();
|
||||
foreach (var item in result.Body)
|
||||
{
|
||||
var psItem = Mapper.Map<PSAvailabilitySet>(result);
|
||||
psItem = Mapper.Map(item, psItem);
|
||||
psResultList.Add(psItem);
|
||||
}
|
||||
|
||||
WriteObject(psResultList, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = this.AvailabilitySetClient.GetWithHttpMessagesAsync(this.ResourceGroupName, this.Name).GetAwaiter().GetResult();
|
||||
var psResult = Mapper.Map<PSAvailabilitySet>(result);
|
||||
if (result.Body != null)
|
||||
{
|
||||
psResult = Mapper.Map(result.Body, psResult);
|
||||
}
|
||||
WriteObject(psResult);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using AutoMapper;
|
||||
using Microsoft.Azure.Commands.Compute.Common;
|
||||
using Microsoft.Azure.Commands.Compute.Models;
|
||||
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
|
||||
using Microsoft.Azure.Management.Compute.Models;
|
||||
using System.Management.Automation;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute
|
||||
{
|
||||
[Cmdlet(VerbsCommon.New, ProfileNouns.AvailabilitySet)]
|
||||
[OutputType(typeof(PSAvailabilitySet))]
|
||||
public class NewAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
|
||||
{
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 0,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The resource group name.")]
|
||||
[ResourceGroupCompleter()]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string ResourceGroupName { get; set; }
|
||||
|
||||
[Alias("ResourceName", "AvailabilitySetName")]
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 1,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The resource name.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 2,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The location.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string Location { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Position = 3,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The Platform Update Domain Count.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public int? PlatformUpdateDomainCount { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Position = 4,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The Platform Fault Domain Count.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public int? PlatformFaultDomainCount { get; set; }
|
||||
|
||||
public override void ExecuteCmdlet()
|
||||
{
|
||||
base.ExecuteCmdlet();
|
||||
|
||||
ExecuteClientAction(() =>
|
||||
{
|
||||
var avSetParams = new AvailabilitySet
|
||||
{
|
||||
Location = this.Location,
|
||||
PlatformUpdateDomainCount = this.PlatformUpdateDomainCount,
|
||||
PlatformFaultDomainCount = this.PlatformFaultDomainCount
|
||||
};
|
||||
|
||||
var result = this.AvailabilitySetClient.CreateOrUpdateWithHttpMessagesAsync(
|
||||
this.ResourceGroupName,
|
||||
this.Name,
|
||||
avSetParams).GetAwaiter().GetResult();
|
||||
|
||||
var psResult = Mapper.Map<PSAvailabilitySet>(result);
|
||||
if (result.Body != null)
|
||||
{
|
||||
psResult = Mapper.Map(result.Body, psResult);
|
||||
}
|
||||
WriteObject(psResult);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using AutoMapper;
|
||||
using Microsoft.Azure.Commands.Compute.Common;
|
||||
using Microsoft.Azure.Commands.Compute.Models;
|
||||
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
|
||||
using System.Management.Automation;
|
||||
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute
|
||||
{
|
||||
[Cmdlet(VerbsCommon.Remove, ProfileNouns.AvailabilitySet)]
|
||||
[OutputType(typeof(PSAzureOperationResponse))]
|
||||
public class RemoveAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
|
||||
{
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 0,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The resource group name.")]
|
||||
[ResourceGroupCompleter()]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string ResourceGroupName { get; set; }
|
||||
|
||||
[Alias("ResourceName", "AvailabilitySetName")]
|
||||
[Parameter(
|
||||
Position = 1,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The availability set name.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Position = 2,
|
||||
HelpMessage = "To force the removal.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public SwitchParameter Force { get; set; }
|
||||
|
||||
public override void ExecuteCmdlet()
|
||||
{
|
||||
base.ExecuteCmdlet();
|
||||
|
||||
ExecuteClientAction(() =>
|
||||
{
|
||||
if (this.Force.IsPresent
|
||||
|| this.ShouldContinue(Properties.Resources.AvailabilitySetRemovalConfirmation, Properties.Resources.AvailabilitySetRemovalCaption))
|
||||
{
|
||||
var op = this.AvailabilitySetClient.DeleteWithHttpMessagesAsync(
|
||||
this.ResourceGroupName,
|
||||
this.Name).GetAwaiter().GetResult();
|
||||
var result = Mapper.Map<PSAzureOperationResponse>(op);
|
||||
WriteObject(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,239 @@
|
|||
#
|
||||
# Module manifest for module 'PSGet_AzureRM.Compute'
|
||||
#
|
||||
# Generated by: Microsoft Corporation
|
||||
#
|
||||
# Generated on: 7/6/2017
|
||||
#
|
||||
|
||||
@{
|
||||
|
||||
# Script module or binary module file associated with this manifest.
|
||||
# RootModule = ''
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '1.2.3.4'
|
||||
|
||||
# Supported PSEditions
|
||||
# CompatiblePSEditions = @()
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = '0a83c907-1ffb-4d87-a492-c65ac7d7ed37'
|
||||
|
||||
# Author of this module
|
||||
Author = 'Microsoft Corporation'
|
||||
|
||||
# Company or vendor of this module
|
||||
CompanyName = 'Microsoft Corporation'
|
||||
|
||||
# Copyright statement for this module
|
||||
Copyright = 'Microsoft Corporation. All rights reserved.'
|
||||
|
||||
# Description of the functionality provided by this module
|
||||
Description = 'Microsoft Azure PowerShell - Compute service cmdlets for Azure Resource Manager. Manages virtual machines, hosted services, and related resources in Azure Resource Manager'
|
||||
|
||||
# Minimum version of the Windows PowerShell engine required by this module
|
||||
PowerShellVersion = '3.0'
|
||||
|
||||
# Name of the Windows PowerShell host required by this module
|
||||
# PowerShellHostName = ''
|
||||
|
||||
# Minimum version of the Windows PowerShell host required by this module
|
||||
# PowerShellHostVersion = ''
|
||||
|
||||
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
|
||||
DotNetFrameworkVersion = '4.5.2'
|
||||
|
||||
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
|
||||
CLRVersion = '4.0'
|
||||
|
||||
# Processor architecture (None, X86, Amd64) required by this module
|
||||
# ProcessorArchitecture = ''
|
||||
|
||||
# Modules that must be imported into the global environment prior to importing this module
|
||||
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.1.1'; })
|
||||
|
||||
# Assemblies that must be loaded prior to importing this module
|
||||
# RequiredAssemblies = @()
|
||||
|
||||
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
|
||||
# ScriptsToProcess = @()
|
||||
|
||||
# Type files (.ps1xml) to be loaded when importing this module
|
||||
TypesToProcess = '.\Microsoft.Azure.Commands.Compute.Types.ps1xml'
|
||||
|
||||
# Format files (.ps1xml) to be loaded when importing this module
|
||||
FormatsToProcess = '.\Microsoft.Azure.Commands.Compute.format.ps1xml',
|
||||
'.\Microsoft.Azure.Commands.Compute.format.generated.ps1xml',
|
||||
'.\Generated\Microsoft.Azure.Commands.Compute.Automation.format.generated.ps1xml'
|
||||
|
||||
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
|
||||
NestedModules = @('.\Microsoft.Azure.Commands.Compute.dll')
|
||||
|
||||
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
|
||||
FunctionsToExport = @()
|
||||
|
||||
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
|
||||
CmdletsToExport = 'Remove-AzureRmAvailabilitySet', 'Get-AzureRmAvailabilitySet',
|
||||
'New-AzureRmAvailabilitySet', 'Update-AzureRmAvailabilitySet',
|
||||
'Get-AzureRmVMExtensionImageType', 'Get-AzureRmVMExtensionImage',
|
||||
'Get-AzureRmVMADDomainExtension', 'Set-AzureRmVMADDomainExtension',
|
||||
'Get-AzureRmVMAEMExtension', 'Remove-AzureRmVMAEMExtension',
|
||||
'Set-AzureRmVMAEMExtension', 'Test-AzureRmVMAEMExtension',
|
||||
'Set-AzureRmVMBginfoExtension',
|
||||
'Get-AzureRmVMCustomScriptExtension',
|
||||
'Remove-AzureRmVMCustomScriptExtension',
|
||||
'Set-AzureRmVMCustomScriptExtension',
|
||||
'Get-AzureRmVMDiagnosticsExtension',
|
||||
'Remove-AzureRmVMDiagnosticsExtension',
|
||||
'Remove-AzureRmVmssDiagnosticsExtension',
|
||||
'Set-AzureRmVMDiagnosticsExtension', 'Set-AzureRmVMExtension',
|
||||
'Remove-AzureRmVMExtension', 'Get-AzureRmVMExtension',
|
||||
'Get-AzureRmVMSqlServerExtension',
|
||||
'New-AzureRmVMSqlServerAutoBackupConfig',
|
||||
'New-AzureRmVMSqlServerAutoPatchingConfig',
|
||||
'New-AzureRmVMSqlServerKeyVaultCredentialConfig',
|
||||
'Remove-AzureRmVMSqlServerExtension',
|
||||
'Set-AzureRmVMSqlServerExtension', 'Get-AzureRmVMImage',
|
||||
'Get-AzureRmVMAccessExtension', 'Remove-AzureRmVMAccessExtension',
|
||||
'Set-AzureRmVMAccessExtension', 'Get-AzureRmVMImageSku',
|
||||
'Get-AzureRmVMImagePublisher', 'Get-AzureRmVMImageOffer',
|
||||
'Get-AzureRmRemoteDesktopFile', 'Get-AzureRmVMUsage',
|
||||
'Get-AzureRmVMSize', 'Save-AzureRmVMImage', 'Set-AzureRmVM',
|
||||
'Add-AzureRmVMAdditionalUnattendContent',
|
||||
'Add-AzureRmVMSshPublicKey', 'Add-AzureRmVMSecret',
|
||||
'Remove-AzureRmVMSecret', 'Remove-AzureRmVMNetworkInterface',
|
||||
'Remove-AzureRmVMDataDisk', 'Set-AzureRmVMBootDiagnostics',
|
||||
'Set-AzureRmVMDataDisk', 'Set-AzureRmVMPlan',
|
||||
'Set-AzureRmVMSourceImage', 'Set-AzureRmVMOSDisk',
|
||||
'Get-AzureRmVMBootDiagnosticsData', 'Get-AzureRmVM',
|
||||
'Update-AzureRmVM', 'Restart-AzureRmVM', 'New-AzureRmVM',
|
||||
'Start-AzureRmVM', 'Stop-AzureRmVM', 'Remove-AzureRmVM',
|
||||
'New-AzureRmVMConfig', 'Set-AzureRmVMOperatingSystem',
|
||||
'Add-AzureRmVMDataDisk', 'Add-AzureRmVMNetworkInterface',
|
||||
'Add-AzureRmVhd', 'Save-AzureRmVhd',
|
||||
'Add-AzureRmContainerServiceAgentPoolProfile',
|
||||
'New-AzureRmContainerServiceConfig',
|
||||
'Remove-AzureRmContainerServiceAgentPoolProfile',
|
||||
'New-AzureRmContainerService', 'Update-AzureRmContainerService',
|
||||
'Remove-AzureRmContainerService', 'Get-AzureRmContainerService',
|
||||
'Get-AzureRmVmssVM', 'Set-AzureRmVmssVM',
|
||||
'Add-AzureRmVmssAdditionalUnattendContent',
|
||||
'Add-AzureRmVmssExtension', 'Add-AzureRmVmssDataDisk',
|
||||
'Add-AzureRmVmssNetworkInterfaceConfiguration',
|
||||
'Add-AzureRmVmssSecret', 'Add-AzureRmVmssSshPublicKey',
|
||||
'Add-AzureRmVmssWinRMListener', 'New-AzureRmVmssConfig',
|
||||
'New-AzureRmVmssIpConfig', 'New-AzureRmVmssVaultCertificateConfig',
|
||||
'Remove-AzureRmVmssExtension', 'Remove-AzureRmVmssDataDisk',
|
||||
'Remove-AzureRmVmssNetworkInterfaceConfiguration',
|
||||
'Set-AzureRmVmssOsProfile', 'Set-AzureRmVmssStorageProfile',
|
||||
'New-AzureRmVmss', 'Update-AzureRmVmss', 'Stop-AzureRmVmss',
|
||||
'Remove-AzureRmVmss', 'Get-AzureRmVmss', 'Get-AzureRmVmssSku',
|
||||
'Set-AzureRmVmss', 'Restart-AzureRmVmss', 'Start-AzureRmVmss',
|
||||
'Update-AzureRmVmssInstance', 'Get-AzureRmVMDscExtensionStatus',
|
||||
'Publish-AzureRmVMDscConfiguration', 'Remove-AzureRmVMDscExtension',
|
||||
'Set-AzureRmVMDscExtension', 'Get-AzureRmVMDscExtension',
|
||||
'Add-AzureRmVmssDiagnosticsExtension', 'Get-AzureRmVMChefExtension',
|
||||
'Remove-AzureRmVMChefExtension', 'Set-AzureRmVMChefExtension',
|
||||
'Remove-AzureRmVMBackup', 'Disable-AzureRmVMDiskEncryption',
|
||||
'Get-AzureRmVMDiskEncryptionStatus',
|
||||
'Remove-AzureRmVMDiskEncryptionExtension',
|
||||
'Set-AzureRmVMDiskEncryptionExtension',
|
||||
'Set-AzureRmVMBackupExtension', 'New-AzureRmDisk',
|
||||
'Update-AzureRmDisk', 'Get-AzureRmDisk', 'Remove-AzureRmDisk',
|
||||
'Grant-AzureRmDiskAccess', 'Revoke-AzureRmDiskAccess',
|
||||
'New-AzureRmDiskConfig', 'Set-AzureRmDiskDiskEncryptionKey',
|
||||
'Set-AzureRmDiskImageReference', 'Set-AzureRmDiskKeyEncryptionKey',
|
||||
'New-AzureRmDiskUpdateConfig',
|
||||
'Set-AzureRmDiskUpdateDiskEncryptionKey',
|
||||
'Set-AzureRmDiskUpdateImageReference',
|
||||
'Set-AzureRmDiskUpdateKeyEncryptionKey', 'New-AzureRmSnapshot',
|
||||
'Update-AzureRmSnapshot', 'Get-AzureRmSnapshot',
|
||||
'Remove-AzureRmSnapshot', 'Grant-AzureRmSnapshotAccess',
|
||||
'Revoke-AzureRmSnapshotAccess', 'New-AzureRmSnapshotConfig',
|
||||
'Set-AzureRmSnapshotDiskEncryptionKey',
|
||||
'Set-AzureRmSnapshotImageReference',
|
||||
'Set-AzureRmSnapshotKeyEncryptionKey',
|
||||
'New-AzureRmSnapshotUpdateConfig',
|
||||
'Set-AzureRmSnapshotUpdateDiskEncryptionKey',
|
||||
'Set-AzureRmSnapshotUpdateImageReference',
|
||||
'Set-AzureRmSnapshotUpdateKeyEncryptionKey', 'New-AzureRmImage',
|
||||
'Update-AzureRmImage', 'Get-AzureRmImage', 'Remove-AzureRmImage',
|
||||
'New-AzureRmImageConfig', 'Set-AzureRmImageOsDisk',
|
||||
'Add-AzureRmImageDataDisk', 'Remove-AzureRmImageDataDisk',
|
||||
'ConvertTo-AzureRmVMManagedDisk', 'Set-AzureRmVmssBootDiagnostic',
|
||||
'Get-AzureRmComputeResourceSku'
|
||||
|
||||
# Variables to export from this module
|
||||
# VariablesToExport = @()
|
||||
|
||||
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
|
||||
AliasesToExport = @()
|
||||
|
||||
# DSC resources to export from this module
|
||||
# DscResourcesToExport = @()
|
||||
|
||||
# List of all modules packaged with this module
|
||||
# ModuleList = @()
|
||||
|
||||
# List of all files packaged with this module
|
||||
# FileList = @()
|
||||
|
||||
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
|
||||
PrivateData = @{
|
||||
|
||||
PSData = @{
|
||||
|
||||
# Tags applied to this module. These help with module discovery in online galleries.
|
||||
Tags = 'Azure','ResourceManager','ARM','Compute','IAAS','VM','VirtualMachine'
|
||||
|
||||
# A URL to the license for this module.
|
||||
LicenseUri = 'https://aka.ms/azps-license'
|
||||
|
||||
# A URL to the main website for this project.
|
||||
ProjectUri = 'https://github.com/Azure/azure-powershell'
|
||||
|
||||
# A URL to an icon representing this module.
|
||||
# IconUri = ''
|
||||
|
||||
# ReleaseNotes of this module
|
||||
ReleaseNotes = '* Storage account type support for Image disk:
|
||||
- ''StorageAccountType'' parameter is added to Set-AzureRmImageOsDisk and Add-AzureRmImageDataDisk
|
||||
* PrivateIP and PublicIP feature in Vmss Ip Configuration:
|
||||
- ''PrivateIPAddressVersion'', ''PublicIPAddressConfigurationName'', ''PublicIPAddressConfigurationIdleTimeoutInMinutes'', ''DnsSetting'' names are added to New-AzureRmVmssIpConfig
|
||||
- ''PrivateIPAddressVersion'' parameter for specifying IPv4 or IPv6 is added to New-AzureRmVmssIpConfig
|
||||
* Performance Maintenance feature:
|
||||
- ''PerformMaintenance'' switch parameter is added to Restart-AzureRmVM.
|
||||
- Get-AzureRmVM -Status shows the information of performance maintenance of the given VM
|
||||
* Virtual Machine Identity feature:
|
||||
- ''IdentityType'' parameter is added to New-AzureRmVMConfig and UpdateAzureRmVM
|
||||
- Get-AzureRmVM shows the information of the identity of the given VM
|
||||
* Vmss Identity feature:
|
||||
- ''IdentityType'' parameter is added to to New-AzureRmVmssConfig
|
||||
- Get-AzureRmVmss shows the information of the identity of the given Vmss
|
||||
* Vmss Boot Diagnostics feature:
|
||||
- New cmdlet for setting boot diagnostics of Vmss object: Set-AzureRmVmssBootDiagnostics
|
||||
- ''BootDiagnostic'' parameter is added to New-AzureRmVmssConfig
|
||||
* Vmss LicenseType feature:
|
||||
- ''LicenseType'' parameter is added to New-AzureRmVmssConfig
|
||||
* RecoveryPolicyMode support:
|
||||
- ''RecoveryPolicyMode'' paramter is added to New-AzureRmVmssConfig
|
||||
* Compute Resource Sku feature:
|
||||
- New cmdlet ''Get-AzureRmComputeResourceSku'' list all compute resource skus
|
||||
'
|
||||
|
||||
# External dependent modules of this module
|
||||
# ExternalModuleDependencies = ''
|
||||
|
||||
} # End of PSData hashtable
|
||||
|
||||
} # End of PrivateData hashtable
|
||||
|
||||
# HelpInfo URI of this module
|
||||
# HelpInfoURI = ''
|
||||
|
||||
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
|
||||
# DefaultCommandPrefix = ''
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,525 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{52643BD5-6378-49BD-9F6E-DAC9DD8A867B}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Azure.Commands.Compute</RootNamespace>
|
||||
<AssemblyName>Microsoft.Azure.Commands.Compute</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<CodeAnalysisAdditionalOptions>/assemblyCompareMode:StrongNameIgnoringVersion</CodeAnalysisAdditionalOptions>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\Stack\Debug\ResourceManager\AzureResourceManager\AzureRM.Compute\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>..\..\..\Stack\Release\ResourceManager\AzureResourceManager\AzureRM.Compute\</OutputPath>
|
||||
<DefineConstants>TRACE;SIGN</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisLogFile>bin\Release\Microsoft.Azure.Commands.Compute.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
|
||||
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
|
||||
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSetDirectories>;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories>
|
||||
<CodeAnalysisRuleDirectories>;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\FxCop\Rules</CodeAnalysisRuleDirectories>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
|
||||
<DelaySign>true</DelaySign>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AutoMapper, Version=3.1.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AutoMapper.Net4, Version=3.1.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.Edm">
|
||||
<HintPath>..\..\..\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.OData">
|
||||
<HintPath>..\..\..\packages\Microsoft.Data.OData.5.6.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.Services.Client">
|
||||
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.6.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Storage, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\WindowsAzure.Storage.6.1.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Spatial">
|
||||
<HintPath>..\..\..\packages\System.Spatial.5.6.4\lib\net40\System.Spatial.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AvailabilitySets\RemoveAzureAvailabilitySetCommand.cs" />
|
||||
<Compile Include="AvailabilitySets\GetAzureAvailabilitySetCommand.cs" />
|
||||
<Compile Include="AvailabilitySets\NewAzureAvailabilitySetCommand.cs" />
|
||||
<Compile Include="AvailabilitySets\AvailabilitySetBaseCmdlet.cs" />
|
||||
<Compile Include="Common\ComputeAutoMapperProfile.cs" />
|
||||
<Compile Include="Common\ComputeClientBaseCmdlet.cs" />
|
||||
<Compile Include="Common\ComputeClient.cs" />
|
||||
<Compile Include="Common\ComputeClientInstancViewMethod.cs" />
|
||||
<Compile Include="Common\ComputeCloudException.cs" />
|
||||
<Compile Include="Common\DiagnosticsHelper.cs" />
|
||||
<Compile Include="ExtensionImages\GetAzureVMExtensionImageTypeCommand.cs" />
|
||||
<Compile Include="ExtensionImages\GetAzureVMExtensionImageCommand.cs" />
|
||||
<Compile Include="ExtensionImages\VirtualMachineExtensionImageBaseCmdlet.cs" />
|
||||
<Compile Include="Extension\AzureDiskEncryption\AzureDiskEncryptionExtensionContext.cs" />
|
||||
<Compile Include="Extension\AzureDiskEncryption\AzureDiskEncryptionExtensionProtectedSettings.cs" />
|
||||
<Compile Include="Extension\AzureDiskEncryption\AzureDiskEncryptionExtensionPublicSettings.cs" />
|
||||
<Compile Include="Extension\AzureDiskEncryption\RemoveAzureDiskEncryptionExtension.cs" />
|
||||
<Compile Include="Extension\AzureDiskEncryption\SetAzureDiskEncryptionExtension.cs" />
|
||||
<Compile Include="Extension\AzureVMBackup\AzureVMBackupExtensionUtil.cs" />
|
||||
<Compile Include="Extension\AzureVMBackup\AzureVMBackupException.cs" />
|
||||
<Compile Include="Extension\AzureVMBackup\AzureVMBackupExtensionProtectedSettings.cs" />
|
||||
<Compile Include="Extension\AzureVMBackup\AzureVMBackupExtensionPublicSettings.cs" />
|
||||
<Compile Include="Extension\AzureVMBackup\AzureVMBackupConfig.cs" />
|
||||
<Compile Include="Extension\AzureVMBackup\RemoveAzureVMBackup.cs" />
|
||||
<Compile Include="Extension\AzureVMBackup\SetAzureVMBackupExtension.cs" />
|
||||
<Compile Include="Extension\BGInfo\SetAzureVMBGInfoExtension.cs" />
|
||||
<Compile Include="Extension\BGInfo\VirtualMachineBGInfoExtensionContext.cs" />
|
||||
<Compile Include="Extension\CustomScript\GetAzureVMCustomScriptExtensionCommand.cs" />
|
||||
<Compile Include="Extension\CustomScript\CustomScriptExtensionPrivateSettings.cs" />
|
||||
<Compile Include="Extension\CustomScript\CustomScriptExtensionPublicSettings.cs" />
|
||||
<Compile Include="Extension\CustomScript\RemoveAzureVMCustomScriptExtensionCommand.cs" />
|
||||
<Compile Include="Extension\CustomScript\SetAzureVMCustomScriptExtensionCommand.cs" />
|
||||
<Compile Include="Extension\CustomScript\VirtualMachineCustomScriptExtensionContext.cs" />
|
||||
<Compile Include="Extension\Diagnostics\DiagnosticsExtensionConstants.cs" />
|
||||
<Compile Include="Extension\Diagnostics\GetAzureRmVMDiagnosticsExtension.cs" />
|
||||
<Compile Include="Extension\Diagnostics\RemoveAzureRmVMDiagnosticsExtension.cs" />
|
||||
<Compile Include="Extension\Diagnostics\SetAzureRmVMDiagnosticsExtension.cs" />
|
||||
<Compile Include="Extension\DSC\GetAzureVMDscExtensionStatusCommand.cs" />
|
||||
<Compile Include="Extension\DSC\GetDscResourceException.cs" />
|
||||
<Compile Include="Extension\DSC\DscExtensionPublishCmdletCommonBase.cs" />
|
||||
<Compile Include="Extension\DSC\DscExtensionCmdletCommonBase.cs" />
|
||||
<Compile Include="Extension\DSC\PublishAzureVMDscConfigurationCommand.cs" />
|
||||
<Compile Include="Extension\DSC\RemoveAzureVMDscExtensionCommand.cs" />
|
||||
<Compile Include="Extension\DSC\SetAzureVMDscExtensionCommand.cs" />
|
||||
<Compile Include="Extension\DSC\VirtualMachineDscExtensionContext.cs" />
|
||||
<Compile Include="Extension\DSC\GetAzureVMDscExtensionCommand.cs" />
|
||||
<Compile Include="Extension\DSC\VirtualMachineDscExtensionStatusContext.cs" />
|
||||
<Compile Include="Extension\SetAzureVMExtensionBaseCmdlet.cs" />
|
||||
<Compile Include="Extension\SetAzureVMExtensionCommand.cs" />
|
||||
<Compile Include="Extension\RemoveAzureVMExtensionCommand.cs" />
|
||||
<Compile Include="Extension\GetAzureVMExtensionCommand.cs" />
|
||||
<Compile Include="Extension\SqlServer\AzureVMSqlServerAutoBackupSettings.cs" />
|
||||
<Compile Include="Extension\SqlServer\AzureVMSqlServerAutoPatchingSettings.cs" />
|
||||
<Compile Include="Extension\SqlServer\AzureVMSqlServerAutoTelemetrySettings.cs" />
|
||||
<Compile Include="Extension\SqlServer\AzureVMSqlServerPrivateSettings.cs" />
|
||||
<Compile Include="Extension\SqlServer\AzureVMSqlServerPublicSettings.cs" />
|
||||
<Compile Include="Extension\SqlServer\GetAzureVMSqlServerExtensionCommand.cs" />
|
||||
<Compile Include="Extension\SqlServer\NewAzureVMSqlServerAutoBackupConfig.cs" />
|
||||
<Compile Include="Extension\SqlServer\NewAzureVMSqlServerAutoPatchingConfig.cs" />
|
||||
<Compile Include="Extension\SqlServer\RemoveAzureVMSqlServerExtensionCommand.cs" />
|
||||
<Compile Include="Extension\SqlServer\SetAzureVMSqlServerExtensionCommand.cs" />
|
||||
<Compile Include="Extension\SqlServer\VirtualMachineSqlServerExtensionContext.cs" />
|
||||
<Compile Include="Generated\AvailabilitySetsOperations.cs" />
|
||||
<Compile Include="Generated\AvailabilitySetsOperationsExtensions.cs" />
|
||||
<Compile Include="Generated\ComputeAutomationBaseCmdlet.cs" />
|
||||
<Compile Include="Generated\ComputeManagementClientExtensions.cs" />
|
||||
<Compile Include="Generated\ComputeMgmtClient.cs" />
|
||||
<Compile Include="Generated\IAvailabilitySetsOperations.cs" />
|
||||
<Compile Include="Generated\InvokeAzureComputeMethodCmdlet.cs" />
|
||||
<Compile Include="Generated\IVirtualMachineExtensionImagesOperations.cs" />
|
||||
<Compile Include="Generated\IVirtualMachineExtensionsOperations.cs" />
|
||||
<Compile Include="Generated\IVirtualMachineImagesOperations.cs" />
|
||||
<Compile Include="Generated\IVirtualMachineScaleSetsOperations.cs" />
|
||||
<Compile Include="Generated\IVirtualMachineScaleSetVMsOperations.cs" />
|
||||
<Compile Include="Generated\IVirtualMachineSizesOperations.cs" />
|
||||
<Compile Include="Generated\IVirtualMachinesOperations.cs" />
|
||||
<Compile Include="Generated\Models\AdditionalUnattendContent.cs" />
|
||||
<Compile Include="Generated\Models\ApiEntityReference.cs" />
|
||||
<Compile Include="Generated\Models\ApiError.cs" />
|
||||
<Compile Include="Generated\Models\ApiErrorBase.cs" />
|
||||
<Compile Include="Generated\Models\AvailabilitySet.cs" />
|
||||
<Compile Include="Generated\Models\BootDiagnostics.cs" />
|
||||
<Compile Include="Generated\Models\BootDiagnosticsInstanceView.cs" />
|
||||
<Compile Include="Generated\Models\CachingTypes.cs" />
|
||||
<Compile Include="Generated\Models\ComponentNames.cs" />
|
||||
<Compile Include="Generated\Models\ComputeAutoMapperProfile.cs" />
|
||||
<Compile Include="Generated\Models\ComputeLongRunningOperationProperties.cs" />
|
||||
<Compile Include="Generated\Models\DataDisk.cs" />
|
||||
<Compile Include="Generated\Models\DataDiskImage.cs" />
|
||||
<Compile Include="Generated\Models\DiagnosticsProfile.cs" />
|
||||
<Compile Include="Generated\Models\DiskCreateOptionTypes.cs" />
|
||||
<Compile Include="Generated\Models\DiskEncryptionSettings.cs" />
|
||||
<Compile Include="Generated\Models\DiskInstanceView.cs" />
|
||||
<Compile Include="Generated\Models\HardwareProfile.cs" />
|
||||
<Compile Include="Generated\Models\ImageReference.cs" />
|
||||
<Compile Include="Generated\Models\InnerError.cs" />
|
||||
<Compile Include="Generated\Models\InstanceViewStatus.cs" />
|
||||
<Compile Include="Generated\Models\InstanceViewTypes.cs" />
|
||||
<Compile Include="Generated\Models\KeyVaultKeyReference.cs" />
|
||||
<Compile Include="Generated\Models\KeyVaultSecretReference.cs" />
|
||||
<Compile Include="Generated\Models\LinuxConfiguration.cs" />
|
||||
<Compile Include="Generated\Models\NetworkInterfaceReference.cs" />
|
||||
<Compile Include="Generated\Models\NetworkProfile.cs" />
|
||||
<Compile Include="Generated\Models\OperatingSystemTypes.cs" />
|
||||
<Compile Include="Generated\Models\OSDisk.cs" />
|
||||
<Compile Include="Generated\Models\OSDiskImage.cs" />
|
||||
<Compile Include="Generated\Models\OSProfile.cs" />
|
||||
<Compile Include="Generated\Models\Page.cs" />
|
||||
<Compile Include="Generated\Models\PassNames.cs" />
|
||||
<Compile Include="Generated\Models\Plan.cs" />
|
||||
<Compile Include="Generated\Models\ProtocolTypes.cs" />
|
||||
<Compile Include="Generated\Models\PSArgument.cs" />
|
||||
<Compile Include="Generated\Models\PSVirtualMachineScaleSet.cs" />
|
||||
<Compile Include="Generated\Models\PSVirtualMachineScaleSetList.cs" />
|
||||
<Compile Include="Generated\Models\PSVirtualMachineScaleSetVM.cs" />
|
||||
<Compile Include="Generated\Models\PSVirtualMachineScaleSetVMList.cs" />
|
||||
<Compile Include="Generated\Models\PurchasePlan.cs" />
|
||||
<Compile Include="Generated\Models\Resource.cs" />
|
||||
<Compile Include="Generated\Models\SettingNames.cs" />
|
||||
<Compile Include="Generated\Models\Sku.cs" />
|
||||
<Compile Include="Generated\Models\SshConfiguration.cs" />
|
||||
<Compile Include="Generated\Models\SshPublicKey.cs" />
|
||||
<Compile Include="Generated\Models\StatusLevelTypes.cs" />
|
||||
<Compile Include="Generated\Models\StorageProfile.cs" />
|
||||
<Compile Include="Generated\Models\SubResource.cs" />
|
||||
<Compile Include="Generated\Models\UpgradeMode.cs" />
|
||||
<Compile Include="Generated\Models\UpgradePolicy.cs" />
|
||||
<Compile Include="Generated\Models\Usage.cs" />
|
||||
<Compile Include="Generated\Models\UsageName.cs" />
|
||||
<Compile Include="Generated\Models\UsageUnit.cs" />
|
||||
<Compile Include="Generated\Models\VaultCertificate.cs" />
|
||||
<Compile Include="Generated\Models\VaultSecretGroup.cs" />
|
||||
<Compile Include="Generated\Models\VirtualHardDisk.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachine.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineAgentInstanceView.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineCaptureParameters.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineCaptureResult.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineExtension.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineExtensionHandlerInstanceView.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineExtensionImage.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineExtensionInstanceView.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineImage.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineImageResource.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineInstanceView.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSet.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetExtension.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetExtensionProfile.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetInstanceView.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetInstanceViewStatusesSummary.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetIPConfiguration.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetNetworkConfiguration.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetNetworkProfile.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetOSDisk.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetOSProfile.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetSku.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetSkuCapacity.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetSkuScaleType.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetStorageProfile.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetVM.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetVMExtensionsSummary.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetVMInstanceIDs.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetVMInstanceRequiredIDs.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetVMInstanceView.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineScaleSetVMProfile.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineSize.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineSizeTypes.cs" />
|
||||
<Compile Include="Generated\Models\VirtualMachineStatusCodeCount.cs" />
|
||||
<Compile Include="Generated\Models\WindowsConfiguration.cs" />
|
||||
<Compile Include="Generated\Models\WinRMConfiguration.cs" />
|
||||
<Compile Include="Generated\Models\WinRMListener.cs" />
|
||||
<Compile Include="Generated\VirtualMachineExtensionImagesOperations.cs" />
|
||||
<Compile Include="Generated\VirtualMachineExtensionImagesOperationsExtensions.cs" />
|
||||
<Compile Include="Generated\VirtualMachineExtensionsOperations.cs" />
|
||||
<Compile Include="Generated\VirtualMachineExtensionsOperationsExtensions.cs" />
|
||||
<Compile Include="Generated\VirtualMachineImagesOperations.cs" />
|
||||
<Compile Include="Generated\VirtualMachineImagesOperationsExtensions.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetsOperations.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetsOperationsExtensions.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVMsOperations.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVMsOperationsExtensions.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVM\VirtualMachineScaleSetVMDeallocateMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVM\VirtualMachineScaleSetVMDeleteMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVM\VirtualMachineScaleSetVMGetInstanceViewMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVM\VirtualMachineScaleSetVMGetMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVM\VirtualMachineScaleSetVMListMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVM\VirtualMachineScaleSetVMListNextMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVM\VirtualMachineScaleSetVMPowerOffMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVM\VirtualMachineScaleSetVMReimageMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVM\VirtualMachineScaleSetVMRestartMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSetVM\VirtualMachineScaleSetVMStartMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\AddAzureRmVmssAdditionalUnattendContentCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\AddAzureRmVmssExtensionCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\AddAzureRmVmssNetworkInterfaceConfigurationCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\AddAzureRmVmssSecretCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\AddAzureRmVmssSshPublicKeyCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\AddAzureRmVmssWinRMListenerCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\NewAzureRmVmssConfigCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\NewAzureRmVmssIpConfigCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\NewAzureRmVmssVaultCertificateConfigCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\RemoveAzureRmVmssExtensionCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\RemoveAzureRmVmssNetworkInterfaceConfigurationCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\SetAzureRmVmssOsProfileCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\Config\SetAzureRmVmssStorageProfileCommand.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetCreateOrUpdateMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetDeallocateMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetDeleteInstancesMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetDeleteMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetGetInstanceViewMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetGetMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetListAllMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetListAllNextMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetListMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetListNextMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetListSkusMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetListSkusNextMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetPowerOffMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetReimageMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetRestartMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetStartMethod.cs" />
|
||||
<Compile Include="Generated\VirtualMachineScaleSet\VirtualMachineScaleSetUpdateInstancesMethod.cs" />
|
||||
<Compile Include="Generated\ComputeManagementClient.cs" />
|
||||
<Compile Include="Generated\IComputeManagementClient.cs" />
|
||||
<Compile Include="Generated\IUsageOperations.cs" />
|
||||
<Compile Include="Generated\UsageOperations.cs" />
|
||||
<Compile Include="Generated\UsageOperationsExtensions.cs" />
|
||||
<Compile Include="Generated\VirtualMachineSizesOperations.cs" />
|
||||
<Compile Include="Generated\VirtualMachineSizesOperationsExtensions.cs" />
|
||||
<Compile Include="Generated\VirtualMachinesOperations.cs" />
|
||||
<Compile Include="Generated\VirtualMachinesOperationsExtensions.cs" />
|
||||
<Compile Include="Images\GetAzureVMImageCommand.cs" />
|
||||
<Compile Include="Common\HashTableExtensions.cs" />
|
||||
<Compile Include="Models\AzureDiskEncryptionStatusContext.cs" />
|
||||
<Compile Include="Models\DisplayHintType.cs" />
|
||||
<Compile Include="Models\PSAzureOperationResponse.cs" />
|
||||
<Compile Include="Models\PSComputeLongRunningOperation.cs" />
|
||||
<Compile Include="Models\PSOperation.cs" />
|
||||
<Compile Include="Extension\VMAccess\GetAzureVMAccessExtension.cs" />
|
||||
<Compile Include="Extension\VMAccess\RemoveAzureVMAccessExtension.cs" />
|
||||
<Compile Include="Extension\VMAccess\SetAzureVMAccessExtension.cs" />
|
||||
<Compile Include="Extension\VMAccess\VirtualMachineAccessExtensionContext.cs" />
|
||||
<Compile Include="Extension\VMAccess\VMAccessExtensionPrivateSettings.cs" />
|
||||
<Compile Include="Extension\VMAccess\VMAccessExtensionPublicSettings.cs" />
|
||||
<Compile Include="Images\GetAzureVMImageSkuCommand.cs" />
|
||||
<Compile Include="Images\GetAzureVMImagePublisherCommand.cs" />
|
||||
<Compile Include="Images\GetAzureVMImageOfferCommand.cs" />
|
||||
<Compile Include="Images\VirtualMachineImageBaseCmdlet.cs" />
|
||||
<Compile Include="Models\PSSyncOutputEvents.cs" />
|
||||
<Compile Include="Models\PSUsage.cs" />
|
||||
<Compile Include="Models\PSVirtualMachineExtensionImage.cs" />
|
||||
<Compile Include="Models\PSVirtualMachineImage.cs" />
|
||||
<Compile Include="Models\PSVirtualMachineExtension.cs" />
|
||||
<Compile Include="Models\PSAvailabilitySet.cs" />
|
||||
<Compile Include="Models\PSVirtualMachineImageResource.cs" />
|
||||
<Compile Include="Models\PSVirtualMachineInstanceView.cs" />
|
||||
<Compile Include="Models\PSVirtualMachineList.cs" />
|
||||
<Compile Include="Models\PSVirtualMachineListStatus.cs" />
|
||||
<Compile Include="Models\PSVirtualMachineSize.cs" />
|
||||
<Compile Include="Common\LocationStringExtensions.cs" />
|
||||
<Compile Include="Models\UploadParameters.cs" />
|
||||
<Compile Include="Models\VhdDownloadContext.cs" />
|
||||
<Compile Include="Models\VhdDownloaderModel.cs" />
|
||||
<Compile Include="Models\VhdUploadContext.cs" />
|
||||
<Compile Include="Models\VhdUploaderModel.cs" />
|
||||
<Compile Include="RemoteDesktop\VirtualMachineRemoteDesktopBaseCmdlet.cs" />
|
||||
<Compile Include="RemoteDesktop\GetAzureRemoteDesktopFileCommand.cs" />
|
||||
<Compile Include="StorageServices\AddAzureVhdCommand.cs" />
|
||||
<Compile Include="StorageServices\CloudPageBlobObjectFactory.cs" />
|
||||
<Compile Include="StorageServices\SaveAzureVhdCommand.cs" />
|
||||
<Compile Include="StorageServices\StorageCredentialsFactory.cs" />
|
||||
<Compile Include="Usage\GetAzureVMUsageCommand.cs" />
|
||||
<Compile Include="Usage\VirtualMachineUsageBaseCmdlet.cs" />
|
||||
<Compile Include="VirtualMachineSizes\GetAzureVMSizeCommand.cs" />
|
||||
<Compile Include="VirtualMachineSizes\VirtualMachineSizeBaseCmdlet.cs" />
|
||||
<Compile Include="VirtualMachine\Action\SaveAzureVMImageCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Action\SetAzureVMCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Action\VirtualMachineActionBaseCmdlet.cs" />
|
||||
<Compile Include="VirtualMachine\Config\AddAzureVMAdditionalUnattendContentCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Config\AddAzureVMSshPublicKeyCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Config\AddAzureVMSecretCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Config\RemoveAzureVMNetworkInterfaceCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Config\RemoveAzureVMDataDiskCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Config\SetAzureVMBootDiagnosticsCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Config\SetAzureVMDataDiskCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Config\SetAzureVMPlan.cs" />
|
||||
<Compile Include="VirtualMachine\Config\SetAzureVMSourceImage.cs" />
|
||||
<Compile Include="VirtualMachine\Config\SetAzureVMOSDiskCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Operation\GetAzureVMBootDiagnosticsDataCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Operation\GetAzureVMCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Operation\UpdateAzureVMCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Action\RestartAzureVMCommand.cs" />
|
||||
<Compile Include="Extension\VirtualMachineExtensionBaseCmdlet.cs" />
|
||||
<Compile Include="VirtualMachine\VirtualMachineBaseCmdlet.cs" />
|
||||
<Compile Include="Common\ConstantStringTypes.cs" />
|
||||
<Compile Include="Models\PSVirtualMachine.cs" />
|
||||
<Compile Include="VirtualMachine\Operation\NewAzureVMCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Action\StartAzureVMCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Action\StopAzureVMCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Operation\RemoveAzureVMCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Config\NewAzureVMConfigCommand.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VirtualMachine\Config\SetAzureVMOperatingSystemCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Config\AddAzureVMDataDiskCommand.cs" />
|
||||
<Compile Include="VirtualMachine\Config\AddAzureVMNetworkInterfaceCommand.cs" />
|
||||
<Compile Include="VirtualMachine\VirtualMachineCmdletHelper.cs" />
|
||||
<Compile Include="Extension\DSC\DscExtensionCmdletConstants.cs" />
|
||||
<Compile Include="Extension\DSC\DscExtensionPrivateSettings.cs" />
|
||||
<Compile Include="Extension\DSC\DscExtensionPublicSettings.cs" />
|
||||
<Compile Include="Extension\DSC\DscExtensionSettingsSerializer.cs" />
|
||||
<Compile Include="Extension\DSC\ConfigurationParseResult.cs" />
|
||||
<Compile Include="Extension\DSC\ConfigurationParsingHelper.cs" />
|
||||
<Compile Include="Sync\ComputeStats.cs" />
|
||||
<Compile Include="Sync\Download\BlobHandle.cs" />
|
||||
<Compile Include="Sync\Download\BlobUri.cs" />
|
||||
<Compile Include="Sync\Download\Downloader.cs" />
|
||||
<Compile Include="Sync\Download\DownloaderParameters.cs" />
|
||||
<Compile Include="Sync\IO\StreamWithReadProgress.cs" />
|
||||
<Compile Include="Sync\Program.cs" />
|
||||
<Compile Include="Sync\ProgressRecord.cs" />
|
||||
<Compile Include="Sync\ProgressStatus.cs" />
|
||||
<Compile Include="Sync\ProgressTracker.cs" />
|
||||
<Compile Include="Sync\ServicePointHandler.cs" />
|
||||
<Compile Include="Sync\Threading\Parallel.cs" />
|
||||
<Compile Include="Sync\Upload\BlobCreator.cs" />
|
||||
<Compile Include="Sync\Upload\BlobCreatorBase.cs" />
|
||||
<Compile Include="Sync\Upload\BlobSynchronizer.cs" />
|
||||
<Compile Include="Sync\Upload\ComputeStats.cs" />
|
||||
<Compile Include="Sync\Upload\DataWithRange.cs" />
|
||||
<Compile Include="Sync\Upload\ExtensionMethods.cs" />
|
||||
<Compile Include="Sync\Upload\IndexRangeHelper.cs" />
|
||||
<Compile Include="Sync\Upload\PatchingBlobCreator.cs" />
|
||||
<Compile Include="Sync\Upload\SerializationUtil.cs" />
|
||||
<Compile Include="Sync\Upload\UploadContext.cs" />
|
||||
<Compile Include="Sync\Upload\UploadOperationMetaData.cs" />
|
||||
<Compile Include="VhdManagement\Async\AsyncMachine.cs" />
|
||||
<Compile Include="VhdManagement\Async\ExceptionExtension.cs" />
|
||||
<Compile Include="VhdManagement\Model\AttributeHelper.cs" />
|
||||
<Compile Include="VhdManagement\Model\BitMap.cs" />
|
||||
<Compile Include="VhdManagement\Model\Block.cs" />
|
||||
<Compile Include="VhdManagement\Model\BlockAllocationTable.cs" />
|
||||
<Compile Include="VhdManagement\Model\DiskGeometry.cs" />
|
||||
<Compile Include="VhdManagement\Model\DiskType.cs" />
|
||||
<Compile Include="VhdManagement\Model\HostOsType.cs" />
|
||||
<Compile Include="VhdManagement\Model\IndexRange.cs" />
|
||||
<Compile Include="VhdManagement\Model\IndexRangeComparer.cs" />
|
||||
<Compile Include="VhdManagement\Model\Model.cs" />
|
||||
<Compile Include="VhdManagement\Model\ParentLocator.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\AbstractDiskBlockFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\BitMapFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\BlockAllocationTableFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\CloudVhdFileCreator.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\DifferencingDiskBlockFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\DiskTypeFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\DynamicDiskBlockFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\FixedDiskBlockFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\IBlockFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\SectorFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\StreamHelper.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\VhdConstants.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\VhdDataReader.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\VhdDataWriter.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\VhdFileFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\VhdFooterFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\VhdFooterSerializer.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\VhdHeaderFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\Persistence\VhdParentLocatorFactory.cs" />
|
||||
<Compile Include="VhdManagement\Model\PlatformCode.cs" />
|
||||
<Compile Include="VhdManagement\Model\Sector.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdCookie.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdCookieType.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdCreatorVersion.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdEntityAttribute.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdEntityDescriptor.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdFeature.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdFile.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdFileFormatVersion.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdFooter.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdHeader.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdHeaderVersion.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdPropertyAttribute.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdPropertyDescriptor.cs" />
|
||||
<Compile Include="VhdManagement\Model\VhdTimeStamp.cs" />
|
||||
<Compile Include="VhdManagement\SparseStream.cs" />
|
||||
<Compile Include="VhdManagement\VirtualDiskStream.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ResourceManager\Profile\Commands.Profile\Commands.Profile.csproj">
|
||||
<Project>{142d7b0b-388a-4ceb-a228-7f6d423c5c2e}</Project>
|
||||
<Name>Commands.Profile</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Network\Commands.Network\Commands.Network.csproj">
|
||||
<Project>{98cfd96b-a6bc-4f15-ae2c-603fc2b58981}</Project>
|
||||
<Name>Commands.Network</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Storage.Management\Commands.Management.Storage\Commands.Management.Storage.csproj">
|
||||
<Project>{a50ab133-5c04-4a17-9054-f8343683ec23}</Project>
|
||||
<Name>Commands.Management.Storage</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="AzureRM.Compute.psd1">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Extension\AzureDiskEncryption\Scripts\AzureDiskEncryptionPreRequisiteSetup.ps1" />
|
||||
<None Include="Generated\Microsoft.Azure.Commands.Compute.Automation.format.generated.ps1xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Microsoft.Azure.Commands.Compute.format.generated.ps1xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Microsoft.Azure.Commands.Compute.format.ps1xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<Content Include="Microsoft.Azure.Commands.Compute.Types.ps1xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="MSSharedLibKey.snk" />
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="StartupScripts\*.ps1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MarkdownFiles Include="$(ProjectDir)help\*.*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="$(OutputPath)\help\" ContinueOnError="false" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,135 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using AutoMapper;
|
||||
using Microsoft.Rest.Azure;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using FROM = Microsoft.Azure.Management.Compute.Models;
|
||||
using TO = Microsoft.Azure.Commands.Compute.Models;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute
|
||||
{
|
||||
public static class ComputeMapperExtension
|
||||
{
|
||||
public static IMappingExpression<TSource, TDestination> ForItems<TSource, TDestination, T>(
|
||||
this IMappingExpression<TSource, TDestination> mapper)
|
||||
where TSource : IEnumerable
|
||||
where TDestination : ICollection<T>
|
||||
{
|
||||
mapper.AfterMap((c, s) =>
|
||||
{
|
||||
if (c != null && s != null)
|
||||
{
|
||||
foreach (var t in c)
|
||||
{
|
||||
s.Add(Mapper.Map<T>(t));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return mapper;
|
||||
}
|
||||
}
|
||||
|
||||
public class ComputeAutoMapperProfile : AutoMapper.Profile
|
||||
{
|
||||
private static readonly Lazy<bool> initialize;
|
||||
|
||||
static ComputeAutoMapperProfile()
|
||||
{
|
||||
initialize = new Lazy<bool>(() =>
|
||||
{
|
||||
Mapper.AddProfile<ComputeAutoMapperProfile>();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
public override string ProfileName
|
||||
{
|
||||
get { return "ComputeAutoMapperProfile"; }
|
||||
}
|
||||
|
||||
public static bool Initialize()
|
||||
{
|
||||
return initialize.Value;
|
||||
}
|
||||
|
||||
protected override void Configure()
|
||||
{
|
||||
// => PSAzureOperationResponse
|
||||
Mapper.CreateMap<Rest.Azure.AzureOperationResponse, TO.PSAzureOperationResponse>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode))
|
||||
.ForMember(c => c.IsSuccessStatusCode, o => o.MapFrom(r => r.Response.IsSuccessStatusCode))
|
||||
.ForMember(c => c.ReasonPhrase, o => o.MapFrom(r => r.Response.ReasonPhrase));
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<FROM.VirtualMachine>, TO.PSAzureOperationResponse>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode))
|
||||
.ForMember(c => c.IsSuccessStatusCode, o => o.MapFrom(r => r.Response.IsSuccessStatusCode))
|
||||
.ForMember(c => c.ReasonPhrase, o => o.MapFrom(r => r.Response.ReasonPhrase));
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<FROM.VirtualMachineCaptureResult>, TO.PSAzureOperationResponse>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode))
|
||||
.ForMember(c => c.IsSuccessStatusCode, o => o.MapFrom(r => r.Response.IsSuccessStatusCode))
|
||||
.ForMember(c => c.ReasonPhrase, o => o.MapFrom(r => r.Response.ReasonPhrase));
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<FROM.VirtualMachineExtension>, TO.PSAzureOperationResponse>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode))
|
||||
.ForMember(c => c.IsSuccessStatusCode, o => o.MapFrom(r => r.Response.IsSuccessStatusCode))
|
||||
.ForMember(c => c.ReasonPhrase, o => o.MapFrom(r => r.Response.ReasonPhrase));
|
||||
|
||||
// AvailabilitySet => PSAvailabilitySet
|
||||
Mapper.CreateMap<FROM.AvailabilitySet, TO.PSAvailabilitySet>()
|
||||
.ForMember(c => c.VirtualMachinesReferences, o => o.MapFrom(r => r.VirtualMachines));
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<FROM.AvailabilitySet>, TO.PSAvailabilitySet>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode));
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<IPage<FROM.AvailabilitySet>>, TO.PSAvailabilitySet>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode));
|
||||
|
||||
// VirtualMachine => PSVirtualMachine
|
||||
Mapper.CreateMap<FROM.VirtualMachine, TO.PSVirtualMachine>()
|
||||
.ForMember(c => c.AvailabilitySetReference, o => o.MapFrom(r => r.AvailabilitySet))
|
||||
.ForMember(c => c.Extensions, o => o.MapFrom(r => r.Resources))
|
||||
.ForMember(c => c.OSProfile, o => o.MapFrom(r => r.OsProfile));
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<FROM.VirtualMachine>, TO.PSVirtualMachine>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode));
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<IPage<FROM.VirtualMachine>>, TO.PSVirtualMachine>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode));
|
||||
|
||||
// VirtualMachineSize => PSVirtualMachineSize
|
||||
Mapper.CreateMap<FROM.VirtualMachineSize, TO.PSVirtualMachineSize>();
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<FROM.VirtualMachineSize>, TO.PSVirtualMachineSize>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode));
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<IPage<FROM.VirtualMachineSize>>, TO.PSVirtualMachineSize>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode));
|
||||
|
||||
// Usage => PSUsage
|
||||
Mapper.CreateMap<FROM.Usage, TO.PSUsage>();
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<FROM.Usage>, TO.PSUsage>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode));
|
||||
|
||||
Mapper.CreateMap<AzureOperationResponse<IPage<FROM.Usage>>, TO.PSUsage>()
|
||||
.ForMember(c => c.StatusCode, o => o.MapFrom(r => r.Response.StatusCode));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Microsoft.Azure.Commands.Common.Authentication;
|
||||
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
|
||||
using Microsoft.Azure.Commands.Common.Authentication.Models;
|
||||
using Microsoft.Azure.Management.Compute;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute
|
||||
{
|
||||
public class ComputeClient
|
||||
{
|
||||
public IComputeManagementClient ComputeManagementClient { get; private set; }
|
||||
|
||||
public Action<string> VerboseLogger { get; set; }
|
||||
|
||||
public Action<string> ErrorLogger { get; set; }
|
||||
|
||||
public ComputeClient(IAzureContext context)
|
||||
: this(AzureSession.Instance.ClientFactory.CreateArmClient<ComputeManagementClient>(context, AzureEnvironment.Endpoint.ResourceManager))
|
||||
{
|
||||
}
|
||||
|
||||
public ComputeClient(IComputeManagementClient computeManagementClient)
|
||||
{
|
||||
ComputeManagementClient = computeManagementClient;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Microsoft.Azure.Commands.Compute.Common;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute
|
||||
{
|
||||
public abstract class ComputeClientBaseCmdlet : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
|
||||
{
|
||||
protected const string VirtualMachineExtensionType = "Microsoft.Compute/virtualMachines/extensions";
|
||||
|
||||
protected override bool IsUsageMetricEnabled
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
private ComputeClient computeClient;
|
||||
|
||||
public ComputeClient ComputeClient
|
||||
{
|
||||
get
|
||||
{
|
||||
if (computeClient == null)
|
||||
{
|
||||
computeClient = new ComputeClient(DefaultProfile.DefaultContext);
|
||||
}
|
||||
|
||||
this.computeClient.VerboseLogger = WriteVerboseWithTimestamp;
|
||||
this.computeClient.ErrorLogger = WriteErrorWithTimestamp;
|
||||
return computeClient;
|
||||
}
|
||||
|
||||
set { computeClient = value; }
|
||||
}
|
||||
|
||||
public override void ExecuteCmdlet()
|
||||
{
|
||||
base.ExecuteCmdlet();
|
||||
ComputeAutoMapperProfile.Initialize();
|
||||
}
|
||||
|
||||
protected void ExecuteClientAction(Action action)
|
||||
{
|
||||
try
|
||||
{
|
||||
action();
|
||||
}
|
||||
catch (Rest.Azure.CloudException ex)
|
||||
{
|
||||
try
|
||||
{
|
||||
base.EndProcessing();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore exceptions during end processing
|
||||
}
|
||||
|
||||
throw new ComputeCloudException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Microsoft.Azure.Management.Compute;
|
||||
using Microsoft.Azure.Management.Compute.Models;
|
||||
using Microsoft.Rest.Azure;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Common
|
||||
{
|
||||
public static class InstanceViewMethod
|
||||
{
|
||||
public static AzureOperationResponse<VirtualMachineExtension> GetWithInstanceView(this IVirtualMachineExtensionsOperations iVmExtensionOperations,
|
||||
string rgName, string vmName, string name)
|
||||
{
|
||||
const string expand = "instanceView";
|
||||
var result = iVmExtensionOperations.GetWithHttpMessagesAsync(rgName, vmName, name, expand).GetAwaiter().GetResult();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static AzureOperationResponse<VirtualMachine> GetWithInstanceView(this IVirtualMachinesOperations iVmExtensionOperations,
|
||||
string rgName, string vmName)
|
||||
{
|
||||
const InstanceViewTypes expand = InstanceViewTypes.InstanceView;
|
||||
var result = iVmExtensionOperations.GetWithHttpMessagesAsync(rgName, vmName, expand).GetAwaiter().GetResult();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Hyak.Common;
|
||||
using Microsoft.Azure.Management.Compute.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Common
|
||||
{
|
||||
public class ComputeCloudException : Rest.Azure.CloudException
|
||||
{
|
||||
protected const string RequestIdHeaderInResponse = "x-ms-request-id";
|
||||
|
||||
public ComputeCloudException(Rest.Azure.CloudException ex)
|
||||
: base(GetErrorMessageWithRequestIdInfo(ex), ex)
|
||||
{
|
||||
}
|
||||
|
||||
protected static string GetErrorMessageWithRequestIdInfo(Rest.Azure.CloudException cloudException)
|
||||
{
|
||||
if (cloudException == null)
|
||||
{
|
||||
throw new ArgumentNullException("cloudException");
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if (!string.IsNullOrEmpty(cloudException.Message))
|
||||
{
|
||||
sb.Append(cloudException.Message);
|
||||
}
|
||||
|
||||
if (cloudException.Response == null)
|
||||
{
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
if (cloudException.Response.StatusCode.Equals(HttpStatusCode.OK)
|
||||
&& cloudException.Response.Content != null)
|
||||
{
|
||||
var errorReturned = JsonConvert.DeserializeObject<ComputeLongRunningOperationError>(cloudException.Response.Content);
|
||||
|
||||
sb.AppendLine().AppendFormat("StartTime: {0}", errorReturned.StartTime);
|
||||
sb.AppendLine().AppendFormat("EndTime: {0}", errorReturned.EndTime);
|
||||
sb.AppendLine().AppendFormat("OperationID: {0}", errorReturned.OperationId);
|
||||
sb.AppendLine().AppendFormat("Status: {0}", errorReturned.Status);
|
||||
if (errorReturned.Error == null)
|
||||
{
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
sb.AppendLine().AppendFormat("ErrorCode: {0}", errorReturned.Error.Code);
|
||||
sb.AppendLine().AppendFormat("ErrorMessage: {0}", errorReturned.Error.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine().AppendFormat("StatusCode: {0}", cloudException.Response.StatusCode.GetHashCode());
|
||||
sb.AppendLine().AppendFormat("ReasonPhrase: {0}", cloudException.Response.ReasonPhrase);
|
||||
|
||||
if (cloudException.Response.Headers == null
|
||||
|| !cloudException.Response.Headers.ContainsKey(RequestIdHeaderInResponse))
|
||||
{
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
var headers = cloudException.Response.Headers;
|
||||
|
||||
var match = Regex.Match(headers.ToString(),
|
||||
@"x-ms-request-id: ([a-z0-9]{8}\-[a-z0-9]{4}\-[a-z0-9]{4}\-[a-z0-9]{4}\-[a-z0-9]{12})",
|
||||
RegexOptions.IgnoreCase);
|
||||
string operationId = (match.Success) ? match.Groups[1].Value : "";
|
||||
|
||||
sb.AppendLine().AppendFormat(
|
||||
"OperationID : '{0}'",
|
||||
operationId);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public class ComputeLongRunningOperationError
|
||||
{
|
||||
public string OperationId;
|
||||
public string Status;
|
||||
public DateTime? StartTime;
|
||||
public DateTime? EndTime;
|
||||
public ApiError Error;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Common
|
||||
{
|
||||
public static class HelpMessages
|
||||
{
|
||||
public const string VMProfile = "The virtual machine profile.";
|
||||
public const string VMSize = "The virtual machine size.";
|
||||
public const string VMComputerName = "The virtual machine's omputer name.";
|
||||
public const string VMCredential = "The virtual machine's credential.";
|
||||
public const string VMSourceImageName = "The virtual machine's source image name.";
|
||||
public const string VMImageReference = "The virtual machine's image reference.";
|
||||
public const string VMVHDContainer = "The virtual machine's Vhd container.";
|
||||
public const string VMOSDiskName = "The virtual machine OS disk's name.";
|
||||
public const string VMOSDiskVhdUri = "The virtual machine OS disk's Vhd Uri.";
|
||||
public const string VMOSDiskCaching = "The virtual machine OS disk's caching.";
|
||||
public const string VMOSDiskWindowsOSType = "The virtual machine disk's OS is Windows.";
|
||||
public const string VMOSDiskLinuxOSType = "The virtual machine disk's OS is Linux.";
|
||||
public const string VMOSDiskDiskEncryptionKeyUrl = "the URL referencing a secret in a disk encryption key vault";
|
||||
public const string VMOSDiskDiskEncryptionKeyVaultId = "the Id of a disk encryption key vault";
|
||||
public const string VMOSDiskKeyEncryptionKeyUrl = "the URL referencing a key in a key encryption key vault";
|
||||
public const string VMOSDiskKeyEncryptionKeyVaultId = "the Id of a key encryption key Vault";
|
||||
public const string VMOSDiskSizeInGB = "The virtual machine OS disk's size in GB.";
|
||||
public const string VMSourceImageUri = "The virtual machine OS disk's source image Uri.";
|
||||
|
||||
public const string VMDataDiskName = "The virtual machine data disk's name.";
|
||||
public const string VMDataDiskVhdUri = "The virtual machine data disk's Vhd Uri.";
|
||||
public const string VMDataDiskCaching = "The virtual machine data disk's caching.";
|
||||
public const string VMDataDiskSizeInGB = "The virtual machine data disk's size in GB.";
|
||||
public const string VMDataDiskLun = "The virtual machine data disk's Lun.";
|
||||
public const string VMDataDiskCreateOption = "The virtual machine data disk's create option.";
|
||||
|
||||
public const string VMNetworkInterfaceName = "The virtual machine network interface's name.";
|
||||
public const string VMNetworkInterfaceID = "The virtual machine network interface's ID.";
|
||||
public const string VMPublicIPAddressName = "The virtual machine public IP address's name.";
|
||||
public const string VMPublicIPAddressReferenceUri = "The virtual machine public IP address's reference Uri.";
|
||||
|
||||
public const string VMBootDiagnosticsEnable = "Enable boot diagnostics data of the virtual machine";
|
||||
public const string VMBootDiagnosticsDisable = "Disable boot diagnostics data of the virtual machine";
|
||||
public const string VMBootDiagnosticsResourceGroupName = "Resource group name for storage account";
|
||||
public const string VMBootDiagnosticsStorageAccountName = "Storage account name for boot diagnostics data";
|
||||
|
||||
public const string VMPlanName = "The plan ID";
|
||||
public const string VMPlanProduct = "The offer ID";
|
||||
public const string VMPlanPromotionCode = "The promotion code";
|
||||
public const string VMPlanPublisher = "The publisher ID";
|
||||
}
|
||||
|
||||
public static class ValidateSetValues
|
||||
{
|
||||
public const string ReadOnly = "ReadOnly";
|
||||
public const string ReadWrite = "ReadWrite";
|
||||
public const string None = "None";
|
||||
}
|
||||
|
||||
public static class ProfileNouns
|
||||
{
|
||||
public const string VirtualMachineProfile = "AzureRmVMProfile";
|
||||
|
||||
public const string OSProfile = "AzureRmVMOSProfile";
|
||||
public const string StorageProfile = "AzureRmVMStorageProfile";
|
||||
public const string HardwareProfile = "AzureRmVMHardwareProfile";
|
||||
public const string NetworkProfile = "AzureRmVMNetworkProfile";
|
||||
|
||||
public const string OperatingSystem = "AzureRmVMOperatingSystem";
|
||||
|
||||
public const string DataDisk = "AzureRmVMDataDisk";
|
||||
public const string OSDisk = "AzureRmVMOSDisk";
|
||||
public const string SourceImage = "AzureRmVMSourceImage";
|
||||
public const string BootDiagnostics = "AzureRmVMBootDiagnostics";
|
||||
public const string BootDiagnosticsData = "AzureRmVMBootDiagnosticsData";
|
||||
|
||||
public const string NetworkInterface = "AzureRmVMNetworkInterface";
|
||||
|
||||
public const string VirtualMachine = "AzureRmVM";
|
||||
public const string VirtualMachineExtension = "AzureRmVMExtension";
|
||||
public const string VirtualMachineCustomScriptExtension = "AzureRmVMCustomScriptExtension";
|
||||
public const string VirtualMachineAccessExtension = "AzureRmVMAccessExtension";
|
||||
public const string VirtualMachineDiagnosticsExtension = "AzureRmVMDiagnosticsExtension";
|
||||
public const string VirtualMachineBgInfoExtension = "AzureRmVMBginfoExtension";
|
||||
public const string VirtualMachineExtensionImage = "AzureRmVMExtensionImage";
|
||||
public const string VirtualMachineExtensionImageVersion = "AzureRmVMExtensionImageVersion";
|
||||
public const string VirtualMachineExtensionImageType = "AzureRmVMExtensionImageType";
|
||||
public const string VirtualMachineChefExtension = "AzureRmVMChefExtension";
|
||||
|
||||
public const string AvailabilitySet = "AzureRmAvailabilitySet";
|
||||
public const string VirtualMachineConfig = "AzureRmVMConfig";
|
||||
public const string VirtualMachinePlan = "AzureRmVMPlan";
|
||||
|
||||
public const string VirtualMachineSize = "AzureRmVMSize";
|
||||
|
||||
public const string VirtualMachineImage = "AzureRmVMImage";
|
||||
public const string VirtualMachineImagePublisher = "AzureRmVMImagePublisher";
|
||||
public const string VirtualMachineImageOffer = "AzureRmVMImageOffer";
|
||||
public const string VirtualMachineImageSku = "AzureRmVMImageSku";
|
||||
public const string VirtualMachineImageVersion = "AzureRmVMImageVersion";
|
||||
|
||||
public const string VirtualMachineUsage = "AzureRmVMUsage";
|
||||
|
||||
public const string SshPublicKey = "AzureRmVMSshPublicKey";
|
||||
public const string AdditionalUnattendContent = "AzureRmVMAdditionalUnattendContent";
|
||||
public const string VaultSecretGroup = "AzureRmVMSecret";
|
||||
public const string RemoteDesktopFile = "AzureRmRemoteDesktopFile";
|
||||
|
||||
//DSC
|
||||
public const string VirtualMachineDscExtension = "AzureRmVMDscExtension";
|
||||
public const string VirtualMachineDscConfiguration = "AzureRmVMDscConfiguration";
|
||||
public const string VirtualMachineDscExtensionStatus = "AzureRmVMDscExtensionStatus";
|
||||
public const string Vhd = "AzureRmVhd";
|
||||
|
||||
// Sql Server
|
||||
public const string VirtualMachineSqlServerExtension = "AzureRmVMSqlServerExtension";
|
||||
|
||||
//AzureDiskEncryption
|
||||
public const string AzureDiskEncryptionExtension = "AzureRmVMDiskEncryptionExtension";
|
||||
public const string AzureDiskEncryptionStatus = "AzureRmVMDiskEncryptionStatus";
|
||||
|
||||
//AzureVMBackup
|
||||
public const string AzureVMBackup = "AzureRmVMBackup";
|
||||
public const string AzureVMBackupExtension = "AzureRmVMBackupExtension";
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,404 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
|
||||
using Microsoft.Azure.Commands.Management.Storage.Models;
|
||||
using Microsoft.Azure.Commands.Common.Authentication.Models;
|
||||
using Microsoft.Azure.Management.Storage;
|
||||
using Microsoft.Azure.Management.Storage.Models;
|
||||
using Microsoft.WindowsAzure.Commands.Common.Storage;
|
||||
using Microsoft.WindowsAzure.Commands.Utilities.Common;
|
||||
using Microsoft.WindowsAzure.Storage;
|
||||
using Microsoft.WindowsAzure.Storage.Auth;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Common
|
||||
{
|
||||
public static class DiagnosticsHelper
|
||||
{
|
||||
private static string XmlNamespace = "http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration";
|
||||
private static string EncodedXmlCfg = "xmlCfg";
|
||||
private static string WadCfg = "WadCfg";
|
||||
private static string StorageAccount = "storageAccount";
|
||||
private static string Path = "path";
|
||||
private static string ExpandResourceDirectory = "expandResourceDirectory";
|
||||
private static string LocalResourceDirectory = "localResourceDirectory";
|
||||
private static string StorageAccountNameTag = "storageAccountName";
|
||||
private static string StorageAccountKeyTag = "storageAccountKey";
|
||||
private static string StorageAccountEndPointTag = "storageAccountEndPoint";
|
||||
|
||||
public static string DiagnosticsConfigurationElemStr = "DiagnosticsConfiguration";
|
||||
public static string PublicConfigElemStr = "PublicConfig";
|
||||
public static string PrivateConfigElemStr = "PrivateConfig";
|
||||
public static string StorageAccountElemStr = "StorageAccount";
|
||||
public static string PrivConfNameAttr = "name";
|
||||
public static string PrivConfKeyAttr = "key";
|
||||
public static string PrivConfEndpointAttr = "endpoint";
|
||||
|
||||
public enum ConfigFileType
|
||||
{
|
||||
Unknown,
|
||||
Json,
|
||||
Xml
|
||||
}
|
||||
|
||||
public static ConfigFileType GetConfigFileType(string configurationPath)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(configurationPath))
|
||||
{
|
||||
try
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(configurationPath);
|
||||
return ConfigFileType.Xml;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
try
|
||||
{
|
||||
JsonConvert.DeserializeObject(File.ReadAllText(configurationPath));
|
||||
return ConfigFileType.Json;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
|
||||
return ConfigFileType.Unknown;
|
||||
}
|
||||
|
||||
public static Hashtable GetPublicDiagnosticsConfigurationFromFile(string configurationPath,
|
||||
string storageAccountName)
|
||||
{
|
||||
switch (GetConfigFileType(configurationPath))
|
||||
{
|
||||
case ConfigFileType.Xml:
|
||||
return GetPublicConfigFromXmlFile(configurationPath, storageAccountName);
|
||||
case ConfigFileType.Json:
|
||||
return GetPublicConfigFromJsonFile(configurationPath, storageAccountName);
|
||||
default:
|
||||
throw new ArgumentException(Properties.Resources.DiagnosticsExtensionInvalidConfigFileFormat);
|
||||
}
|
||||
}
|
||||
|
||||
private static Hashtable GetPublicConfigFromXmlFile(string configurationPath, string storageAccountName)
|
||||
{
|
||||
var config = File.ReadAllText(configurationPath);
|
||||
|
||||
// find the <WadCfg> element and extract it
|
||||
int wadCfgBeginIndex = config.IndexOf("<WadCfg>");
|
||||
if (wadCfgBeginIndex == -1)
|
||||
{
|
||||
throw new ArgumentException(Properties.Resources.DiagnosticsExtensionXmlConfigNoWadCfgStartTag);
|
||||
}
|
||||
|
||||
int wadCfgEndIndex = config.IndexOf("</WadCfg>");
|
||||
if (wadCfgEndIndex == -1)
|
||||
{
|
||||
throw new ArgumentException(Properties.Resources.DiagnosticsExtensionXmlConfigNoWadCfgEndTag);
|
||||
}
|
||||
|
||||
if (wadCfgEndIndex <= wadCfgBeginIndex)
|
||||
{
|
||||
throw new ArgumentException(Properties.Resources.DiagnosticsExtensionXmlConfigWadCfgTagNotMatch);
|
||||
}
|
||||
|
||||
string encodedConfiguration = Convert.ToBase64String(
|
||||
Encoding.UTF8.GetBytes(
|
||||
config.Substring(
|
||||
wadCfgBeginIndex, wadCfgEndIndex + "</WadCfg>".Length - wadCfgBeginIndex).ToCharArray()));
|
||||
|
||||
// Now extract the local resource directory element
|
||||
XmlDocument doc = new XmlDocument();
|
||||
XmlNamespaceManager ns = new XmlNamespaceManager(doc.NameTable);
|
||||
ns.AddNamespace("ns", XmlNamespace);
|
||||
doc.LoadXml(config);
|
||||
var node = doc.SelectSingleNode("//ns:LocalResourceDirectory", ns);
|
||||
string localDirectory = (node != null && node.Attributes != null) ? node.Attributes[Path].Value : null;
|
||||
string localDirectoryExpand = (node != null && node.Attributes != null)
|
||||
? node.Attributes["expandEnvironment"].Value
|
||||
: null;
|
||||
if (localDirectoryExpand == "0")
|
||||
{
|
||||
localDirectoryExpand = "false";
|
||||
}
|
||||
if (localDirectoryExpand == "1")
|
||||
{
|
||||
localDirectoryExpand = "true";
|
||||
}
|
||||
|
||||
var hashTable = new Hashtable();
|
||||
hashTable.Add(EncodedXmlCfg, encodedConfiguration);
|
||||
hashTable.Add(StorageAccount, storageAccountName);
|
||||
if (!string.IsNullOrEmpty(localDirectory))
|
||||
{
|
||||
var localDirectoryHashTable = new Hashtable();
|
||||
localDirectoryHashTable.Add(Path, localDirectory);
|
||||
localDirectoryHashTable.Add(ExpandResourceDirectory, localDirectoryExpand);
|
||||
hashTable.Add(LocalResourceDirectory, localDirectoryHashTable);
|
||||
}
|
||||
|
||||
return hashTable;
|
||||
}
|
||||
|
||||
private static Hashtable GetPublicConfigFromJsonFile(string configurationPath, string storageAccountName)
|
||||
{
|
||||
var publicConfig = GetPublicConfigJObjectFromJsonFile(configurationPath);
|
||||
var properties = publicConfig.Properties().Select(p => p.Name);
|
||||
var wadCfgProperty = properties.FirstOrDefault(p => p.Equals(WadCfg, StringComparison.OrdinalIgnoreCase));
|
||||
var xmlCfgProperty = properties.FirstOrDefault(p => p.Equals(EncodedXmlCfg, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
var hashTable = new Hashtable();
|
||||
hashTable.Add(StorageAccount, storageAccountName);
|
||||
|
||||
if (wadCfgProperty != null)
|
||||
{
|
||||
hashTable.Add(wadCfgProperty, publicConfig[wadCfgProperty]);
|
||||
}
|
||||
else if (xmlCfgProperty != null)
|
||||
{
|
||||
hashTable.Add(xmlCfgProperty, publicConfig[xmlCfgProperty]);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException(Properties.Resources.DiagnosticsExtensionConfigNoWadCfgOrXmlCfg);
|
||||
}
|
||||
|
||||
return hashTable;
|
||||
}
|
||||
|
||||
public static Hashtable GetPrivateDiagnosticsConfiguration(string storageAccountName,
|
||||
string storageKey, string endpoint)
|
||||
{
|
||||
var privateConfig = new Hashtable();
|
||||
privateConfig.Add(StorageAccountNameTag, storageAccountName);
|
||||
privateConfig.Add(StorageAccountKeyTag, storageKey);
|
||||
privateConfig.Add(StorageAccountEndPointTag, endpoint);
|
||||
|
||||
return privateConfig;
|
||||
}
|
||||
|
||||
public static XElement GetPublicConfigXElementFromXmlFile(string configurationPath)
|
||||
{
|
||||
XElement publicConfig = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(configurationPath))
|
||||
{
|
||||
var xmlConfig = XElement.Load(configurationPath);
|
||||
|
||||
if (xmlConfig.Name.LocalName == PublicConfigElemStr)
|
||||
{
|
||||
// The passed in config file is public config
|
||||
publicConfig = xmlConfig;
|
||||
}
|
||||
else if (xmlConfig.Name.LocalName == DiagnosticsConfigurationElemStr)
|
||||
{
|
||||
// The passed in config file is .wadcfgx file
|
||||
publicConfig = xmlConfig.Elements().FirstOrDefault(ele => ele.Name.LocalName == PublicConfigElemStr);
|
||||
}
|
||||
}
|
||||
|
||||
return publicConfig;
|
||||
}
|
||||
|
||||
public static JObject GetPublicConfigJObjectFromJsonFile(string configurationPath)
|
||||
{
|
||||
var config = JsonConvert.DeserializeObject<JObject>(File.ReadAllText(configurationPath));
|
||||
var properties = config.Properties().Select(p => p.Name);
|
||||
|
||||
// If the json config has the public config as a property, we extract it. Otherwise, the root object is the public config.
|
||||
var publicConfigProperty = properties.FirstOrDefault(p => p.Equals(PublicConfigElemStr, StringComparison.OrdinalIgnoreCase));
|
||||
var publicConfig = publicConfigProperty == null ? config : config[publicConfigProperty] as JObject;
|
||||
|
||||
return publicConfig;
|
||||
}
|
||||
|
||||
public static string GetStorageAccountInfoFromPrivateConfig(string configurationPath, string attributeName)
|
||||
{
|
||||
string value = null;
|
||||
var configFileType = GetConfigFileType(configurationPath);
|
||||
|
||||
if (configFileType == ConfigFileType.Xml)
|
||||
{
|
||||
var xmlConfig = XElement.Load(configurationPath);
|
||||
|
||||
if (xmlConfig.Name.LocalName == DiagnosticsConfigurationElemStr)
|
||||
{
|
||||
var privateConfigElem = xmlConfig.Elements().FirstOrDefault(ele => ele.Name.LocalName == PrivateConfigElemStr);
|
||||
var storageAccountElem = privateConfigElem == null ? null : privateConfigElem.Elements().FirstOrDefault(ele => ele.Name.LocalName == StorageAccountElemStr);
|
||||
var attribute = storageAccountElem == null ? null : storageAccountElem.Attributes().FirstOrDefault(a => string.Equals(a.Name.LocalName, attributeName));
|
||||
value = attribute == null ? null : attribute.Value;
|
||||
}
|
||||
}
|
||||
else if (configFileType == ConfigFileType.Json)
|
||||
{
|
||||
var jsonConfig = JsonConvert.DeserializeObject<JObject>(File.ReadAllText(configurationPath));
|
||||
var properties = jsonConfig.Properties().Select(p => p.Name);
|
||||
|
||||
var privateConfigProperty = properties.FirstOrDefault(p => p.Equals(PrivateConfigElemStr, StringComparison.OrdinalIgnoreCase));
|
||||
if (privateConfigProperty != null)
|
||||
{
|
||||
var privateConfig = jsonConfig[privateConfigProperty] as JObject;
|
||||
properties = privateConfig.Properties().Select(p => p.Name);
|
||||
|
||||
var attributeProperty = properties.FirstOrDefault(p => p.Equals(attributeName, StringComparison.OrdinalIgnoreCase));
|
||||
value = attributeProperty == null ? null : privateConfig[attributeProperty].Value<string>();
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the storage account name if it's not specified.
|
||||
/// It can be defined in multiple places, we only take the one with higher precedence. And the precedence is:
|
||||
/// 1. The one get from StorageContext parameter
|
||||
/// 2. The one parsed from the diagnostics configuration file
|
||||
/// </summary>
|
||||
public static string InitializeStorageAccountName(IStorageContext storageContext = null, string configurationPath = null)
|
||||
{
|
||||
string storageAccountName = null;
|
||||
var configFileType = GetConfigFileType(configurationPath);
|
||||
|
||||
if (storageContext != null)
|
||||
{
|
||||
storageAccountName = storageContext.StorageAccountName;
|
||||
}
|
||||
else if (configFileType == ConfigFileType.Xml)
|
||||
{
|
||||
var publicConfig = GetPublicConfigXElementFromXmlFile(configurationPath);
|
||||
var storageNode = publicConfig == null ? null : publicConfig.Elements().FirstOrDefault(ele => ele.Name.LocalName == StorageAccountElemStr);
|
||||
storageAccountName = storageNode == null ? null : storageNode.Value;
|
||||
}
|
||||
else if (configFileType == ConfigFileType.Json)
|
||||
{
|
||||
var publicConfig = GetPublicConfigJObjectFromJsonFile(configurationPath);
|
||||
var properties = publicConfig.Properties().Select(p => p.Name);
|
||||
var storageAccountProperty = properties.FirstOrDefault(p => p.Equals(StorageAccount, StringComparison.OrdinalIgnoreCase));
|
||||
storageAccountName = storageAccountProperty == null ? null : publicConfig[storageAccountProperty].Value<string>();
|
||||
}
|
||||
|
||||
return storageAccountName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the storage account key if it's not specified.
|
||||
/// It can be defined in multiple places, we only take the one with higher precedence. And the precedence is:
|
||||
/// 1. The one we try to resolve within current subscription
|
||||
/// 2. The one defined in PrivateConfig in the configuration file
|
||||
/// </summary>
|
||||
public static string InitializeStorageAccountKey(IStorageManagementClient storageClient, string storageAccountName = null, string configurationPath = null)
|
||||
{
|
||||
string storageAccountKey = null;
|
||||
StorageAccount storageAccount = null;
|
||||
|
||||
if (TryGetStorageAccount(storageClient, storageAccountName, out storageAccount))
|
||||
{
|
||||
// Help user retrieve the storage account key
|
||||
var psStorageAccount = new PSStorageAccount(storageAccount);
|
||||
var credentials = StorageUtilities.GenerateStorageCredentials(storageClient, psStorageAccount.ResourceGroupName, psStorageAccount.StorageAccountName);
|
||||
storageAccountKey = credentials.ExportBase64EncodedKey();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use the one defined in PrivateConfig
|
||||
storageAccountKey = GetStorageAccountInfoFromPrivateConfig(configurationPath, PrivConfKeyAttr);
|
||||
}
|
||||
|
||||
return storageAccountKey;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the storage account endpoint if it's not specified.
|
||||
/// We can get the value from multiple places, we only take the one with higher precedence. And the precedence is:
|
||||
/// 1. The one get from StorageContext parameter
|
||||
/// 2. The one get from the storage account
|
||||
/// 3. The one get from PrivateConfig element in config file
|
||||
/// 4. The one get from current Azure Environment
|
||||
/// </summary>
|
||||
public static string InitializeStorageAccountEndpoint(string storageAccountName, string storageAccountKey, IStorageManagementClient storageClient,
|
||||
IStorageContext storageContext = null, string configurationPath = null, IAzureContext defaultContext = null)
|
||||
{
|
||||
string storageAccountEndpoint = null;
|
||||
StorageAccount storageAccount = null;
|
||||
|
||||
if (storageContext != null)
|
||||
{
|
||||
// Get value from StorageContext
|
||||
storageAccountEndpoint = GetEndpointFromStorageContext(storageContext);
|
||||
}
|
||||
else if (TryGetStorageAccount(storageClient, storageAccountName, out storageAccount))
|
||||
{
|
||||
// Get value from StorageAccount
|
||||
var endpoints = storageAccount.PrimaryEndpoints;
|
||||
var context = CreateStorageContext(endpoints.Blob, endpoints.Queue, endpoints.Table, endpoints.File, storageAccountName, storageAccountKey);
|
||||
storageAccountEndpoint = GetEndpointFromStorageContext(context);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(
|
||||
storageAccountEndpoint = GetStorageAccountInfoFromPrivateConfig(configurationPath, PrivConfEndpointAttr)))
|
||||
{
|
||||
// We can get the value from PrivateConfig
|
||||
}
|
||||
else if (defaultContext != null && defaultContext.Environment != null)
|
||||
{
|
||||
// Get value from default azure environment. Default to use https
|
||||
Uri blobEndpoint = defaultContext.Environment.GetStorageBlobEndpoint(storageAccountName);
|
||||
Uri queueEndpoint = defaultContext.Environment.GetStorageQueueEndpoint(storageAccountName);
|
||||
Uri tableEndpoint = defaultContext.Environment.GetStorageTableEndpoint(storageAccountName);
|
||||
Uri fileEndpoint = defaultContext.Environment.GetStorageFileEndpoint(storageAccountName);
|
||||
var context = CreateStorageContext(blobEndpoint, queueEndpoint, tableEndpoint, fileEndpoint, storageAccountName, storageAccountKey);
|
||||
storageAccountEndpoint = GetEndpointFromStorageContext(context);
|
||||
}
|
||||
|
||||
return storageAccountEndpoint;
|
||||
}
|
||||
|
||||
private static bool TryGetStorageAccount(IStorageManagementClient storageClient, string storageAccountName, out StorageAccount storageAccount)
|
||||
{
|
||||
try
|
||||
{
|
||||
var storageAccounts = storageClient.StorageAccounts.List().StorageAccounts;
|
||||
storageAccount = storageAccounts == null ? null : storageAccounts.FirstOrDefault(account => account.Name.Equals(storageAccountName));
|
||||
}
|
||||
catch
|
||||
{
|
||||
storageAccount = null;
|
||||
}
|
||||
|
||||
return storageAccount != null;
|
||||
}
|
||||
|
||||
private static AzureStorageContext CreateStorageContext(Uri blobEndpoint, Uri queueEndpoint, Uri tableEndpoint, Uri fileEndpoint,
|
||||
string storageAccountName, string storageAccountKey)
|
||||
{
|
||||
var credentials = new StorageCredentials(storageAccountName, storageAccountKey);
|
||||
var cloudStorageAccount = new CloudStorageAccount(credentials, blobEndpoint, queueEndpoint, tableEndpoint, fileEndpoint);
|
||||
return new AzureStorageContext(cloudStorageAccount);
|
||||
}
|
||||
|
||||
private static string GetEndpointFromStorageContext(IStorageContext context)
|
||||
{
|
||||
var scheme = context.BlobEndPoint.StartsWith("https://", StringComparison.OrdinalIgnoreCase) ? "https://" : "http://";
|
||||
return scheme + context.EndPointSuffix;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Microsoft.Azure.Commands.ResourceManager.Common.Tags;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Common
|
||||
{
|
||||
public static class HashTableExtensions
|
||||
{
|
||||
public static Dictionary<string, string> ToDictionary(this Hashtable tags)
|
||||
{
|
||||
return TagsConversionHelper.CreateTagDictionary(tags, true);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Common
|
||||
{
|
||||
public static class LocationStringExtensions
|
||||
{
|
||||
public static string Canonicalize(this string location)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(location))
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (char ch in location)
|
||||
{
|
||||
if (!char.IsWhiteSpace(ch))
|
||||
{
|
||||
sb.Append(ch);
|
||||
}
|
||||
}
|
||||
|
||||
location = sb.ToString().ToLower();
|
||||
}
|
||||
|
||||
return location;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Microsoft.Azure.Commands.Common.Authentication;
|
||||
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
|
||||
using Microsoft.Azure.Commands.Common.Authentication.Models;
|
||||
using Microsoft.Azure.Management.Storage;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Management.Storage
|
||||
{
|
||||
public partial class StorageManagementClientWrapper
|
||||
{
|
||||
public IStorageManagementClient StorageManagementClient { get; set; }
|
||||
|
||||
public Action<string> VerboseLogger { get; set; }
|
||||
|
||||
public Action<string> ErrorLogger { get; set; }
|
||||
|
||||
public StorageManagementClientWrapper(IAzureContext context)
|
||||
: this(AzureSession.Instance.ClientFactory.CreateArmClient<StorageManagementClient>(context, AzureEnvironment.Endpoint.ResourceManager))
|
||||
{
|
||||
}
|
||||
|
||||
public StorageManagementClientWrapper(IStorageManagementClient resourceManagementClient)
|
||||
{
|
||||
StorageManagementClient = resourceManagementClient;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System.Security;
|
||||
using Microsoft.Azure.Commands.Compute.Models;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Extension.AzureDiskEncryption
|
||||
{
|
||||
/// <summary>
|
||||
/// This class represents the extension context of AzureDiskEncryption VM extension. This is returned as an output of Get-AzureDiskEncryption cmdlet
|
||||
/// </summary>
|
||||
public class AzureDiskEncryptionExtensionContext : PSVirtualMachineExtension
|
||||
{
|
||||
public const string LinuxExtensionDefaultPublisher = "Microsoft.OSTCExtensions";
|
||||
public const string LinuxExtensionDefaultName = "AzureDiskEncryptionForLinux";
|
||||
public const string LinuxExtensionDefaultVersion = "0.1";
|
||||
|
||||
public const string ExtensionDefaultPublisher = "Microsoft.Azure.Security";
|
||||
public const string ExtensionDefaultName = "AzureDiskEncryption";
|
||||
public const string ExtensionDefaultVersion = "1.0";
|
||||
public const string VolumeTypeOS = "OS";
|
||||
public const string VolumeTypeData = "Data";
|
||||
public const string VolumeTypeAll = "All";
|
||||
public const string StatusSucceeded = "Succeeded";
|
||||
|
||||
// Extension configuration
|
||||
public string AadClientID { get; set; }
|
||||
public SecureString AadClientSecret { get; set; }
|
||||
public string KeyVaultURL { get; set; }
|
||||
public string KeyEncryptionKeyURL { get; set; }
|
||||
public string KeyEncryptionAlgorithm { get; set; }
|
||||
public string VolumeType { get; set; }
|
||||
public string AadClientCertThumbprint { get; set; }
|
||||
public string SequenceVersion { get; set; }
|
||||
public SecureString Passphrase { get; set; }
|
||||
|
||||
private static SecureString ConvertStringToSecureString(string str)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(str))
|
||||
return null;
|
||||
SecureString secStr = new SecureString();
|
||||
foreach (char ch in str.ToCharArray())
|
||||
{
|
||||
secStr.AppendChar(ch);
|
||||
}
|
||||
|
||||
return secStr;
|
||||
}
|
||||
|
||||
private void InitializeAzureDiskEncryptionMembers(PSVirtualMachineExtension psExt)
|
||||
{
|
||||
AzureDiskEncryptionExtensionPublicSettings publicSettings = string.IsNullOrEmpty(psExt.PublicSettings) ? null
|
||||
: JsonConvert.DeserializeObject<AzureDiskEncryptionExtensionPublicSettings>(psExt.PublicSettings);
|
||||
|
||||
AzureDiskEncryptionExtensionProtectedSettings protectedSettings = string.IsNullOrEmpty(psExt.ProtectedSettings) ? null
|
||||
: JsonConvert.DeserializeObject<AzureDiskEncryptionExtensionProtectedSettings>(psExt.ProtectedSettings);
|
||||
|
||||
AadClientID = (publicSettings == null) ? null : publicSettings.AadClientID;
|
||||
KeyVaultURL = (publicSettings == null) ? null : publicSettings.KeyVaultURL;
|
||||
KeyEncryptionKeyURL = (publicSettings == null) ? null : publicSettings.KeyEncryptionKeyURL;
|
||||
KeyEncryptionAlgorithm = (publicSettings == null) ? null : publicSettings.KeyEncryptionAlgorithm;
|
||||
VolumeType = (publicSettings == null) ? null : publicSettings.VolumeType;
|
||||
AadClientCertThumbprint = (publicSettings == null) ? null : publicSettings.AadClientCertThumbprint;
|
||||
SequenceVersion = (publicSettings == null) ? null : publicSettings.SequenceVersion;
|
||||
AadClientSecret = (protectedSettings == null) ? null : ConvertStringToSecureString(protectedSettings.AadClientSecret);
|
||||
Passphrase = (protectedSettings == null) ? null : ConvertStringToSecureString(protectedSettings.Passphrase);
|
||||
}
|
||||
|
||||
public AzureDiskEncryptionExtensionContext(PSVirtualMachineExtension psExt)
|
||||
{
|
||||
ResourceGroupName = psExt.ResourceGroupName;
|
||||
Name = psExt.Name;
|
||||
Location = psExt.Location;
|
||||
Etag = psExt.Etag;
|
||||
Publisher = psExt.Publisher;
|
||||
ExtensionType = psExt.ExtensionType;
|
||||
TypeHandlerVersion = psExt.TypeHandlerVersion;
|
||||
Id = psExt.Id;
|
||||
PublicSettings = psExt.PublicSettings;
|
||||
ProtectedSettings = psExt.ProtectedSettings;
|
||||
ProvisioningState = psExt.ProvisioningState;
|
||||
Statuses = psExt.Statuses;
|
||||
|
||||
InitializeAzureDiskEncryptionMembers(psExt);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Extension.AzureDiskEncryption
|
||||
{
|
||||
class AzureDiskEncryptionExtensionProtectedSettings
|
||||
{
|
||||
public string AadClientSecret { get; set; }
|
||||
public string Passphrase { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Extension.AzureDiskEncryption
|
||||
{
|
||||
public class AzureDiskEncryptionExtensionPublicSettings
|
||||
{
|
||||
public string AadClientID { get; set; }
|
||||
public string KeyVaultURL { get; set; }
|
||||
public string KeyEncryptionKeyURL { get; set; }
|
||||
public string KeyEncryptionAlgorithm { get; set; }
|
||||
public string VolumeType { get; set; }
|
||||
public string AadClientCertThumbprint { get; set; }
|
||||
public string SequenceVersion { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Microsoft.Azure.Commands.Compute.Common;
|
||||
using Microsoft.Azure.Management.Compute;
|
||||
using Microsoft.Azure.Management.Compute.Models;
|
||||
using System.Management.Automation;
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using Microsoft.Azure.Commands.Compute.Models;
|
||||
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Extension.AzureDiskEncryption
|
||||
{
|
||||
[Cmdlet(
|
||||
VerbsCommon.Remove,
|
||||
ProfileNouns.AzureDiskEncryptionExtension)]
|
||||
[OutputType(typeof(PSAzureOperationResponse))]
|
||||
public class RemoveAzureDiskEncryptionExtensionCommand : VirtualMachineExtensionBaseCmdlet
|
||||
{
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 0,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The resource group name.")]
|
||||
[ResourceGroupCompleter()]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string ResourceGroupName { get; set; }
|
||||
|
||||
[Alias("ResourceName")]
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 1,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The virtual machine name.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string VMName { get; set; }
|
||||
|
||||
[Alias("ExtensionName")]
|
||||
[Parameter(
|
||||
Mandatory = false,
|
||||
Position = 2,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The extension name. If this parameter is not specified, default values used are AzureDiskEncryption for windows VMs and AzureDiskEncryptionForLinux for Linux VMs")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Parameter(HelpMessage = "To force the removal.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public SwitchParameter Force { get; set; }
|
||||
|
||||
public override void ExecuteCmdlet()
|
||||
{
|
||||
base.ExecuteCmdlet();
|
||||
|
||||
ExecuteClientAction(() =>
|
||||
{
|
||||
VirtualMachine virtualMachineResponse = (this.ComputeClient.ComputeManagementClient.VirtualMachines.Get(this.ResourceGroupName, this.VMName));
|
||||
|
||||
var currentOSType = virtualMachineResponse.StorageProfile.OsDisk.OsType;
|
||||
if (OperatingSystemTypes.Windows.Equals(currentOSType))
|
||||
{
|
||||
this.Name = this.Name ?? AzureDiskEncryptionExtensionContext.ExtensionDefaultName;
|
||||
}
|
||||
else if (OperatingSystemTypes.Linux.Equals(currentOSType))
|
||||
{
|
||||
this.Name = this.Name ?? AzureDiskEncryptionExtensionContext.LinuxExtensionDefaultName;
|
||||
}
|
||||
|
||||
if (this.Force.IsPresent
|
||||
|| this.ShouldContinue(Properties.Resources.VirtualMachineExtensionRemovalConfirmation, Properties.Resources.VirtualMachineExtensionRemovalCaption))
|
||||
{
|
||||
var op = this.VirtualMachineExtensionClient.DeleteWithHttpMessagesAsync(
|
||||
this.ResourceGroupName,
|
||||
this.VMName,
|
||||
this.Name).GetAwaiter().GetResult();
|
||||
var result = Mapper.Map<PSAzureOperationResponse>(op);
|
||||
WriteObject(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
|
||||
Param(
|
||||
[Parameter(Mandatory = $true,
|
||||
HelpMessage="Name of the resource group to which the KeyVault belongs to. A new resource group with this name will be created if one doesn't exist")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$resourceGroupName,
|
||||
|
||||
[Parameter(Mandatory = $true,
|
||||
HelpMessage="Name of the KeyVault in which encryption keys are to be placed. A new vault with this name will be created if one doesn't exist")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$keyVaultName,
|
||||
|
||||
[Parameter(Mandatory = $true,
|
||||
HelpMessage="Location of the KeyVault. Important note: Make sure the KeyVault and VMs to be encrypted are in the same region / location.")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$location,
|
||||
|
||||
[Parameter(Mandatory = $true,
|
||||
HelpMessage="Name of the AAD application that will be used to write secrets to KeyVault. A new application with this name will be created if one doesn't exist. If this app already exists, pass aadClientSecret parameter to the script")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$aadAppName,
|
||||
|
||||
[Parameter(Mandatory = $false,
|
||||
HelpMessage="Client secret of the AAD application that was created earlier")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$aadClientSecret,
|
||||
|
||||
[Parameter(Mandatory = $false,
|
||||
HelpMessage="Identifier of the Azure subscription to be used. Default subscription will be used if not specified.")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$subscriptionId,
|
||||
|
||||
[Parameter(Mandatory = $false,
|
||||
HelpMessage="Name of optional key encryption key in KeyVault. A new key with this name will be created if one doesn't exist")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$keyEncryptionKeyName
|
||||
|
||||
)
|
||||
|
||||
########################################################################################################################
|
||||
# Section1: Log-in to Azure and select appropriate subscription.
|
||||
########################################################################################################################
|
||||
|
||||
|
||||
Write-Host 'Please log into Azure now' -foregroundcolor Green;
|
||||
Connect-AzureRmAccount -ErrorAction "Stop" 1> $null;
|
||||
|
||||
if($subscriptionId)
|
||||
{
|
||||
Select-AzureRmSubscription -SubscriptionId $subscriptionId;
|
||||
}
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
# Section2: Create AAD app . Fill in $aadClientSecret variable if AAD app was already created
|
||||
########################################################################################################################
|
||||
|
||||
|
||||
# Check if AAD app with $aadAppName was already created
|
||||
$SvcPrincipals = (Get-AzureRmADServicePrincipal -SearchString $aadAppName);
|
||||
if(-not $SvcPrincipals)
|
||||
{
|
||||
# Create a new AD application if not created before
|
||||
$identifierUri = [string]::Format("http://localhost:8080/{0}",[Guid]::NewGuid().ToString("N"));
|
||||
$defaultHomePage = 'http://contoso.com';
|
||||
$now = [System.DateTime]::Now;
|
||||
$oneYearFromNow = $now.AddYears(1);
|
||||
$aadClientSecret = [Guid]::NewGuid();
|
||||
|
||||
Write-Host "Creating new AAD application ($aadAppName)";
|
||||
$ADApp = New-AzureRmADApplication -DisplayName $aadAppName -HomePage $defaultHomePage -IdentifierUris $identifierUri -StartDate $now -EndDate $oneYearFromNow -Password $aadClientSecret;
|
||||
$servicePrincipal = New-AzureRmADServicePrincipal -ApplicationId $ADApp.ApplicationId;
|
||||
$SvcPrincipals = (Get-AzureRmADServicePrincipal -SearchString $aadAppName);
|
||||
if(-not $SvcPrincipals)
|
||||
{
|
||||
# AAD app wasn't created
|
||||
Write-Error "Failed to create AAD app $aadAppName. Please log-in to Azure using Connect-AzureRmAccount and try again";
|
||||
return;
|
||||
}
|
||||
$aadClientID = $servicePrincipal.ApplicationId;
|
||||
Write-Host "Created a new AAD Application ($aadAppName) with ID: $aadClientID ";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(-not $aadClientSecret)
|
||||
{
|
||||
Write-Error "Aad application ($aadAppName) was alerady created. Re-run the script by supplying aadClientSecret parameter with corresponding secret from https://manage.windowsazure.com portal";
|
||||
return;
|
||||
}
|
||||
$aadClientID = $SvcPrincipals[0].ApplicationId;
|
||||
}
|
||||
|
||||
# Before proceeding to Section3, make sure $aadClientID and $aadClientSecret have valid values
|
||||
########################################################################################################################
|
||||
# Section3: Create KeyVault or setup existing keyVault
|
||||
########################################################################################################################
|
||||
|
||||
Try
|
||||
{
|
||||
$resGroup = Get-AzureRmResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinue;
|
||||
}
|
||||
Catch [System.ArgumentException]
|
||||
{
|
||||
Write-Host "Couldn't find resource group: ($resourceGroupName)";
|
||||
$resGroup = $null;
|
||||
}
|
||||
|
||||
#Create a new resource group if it doesn't exist
|
||||
if (-not $resGroup)
|
||||
{
|
||||
Write-Host "Creating new resource group: ($resourceGroupName)";
|
||||
$resGroup = New-AzureRmResourceGroup -Name $resourceGroupName -Location $location;
|
||||
Write-Host "Created a new resource group named $resourceGroupName to place keyVault";
|
||||
}
|
||||
|
||||
Try
|
||||
{
|
||||
$keyVault = Get-AzureRmKeyVault -VaultName $keyVaultName -ErrorAction SilentlyContinue;
|
||||
}
|
||||
Catch [System.ArgumentException]
|
||||
{
|
||||
Write-Host "Couldn't find Key Vault: $keyVaultName";
|
||||
$keyVault = $null;
|
||||
}
|
||||
|
||||
#Create a new vault if vault doesn't exist
|
||||
if (-not $keyVault)
|
||||
{
|
||||
Write-Host "Creating new key vault: ($keyVaultName)";
|
||||
$keyVault = New-AzureRmKeyVault -VaultName $keyVaultName -ResourceGroupName $resourceGroupName -Sku Standard -Location $location;
|
||||
Write-Host "Created a new KeyVault named $keyVaultName to store encryption keys";
|
||||
}
|
||||
# Specify full privileges to the vault for the AAD application
|
||||
Set-AzureRmKeyVaultAccessPolicy -VaultName $keyVaultName -ServicePrincipalName $aadClientID -PermissionsToKeys all -PermissionsToSecrets all;
|
||||
|
||||
Set-AzureRmKeyVaultAccessPolicy -VaultName $keyVaultName -EnabledForDiskEncryption;
|
||||
|
||||
$diskEncryptionKeyVaultUrl = $keyVault.VaultUri;
|
||||
$keyVaultResourceId = $keyVault.ResourceId;
|
||||
|
||||
if($keyEncryptionKeyName)
|
||||
{
|
||||
Try
|
||||
{
|
||||
$kek = Get-AzureKeyVaultKey -VaultName $keyVaultName -Name $keyEncryptionKeyName -ErrorAction SilentlyContinue;
|
||||
}
|
||||
Catch [Microsoft.Azure.KeyVault.KeyVaultClientException]
|
||||
{
|
||||
Write-Host "Couldn't find key encryption key named : $keyEncryptionKeyName in Key Vault: $keyVaultName";
|
||||
$kek = $null;
|
||||
}
|
||||
|
||||
if(-not $kek)
|
||||
{
|
||||
Write-Host "Creating new key encryption key named:$keyEncryptionKeyName in Key Vault: $keyVaultName";
|
||||
$kek = Add-AzureKeyVaultKey -VaultName $keyVaultName -Name $keyEncryptionKeyName -Destination Software -ErrorAction SilentlyContinue;
|
||||
Write-Host "Created key encryption key named:$keyEncryptionKeyName in Key Vault: $keyVaultName";
|
||||
}
|
||||
|
||||
$keyEncryptionKeyUrl = $kek.Key.Kid;
|
||||
}
|
||||
|
||||
########################################################################################################################
|
||||
# Section3: Displays values that should be used while enabling encryption. Please note these down
|
||||
########################################################################################################################
|
||||
Write-Host "Please note down below aadClientID, aadClientSecret, diskEncryptionKeyVaultUrl, keyVaultResourceId values that will be needed to enable encryption on your VMs " -foregroundcolor Green;
|
||||
Write-Host "`t aadClientID: $aadClientID" -foregroundcolor Green;
|
||||
Write-Host "`t aadClientSecret: $aadClientSecret" -foregroundcolor Green;
|
||||
Write-Host "`t diskEncryptionKeyVaultUrl: $diskEncryptionKeyVaultUrl" -foregroundcolor Green;
|
||||
Write-Host "`t keyVaultResourceId: $keyVaultResourceId" -foregroundcolor Green;
|
||||
if($keyEncryptionKeyName)
|
||||
{
|
||||
Write-Host "`t keyEncryptionKeyURL: $keyEncryptionKeyUrl" -foregroundcolor Green;
|
||||
}
|
||||
Write-Host "Please Press [Enter] after saving values displayed above. They are needed to enable encryption using Set-AzureRmVmDiskEncryptionExtension cmdlet" -foregroundcolor Green;
|
||||
Read-Host;
|
||||
|
||||
########################################################################################################################
|
||||
# For each VM you want to encrypt, run the below cmdlet
|
||||
# $vmName = 'Name of VM to encrypt';
|
||||
# Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $resourceGroupName -VMName $vmName -AadClientID $aadClientID -AadClientSecret $aadClientSecret -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $keyVaultResourceId;
|
||||
########################################################################################################################
|
|
@ -0,0 +1,445 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using Microsoft.Azure.Commands.Compute.Common;
|
||||
using Microsoft.Azure.Commands.Compute.Models;
|
||||
using Microsoft.Azure.Management.Compute;
|
||||
using Microsoft.Azure.Management.Compute.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Management.Automation;
|
||||
using System.Globalization;
|
||||
using AutoMapper;
|
||||
using Microsoft.Azure.Commands.Compute.Extension.AzureVMBackup;
|
||||
using Microsoft.Rest.Azure;
|
||||
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Extension.AzureDiskEncryption
|
||||
{
|
||||
[Cmdlet(
|
||||
VerbsCommon.Set,
|
||||
ProfileNouns.AzureDiskEncryptionExtension,
|
||||
DefaultParameterSetName = aadClientSecretParameterSet)]
|
||||
[OutputType(typeof(PSAzureOperationResponse))]
|
||||
public class SetAzureDiskEncryptionExtensionCommand : VirtualMachineExtensionBaseCmdlet
|
||||
{
|
||||
private const string aadClientCertParameterSet = "AAD Client Cert Parameters";
|
||||
private const string aadClientSecretParameterSet = "AAD Client Secret Parameters";
|
||||
private const string enableEncryptionOperation = "EnableEncryption";
|
||||
|
||||
private const string aadClientIDKey = "AADClientID";
|
||||
private const string aadClientSecretKey = "AADClientSecret";
|
||||
private const string aadClientCertThumbprintKey = "AADClientCertThumbprint";
|
||||
private const string keyVaultUrlKey = "KeyVaultURL";
|
||||
private const string keyEncryptionKeyUrlKey = "KeyEncryptionKeyURL";
|
||||
private const string keyEncryptionAlgorithmKey = "KeyEncryptionAlgorithm";
|
||||
private const string volumeTypeKey = "VolumeType";
|
||||
private const string encryptionOperationKey = "EncryptionOperation";
|
||||
private const string sequenceVersionKey = "SequenceVersion";
|
||||
private const string passphraseKey = "Passphrase";
|
||||
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 0,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The resource group name to which the VM belongs to")]
|
||||
[ResourceGroupCompleter()]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string ResourceGroupName { get; set; }
|
||||
|
||||
[Alias("ResourceName")]
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 1,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "Name of the virtual machine")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string VMName { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 2,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "Client ID of AAD app with permissions to write secrets to KeyVault")]
|
||||
public string AadClientID { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 3,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = aadClientSecretParameterSet,
|
||||
HelpMessage = "Client Secret of AAD app with permissions to write secrets to KeyVault")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string AadClientSecret { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 3,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = aadClientCertParameterSet,
|
||||
HelpMessage = "Thumbprint of AAD app certificate with permissions to write secrets to KeyVault")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string AadClientCertThumbprint { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 4,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "URL of the KeyVault where generated encryption key will be placed to")]
|
||||
public string DiskEncryptionKeyVaultUrl { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 5,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "ResourceID of the KeyVault where generated encryption key will be placed to")]
|
||||
public string DiskEncryptionKeyVaultId { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = false,
|
||||
Position = 6,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "Versioned KeyVault URL of the KeyEncryptionKey used to encrypt the disk encryption key")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string KeyEncryptionKeyUrl { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = false,
|
||||
Position = 7,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "ResourceID of the KeyVault containing the KeyEncryptionKey used to encrypt the disk encryption key")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string KeyEncryptionKeyVaultId { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = false,
|
||||
Position = 8,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "KeyEncryption Algorithm used to encrypt the volume encryption key")]
|
||||
[ValidateSet("RSA-OAEP", "RSA1_5")]
|
||||
public string KeyEncryptionAlgorithm { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = false,
|
||||
Position = 9,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "Type of the volume (OS or Data) to perform encryption operation")]
|
||||
[ValidateSet("OS", "Data", "All")]
|
||||
public string VolumeType { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = false,
|
||||
Position = 10,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "Sequence version of encryption operation. This must be incremented to perform repeated encryption operations on the same VM")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string SequenceVersion { get; set; }
|
||||
|
||||
[Alias("HandlerVersion", "Version")]
|
||||
[Parameter(
|
||||
Mandatory = false,
|
||||
Position = 11,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The type handler version.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string TypeHandlerVersion { get; set; }
|
||||
|
||||
[Alias("ExtensionName")]
|
||||
[Parameter(
|
||||
Mandatory = false,
|
||||
Position = 12,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The extension name. If this parameter is not specified, default values used are AzureDiskEncryption for windows VMs and AzureDiskEncryptionForLinux for Linux VMs")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Parameter(
|
||||
Mandatory = false,
|
||||
Position = 13,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
HelpMessage = "The passphrase specified in parameters. This parameter only works for Linux VM.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public string Passphrase { get; set; }
|
||||
|
||||
[Parameter(HelpMessage = "To force the removal.")]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public SwitchParameter Force { get; set; }
|
||||
|
||||
private OperatingSystemTypes? currentOSType = null;
|
||||
|
||||
private void ValidateInputParameters()
|
||||
{
|
||||
if (false == Uri.IsWellFormedUriString(DiskEncryptionKeyVaultId, UriKind.Absolute))
|
||||
{
|
||||
ThrowTerminatingError(new ErrorRecord(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, "Invalid DiskEncryptionKeyVaultUrl. Please provide a valid KeyVault URI for DiskEncryptionKeyVaultUrl")),
|
||||
"InvalidArgument",
|
||||
ErrorCategory.InvalidArgument,
|
||||
null));
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(KeyEncryptionKeyUrl) == false)
|
||||
{
|
||||
if (false == Uri.IsWellFormedUriString(DiskEncryptionKeyVaultId, UriKind.Absolute))
|
||||
{
|
||||
ThrowTerminatingError(new ErrorRecord(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, "Invalid KeyEncryptionKeyUrl. Please provide a valid KeyVault URI for KeyEncryptionKeyUrl")),
|
||||
"InvalidArgument",
|
||||
ErrorCategory.InvalidArgument,
|
||||
null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string GetExtensionStatusMessage()
|
||||
{
|
||||
AzureOperationResponse<VirtualMachineExtension> extensionResult = this.VirtualMachineExtensionClient.GetWithInstanceView(this.ResourceGroupName, this.VMName, this.Name);
|
||||
if (extensionResult == null)
|
||||
{
|
||||
ThrowTerminatingError(new ErrorRecord(new ApplicationFailedException(string.Format(CultureInfo.CurrentUICulture, "Failed to retrieve extension status")),
|
||||
"InvalidResult",
|
||||
ErrorCategory.InvalidResult,
|
||||
null));
|
||||
}
|
||||
|
||||
PSVirtualMachineExtension returnedExtension = extensionResult.ToPSVirtualMachineExtension(
|
||||
this.ResourceGroupName, this.VMName);
|
||||
|
||||
if ((returnedExtension == null) ||
|
||||
(string.IsNullOrWhiteSpace(returnedExtension.Publisher)) ||
|
||||
(string.IsNullOrWhiteSpace(returnedExtension.ExtensionType)))
|
||||
{
|
||||
ThrowTerminatingError(new ErrorRecord(new ApplicationFailedException(string.Format(CultureInfo.CurrentUICulture, "Missing extension publisher and type info")),
|
||||
"InvalidResult",
|
||||
ErrorCategory.InvalidResult,
|
||||
null));
|
||||
}
|
||||
bool publisherMatch = false;
|
||||
if (OperatingSystemTypes.Linux.Equals(currentOSType))
|
||||
{
|
||||
if (returnedExtension.Publisher.Equals(AzureDiskEncryptionExtensionContext.LinuxExtensionDefaultPublisher, StringComparison.InvariantCultureIgnoreCase) &&
|
||||
returnedExtension.ExtensionType.Equals(AzureDiskEncryptionExtensionContext.LinuxExtensionDefaultName, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
publisherMatch = true;
|
||||
}
|
||||
}
|
||||
else if (OperatingSystemTypes.Windows.Equals(currentOSType))
|
||||
{
|
||||
if (returnedExtension.Publisher.Equals(AzureDiskEncryptionExtensionContext.ExtensionDefaultPublisher, StringComparison.InvariantCultureIgnoreCase) &&
|
||||
returnedExtension.ExtensionType.Equals(AzureDiskEncryptionExtensionContext.ExtensionDefaultName, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
publisherMatch = true;
|
||||
}
|
||||
}
|
||||
if (publisherMatch)
|
||||
{
|
||||
AzureDiskEncryptionExtensionContext context = new AzureDiskEncryptionExtensionContext(returnedExtension);
|
||||
if ((context == null) ||
|
||||
(context.Statuses == null) ||
|
||||
(context.Statuses.Count < 1) ||
|
||||
(string.IsNullOrWhiteSpace(context.Statuses[0].Message)))
|
||||
{
|
||||
ThrowTerminatingError(new ErrorRecord(new ApplicationFailedException(string.Format(CultureInfo.CurrentUICulture, "Invalid extension status")),
|
||||
"InvalidResult",
|
||||
ErrorCategory.InvalidResult,
|
||||
null));
|
||||
}
|
||||
return context.Statuses[0].Message;
|
||||
}
|
||||
else
|
||||
{
|
||||
ThrowTerminatingError(new ErrorRecord(new ApplicationFailedException(string.Format(CultureInfo.CurrentUICulture, "Extension publisher and type mismatched")),
|
||||
"InvalidResult",
|
||||
ErrorCategory.InvalidResult,
|
||||
null));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This function gets the VM model, fills in the OSDisk properties with encryptionSettings and does an UpdateVM
|
||||
/// </summary>
|
||||
private AzureOperationResponse<VirtualMachine> UpdateVmEncryptionSettings()
|
||||
{
|
||||
string statusMessage = GetExtensionStatusMessage();
|
||||
|
||||
var vmParameters = (this.ComputeClient.ComputeManagementClient.VirtualMachines.Get(
|
||||
this.ResourceGroupName, this.VMName));
|
||||
if ((vmParameters == null) ||
|
||||
(vmParameters.StorageProfile == null) ||
|
||||
(vmParameters.StorageProfile.OsDisk == null))
|
||||
{
|
||||
//VM should have been created and have valid storageProfile and OSDisk by now
|
||||
ThrowTerminatingError(new ErrorRecord(new ApplicationException(string.Format(CultureInfo.CurrentUICulture, "Set-AzureDiskEncryptionExtension can enable encryption only on a VM that was already created and has appropriate storageProfile and OS disk")),
|
||||
"InvalidResult",
|
||||
ErrorCategory.InvalidResult,
|
||||
null));
|
||||
}
|
||||
|
||||
DiskEncryptionSettings encryptionSettings = new DiskEncryptionSettings();
|
||||
encryptionSettings.DiskEncryptionKey = new KeyVaultSecretReference();
|
||||
encryptionSettings.DiskEncryptionKey.SourceVault = new SubResource(this.DiskEncryptionKeyVaultId);
|
||||
encryptionSettings.DiskEncryptionKey.SecretUrl = statusMessage;
|
||||
if (this.KeyEncryptionKeyUrl != null)
|
||||
{
|
||||
encryptionSettings.KeyEncryptionKey = new KeyVaultKeyReference();
|
||||
encryptionSettings.KeyEncryptionKey.SourceVault = new SubResource(this.KeyEncryptionKeyVaultId);
|
||||
encryptionSettings.KeyEncryptionKey.KeyUrl = this.KeyEncryptionKeyUrl;
|
||||
}
|
||||
vmParameters.StorageProfile.OsDisk.EncryptionSettings = encryptionSettings;
|
||||
var parameters = new VirtualMachine
|
||||
{
|
||||
DiagnosticsProfile = vmParameters.DiagnosticsProfile,
|
||||
HardwareProfile = vmParameters.HardwareProfile,
|
||||
StorageProfile = vmParameters.StorageProfile,
|
||||
NetworkProfile = vmParameters.NetworkProfile,
|
||||
OsProfile = vmParameters.OsProfile,
|
||||
Plan = vmParameters.Plan,
|
||||
AvailabilitySet = vmParameters.AvailabilitySet,
|
||||
Location = vmParameters.Location,
|
||||
Tags = vmParameters.Tags
|
||||
};
|
||||
return this.ComputeClient.ComputeManagementClient.VirtualMachines.CreateOrUpdateWithHttpMessagesAsync(
|
||||
this.ResourceGroupName,
|
||||
vmParameters.Name,
|
||||
parameters).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
private Hashtable GetExtensionPublicSettings()
|
||||
{
|
||||
Hashtable publicSettings = new Hashtable();
|
||||
publicSettings.Add(aadClientIDKey, AadClientID ?? String.Empty);
|
||||
publicSettings.Add(aadClientCertThumbprintKey, AadClientCertThumbprint ?? String.Empty);
|
||||
publicSettings.Add(keyVaultUrlKey, DiskEncryptionKeyVaultUrl ?? String.Empty);
|
||||
publicSettings.Add(keyEncryptionKeyUrlKey, KeyEncryptionKeyUrl ?? String.Empty);
|
||||
publicSettings.Add(keyEncryptionAlgorithmKey, KeyEncryptionAlgorithm ?? String.Empty);
|
||||
publicSettings.Add(volumeTypeKey, VolumeType ?? String.Empty);
|
||||
publicSettings.Add(encryptionOperationKey, enableEncryptionOperation);
|
||||
publicSettings.Add(sequenceVersionKey, SequenceVersion ?? String.Empty);
|
||||
|
||||
return publicSettings;
|
||||
}
|
||||
|
||||
private Hashtable GetExtensionProtectedSettings()
|
||||
{
|
||||
Hashtable protectedSettings = new Hashtable();
|
||||
protectedSettings.Add(aadClientSecretKey, AadClientSecret ?? String.Empty);
|
||||
if (string.Equals(this.currentOSType, "Linux"))
|
||||
{
|
||||
protectedSettings.Add(passphraseKey, Passphrase ?? null);
|
||||
}
|
||||
return protectedSettings;
|
||||
}
|
||||
|
||||
private VirtualMachineExtension GetVmExtensionParameters(VirtualMachine vmParameters)
|
||||
{
|
||||
Hashtable SettingString = GetExtensionPublicSettings();
|
||||
Hashtable ProtectedSettingString = GetExtensionProtectedSettings();
|
||||
|
||||
if (vmParameters == null)
|
||||
{
|
||||
ThrowTerminatingError(new ErrorRecord(new ApplicationException(string.Format(CultureInfo.CurrentUICulture, "Set-AzureDiskEncryptionExtension can enable encryption only on a VM that was already created ")),
|
||||
"InvalidResult",
|
||||
ErrorCategory.InvalidResult,
|
||||
null));
|
||||
}
|
||||
|
||||
VirtualMachineExtension vmExtensionParameters = null;
|
||||
if (OperatingSystemTypes.Windows.Equals(currentOSType))
|
||||
{
|
||||
this.Name = this.Name ?? AzureDiskEncryptionExtensionContext.ExtensionDefaultName;
|
||||
vmExtensionParameters = new VirtualMachineExtension
|
||||
{
|
||||
Location = vmParameters.Location,
|
||||
Publisher = AzureDiskEncryptionExtensionContext.ExtensionDefaultPublisher,
|
||||
VirtualMachineExtensionType = AzureDiskEncryptionExtensionContext.ExtensionDefaultName,
|
||||
TypeHandlerVersion = (this.TypeHandlerVersion) ?? AzureDiskEncryptionExtensionContext.ExtensionDefaultVersion,
|
||||
Settings = SettingString,
|
||||
ProtectedSettings = ProtectedSettingString,
|
||||
};
|
||||
}
|
||||
else if (OperatingSystemTypes.Linux.Equals(currentOSType))
|
||||
{
|
||||
this.Name = this.Name ?? AzureDiskEncryptionExtensionContext.LinuxExtensionDefaultName;
|
||||
vmExtensionParameters = new VirtualMachineExtension
|
||||
{
|
||||
Location = vmParameters.Location,
|
||||
Publisher = AzureDiskEncryptionExtensionContext.LinuxExtensionDefaultPublisher,
|
||||
VirtualMachineExtensionType = AzureDiskEncryptionExtensionContext.LinuxExtensionDefaultName,
|
||||
TypeHandlerVersion = (this.TypeHandlerVersion) ?? AzureDiskEncryptionExtensionContext.LinuxExtensionDefaultVersion,
|
||||
Settings = SettingString,
|
||||
ProtectedSettings = ProtectedSettingString,
|
||||
};
|
||||
}
|
||||
|
||||
return vmExtensionParameters;
|
||||
}
|
||||
|
||||
private void CreateVMBackupForLinx()
|
||||
{
|
||||
try
|
||||
{
|
||||
AzureVMBackupExtensionUtil azureBackupExtensionUtil = new AzureVMBackupExtensionUtil();
|
||||
AzureVMBackupConfig vmConfig = new AzureVMBackupConfig();
|
||||
vmConfig.ResourceGroupName = ResourceGroupName;
|
||||
vmConfig.VMName = VMName;
|
||||
vmConfig.VirtualMachineExtensionType = VirtualMachineExtensionType;
|
||||
string tag = string.Format("{0}{1}", "AzureEnc", Guid.NewGuid().ToString());
|
||||
// this would create shapshot only for Linux box. and we should wait for the snapshot found.
|
||||
azureBackupExtensionUtil.CreateSnapshotForDisks(vmConfig, tag, this);
|
||||
WriteWarning(string.Format("one snapshot for disks are created with tag,{0}, you can use {1}-{2} to remove it.", tag, VerbsCommon.Remove,
|
||||
ProfileNouns.AzureVMBackup));
|
||||
}
|
||||
catch (AzureVMBackupException e)
|
||||
{
|
||||
ThrowTerminatingError(new ErrorRecord(new ApplicationException(string.Format(CultureInfo.CurrentUICulture, e.ToString())),
|
||||
"InvalidResult",
|
||||
ErrorCategory.InvalidResult,
|
||||
null));
|
||||
}
|
||||
}
|
||||
|
||||
public override void ExecuteCmdlet()
|
||||
{
|
||||
base.ExecuteCmdlet();
|
||||
|
||||
ExecuteClientAction(() =>
|
||||
{
|
||||
if (this.Force.IsPresent ||
|
||||
this.ShouldContinue(Properties.Resources.EnableAzureDiskEncryptionConfirmation, Properties.Resources.EnableAzureDiskEncryptionCaption))
|
||||
{
|
||||
VirtualMachine virtualMachineResponse = this.ComputeClient.ComputeManagementClient.VirtualMachines.GetWithInstanceView(
|
||||
this.ResourceGroupName, VMName).Body;
|
||||
|
||||
currentOSType = virtualMachineResponse.StorageProfile.OsDisk.OsType;
|
||||
|
||||
if (OperatingSystemTypes.Linux.Equals(currentOSType))
|
||||
{
|
||||
CreateVMBackupForLinx();
|
||||
}
|
||||
|
||||
VirtualMachineExtension parameters = GetVmExtensionParameters(virtualMachineResponse);
|
||||
|
||||
this.VirtualMachineExtensionClient.CreateOrUpdateWithHttpMessagesAsync(
|
||||
this.ResourceGroupName,
|
||||
this.VMName,
|
||||
this.Name,
|
||||
parameters).GetAwaiter().GetResult();
|
||||
|
||||
var op = UpdateVmEncryptionSettings();
|
||||
var result = Mapper.Map<PSAzureOperationResponse>(op);
|
||||
WriteObject(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Extension.AzureVMBackup
|
||||
{
|
||||
public class AzureVMBackupConfig
|
||||
{
|
||||
public string ResourceGroupName { get; set; }
|
||||
public string VMName { get; set; }
|
||||
public string ExtensionName { get; set; }
|
||||
public string VirtualMachineExtensionType { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
// ----------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright Microsoft Corporation
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.Azure.Commands.Compute.Extension.AzureVMBackup
|
||||
{
|
||||
public class AzureVMBackupErrorCodes
|
||||
{
|
||||
public const int TimeOut = 1;
|
||||
public const int OSNotSupported = 2;
|
||||
public const int WrongBlobUriFormat = 3;
|
||||
}
|
||||
|
||||
public class AzureVMBackupException : Exception
|
||||
{
|
||||
public AzureVMBackupException(int errorCode,string message):base(message)
|
||||
{
|
||||
this.AzureVMBackupErrorCode = errorCode;
|
||||
}
|
||||
public int AzureVMBackupErrorCode { get; set; }
|
||||
}
|
||||
}
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче