Skip to content

Commit 552460e

Browse files
authored
Merge pull request Azure#5085 from sergey-shandar/sergey-release
New-AzureRmVm SimpleParameterSet, Strategies
2 parents c0d7f43 + 352a613 commit 552460e

File tree

72 files changed

+3680
-182
lines changed

Some content is hidden

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

72 files changed

+3680
-182
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,5 @@ FakesAssemblies/
211211
/tools/*.dll
212212
*.GhostDoc.xml
213213
pingme.txt
214-
groupMapping*.json
214+
groupMapping*.json
215+
.vscode/

setup/azurecmdfiles.wxi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@
271271
<Component Id="cmp4677B0CE124023330EDD7AA4FECFF45E" Guid="*">
272272
<File Id="fil58F144170E43C2EFEC66E5F3DE2FA977" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Compute\AzureRM.Compute.psm1" />
273273
</Component>
274+
<Component Id="cmp32CF42EA1F0A7DA716459A5A6A21C24D" Guid="*">
275+
<File Id="fil5AE28BCCEED67270ECF02C93C9688AD5" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Compute\Microsoft.Azure.Commands.Common.Strategies.dll" />
276+
</Component>
274277
<Component Id="cmpFBB75A5451448B356C97E62D2C6C10A0" Guid="*">
275278
<File Id="fil24BE7D514EE83ED7D31C68CBFFA8FBB8" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Compute\Microsoft.Azure.Commands.Compute.dll" />
276279
</Component>
@@ -3148,6 +3151,7 @@
31483151
<ComponentRef Id="cmpD2516E302D41812368A84BD6010FB066" />
31493152
<ComponentRef Id="cmp594709EB2E69BD7173BC8833BE2061B4" />
31503153
<ComponentRef Id="cmp4677B0CE124023330EDD7AA4FECFF45E" />
3154+
<ComponentRef Id="cmp32CF42EA1F0A7DA716459A5A6A21C24D" />
31513155
<ComponentRef Id="cmpFBB75A5451448B356C97E62D2C6C10A0" />
31523156
<ComponentRef Id="cmp1CB1E6D6A2D939FB32D9ACD70681644D" />
31533157
<ComponentRef Id="cmpAA00FCFEE63D9A20C2618B36B1848D7C" />

src/Common/Commands.Common/AzureLongRunningJob.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,9 @@ private bool InvokeShouldMethodAndWaitForResults(Func<Cmdlet, bool> shouldMethod
883883
}
884884
}
885885

886+
/// <summary>
887+
/// Stop job execution
888+
/// </summary>
886889
public override void StopJob()
887890
{
888891
ShouldMethodStreamItem stream;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{6756A7F2-1141-4065-BA23-0C555D2A2BC3}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Microsoft.Azure.Commands.Common.Strategies.UnitTest</RootNamespace>
11+
<AssemblyName>Microsoft.Azure.Commands.Common.Strategies.UnitTest</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="System" />
34+
<Reference Include="System.Core" />
35+
<Reference Include="System.Xml.Linq" />
36+
<Reference Include="System.Data.DataSetExtensions" />
37+
<Reference Include="Microsoft.CSharp" />
38+
<Reference Include="System.Data" />
39+
<Reference Include="System.Net.Http" />
40+
<Reference Include="System.Xml" />
41+
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
42+
<HintPath>..\..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
43+
<Private>True</Private>
44+
</Reference>
45+
<Reference Include="xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
46+
<HintPath>..\..\..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll</HintPath>
47+
<Private>True</Private>
48+
</Reference>
49+
<Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
50+
<HintPath>..\..\..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll</HintPath>
51+
<Private>True</Private>
52+
</Reference>
53+
<Reference Include="xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
54+
<HintPath>..\..\..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
55+
<Private>True</Private>
56+
</Reference>
57+
</ItemGroup>
58+
<ItemGroup>
59+
<Compile Include="Properties\AssemblyInfo.cs" />
60+
<Compile Include="TimeSlotTest.cs" />
61+
</ItemGroup>
62+
<ItemGroup>
63+
<None Include="packages.config" />
64+
</ItemGroup>
65+
<ItemGroup>
66+
<ProjectReference Include="..\Commands.Common.Strategies\Commands.Common.Strategies.csproj">
67+
<Project>{eea69772-d41b-482a-9252-2b4595c59e53}</Project>
68+
<Name>Commands.Common.Strategies</Name>
69+
</ProjectReference>
70+
<ProjectReference Include="..\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj">
71+
<Project>{3436a126-edc9-4060-8952-9a1be34cdd95}</Project>
72+
<Name>Commands.ScenarioTests.ResourceManager.Common</Name>
73+
</ProjectReference>
74+
</ItemGroup>
75+
<ItemGroup>
76+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
77+
</ItemGroup>
78+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
79+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
80+
Other similar extension points exist, see Microsoft.Common.targets.
81+
<Target Name="BeforeBuild">
82+
</Target>
83+
<Target Name="AfterBuild">
84+
</Target>
85+
-->
86+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Commands.Common.Strategies.UnitTest")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Commands.Common.Strategies.UnitTest")]
13+
[assembly: AssemblyCopyright("Copyright © Microsoft 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("6756a7f2-1141-4065-ba23-0c555d2a2bc3")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
16+
using Xunit;
17+
18+
namespace Microsoft.Azure.Commands.Common.Strategies.UnitTest
19+
{
20+
public class TimeSlotTest
21+
{
22+
[Fact]
23+
[Trait(Category.AcceptanceType, Category.CheckIn)]
24+
public void AddTest()
25+
{
26+
var first = new TimeSlot();
27+
28+
Assert.Equal(0, first.Duration);
29+
Assert.Equal(0, first.TaskCount);
30+
Assert.Equal(null, first.Next);
31+
32+
var next = first.AddTask(50);
33+
34+
Assert.Equal(50, first.Duration);
35+
Assert.Equal(1, first.TaskCount);
36+
Assert.Equal(next, first.Next);
37+
38+
Assert.Equal(10.0, first.GetTaskProgress(10));
39+
40+
Assert.Equal(0, next.Duration);
41+
Assert.Equal(0, next.TaskCount);
42+
Assert.Equal(null, next.Next);
43+
44+
var next2 = first.AddTask(50);
45+
46+
Assert.Equal(50, first.Duration);
47+
Assert.Equal(2, first.TaskCount);
48+
Assert.Equal(next2, first.Next);
49+
Assert.Equal(next, first.Next);
50+
51+
Assert.Equal(20.0, first.GetTaskProgress(40));
52+
53+
Assert.Equal(0, next2.Duration);
54+
Assert.Equal(0, next2.TaskCount);
55+
Assert.Equal(null, next2.Next);
56+
57+
var next3 = first.AddTask(30);
58+
Assert.Equal(30, first.Duration);
59+
Assert.Equal(3, first.TaskCount);
60+
Assert.Equal(next3, first.Next);
61+
62+
Assert.Equal(3.0, first.GetTaskProgress(9));
63+
64+
Assert.Equal(20, next3.Duration);
65+
Assert.Equal(2, next3.TaskCount);
66+
Assert.Equal(next2, next3.Next);
67+
Assert.Equal(next, next3.Next);
68+
69+
Assert.Equal(10.0 + 5, first.GetTaskProgress(40));
70+
71+
Assert.Equal(0, next2.Duration);
72+
Assert.Equal(0, next2.TaskCount);
73+
Assert.Equal(null, next2.Next);
74+
75+
var next4 = first.AddTask(75);
76+
Assert.Equal(25, next2.Duration);
77+
Assert.Equal(1, next2.TaskCount);
78+
Assert.Equal(next4, next2.Next);
79+
80+
Assert.Equal((30.0 / 4) + (20.0 / 3) + 20, first.GetTaskProgress(70));
81+
82+
Assert.Equal(0, next4.Duration);
83+
Assert.Equal(0, next4.TaskCount);
84+
Assert.Equal(null, next4.Next);
85+
}
86+
}
87+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="xunit" version="2.1.0" targetFramework="net452" />
4+
<package id="xunit.abstractions" version="2.0.0" targetFramework="net452" />
5+
<package id="xunit.assert" version="2.1.0" targetFramework="net452" />
6+
<package id="xunit.core" version="2.1.0" targetFramework="net452" />
7+
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net452" />
8+
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net452" />
9+
</packages>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{EEA69772-D41B-482A-9252-2B4595C59E53}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Microsoft.Azure.Commands.Common.Strategies</RootNamespace>
11+
<AssemblyName>Microsoft.Azure.Commands.Common.Strategies</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>TRACE;DEBUG</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE;SIGN</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
<SignAssembly>true</SignAssembly>
32+
<DelaySign>true</DelaySign>
33+
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
37+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.10\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
38+
<Private>True</Private>
39+
</Reference>
40+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
41+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.10\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
42+
<Private>True</Private>
43+
</Reference>
44+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
45+
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
46+
<Private>True</Private>
47+
</Reference>
48+
<Reference Include="System" />
49+
<Reference Include="System.Core" />
50+
<Reference Include="System.Xml.Linq" />
51+
<Reference Include="System.Data.DataSetExtensions" />
52+
<Reference Include="Microsoft.CSharp" />
53+
<Reference Include="System.Data" />
54+
<Reference Include="System.Net.Http" />
55+
<Reference Include="System.Xml" />
56+
</ItemGroup>
57+
<ItemGroup>
58+
<Compile Include="IReportProgress.cs" />
59+
<Compile Include="IResourceConfig.cs" />
60+
<Compile Include="IResourceConfigVisitor.cs" />
61+
<Compile Include="IResourceStrategy.cs" />
62+
<Compile Include="IShouldProcess.cs" />
63+
<Compile Include="ProgressMap.cs" />
64+
<Compile Include="TimeSlot.cs" />
65+
<Compile Include="StateOperationContext.cs" />
66+
<Compile Include="SyncTaskScheduler.cs" />
67+
<Compile Include="TimeSlotExtensions.cs" />
68+
<Compile Include="UpdateStateExtensions.cs" />
69+
<Compile Include="CreateOrUpdateAsyncParams.cs" />
70+
<Compile Include="EntityConfigExtensions.cs" />
71+
<Compile Include="Extensions.cs" />
72+
<Compile Include="GetStateExtensions.cs" />
73+
<Compile Include="GetAsyncParams.cs" />
74+
<Compile Include="IClient.cs" />
75+
<Compile Include="IEntityConfig.cs" />
76+
<Compile Include="IEntityConfigVisitor.cs" />
77+
<Compile Include="IEntityStrategy.cs" />
78+
<Compile Include="IState.cs" />
79+
<Compile Include="NestedResourceConfigExtensions.cs" />
80+
<Compile Include="ResourceConfigExtensions.cs" />
81+
<Compile Include="StateExtensions.cs" />
82+
<Compile Include="NestedResourceConfig.cs" />
83+
<Compile Include="NestedResourceStrategy.cs" />
84+
<Compile Include="TargetStateExtensions.cs" />
85+
<Compile Include="Properties\AssemblyInfo.cs" />
86+
<Compile Include="ResourceConfig.cs" />
87+
<Compile Include="ResourceStrategy.cs" />
88+
<Compile Include="State.cs" />
89+
<Compile Include="LocationExtensions.cs" />
90+
<Compile Include="Void.cs" />
91+
</ItemGroup>
92+
<ItemGroup>
93+
<None Include="MSSharedLibKey.snk" />
94+
<None Include="packages.config" />
95+
</ItemGroup>
96+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
97+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
98+
Other similar extension points exist, see Microsoft.Common.targets.
99+
<Target Name="BeforeBuild">
100+
</Target>
101+
<Target Name="AfterBuild">
102+
</Target>
103+
-->
104+
</Project>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<Import Project="..\..\..\..\tools\Common.Netcore.Dependencies.targets" />
4+
5+
<PropertyGroup>
6+
<TargetFramework>netcoreapp2.0</TargetFramework>
7+
<AssemblyName>Microsoft.Azure.Commands.Common.Strategies</AssemblyName>
8+
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
9+
<RootNamespace>Microsoft.Azure.Commands.Common.Strategies</RootNamespace>
10+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
11+
</PropertyGroup>
12+
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
14+
<SignAssembly>True</SignAssembly>
15+
<DelaySign>True</DelaySign>
16+
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
17+
<DefineConstants>TRACE;RELEASE;NETSTANDARD;SIGN</DefineConstants>
18+
</PropertyGroup>
19+
20+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
21+
<DefineConstants>TRACE;DEBUG;NETSTANDARD</DefineConstants>
22+
<DelaySign>false</DelaySign>
23+
</PropertyGroup>
24+
25+
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
26+
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="1.6.0-preview" />
27+
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="16.3.0" />
28+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="10.1.0-preview" />
29+
</ItemGroup>
30+
</Project>

0 commit comments

Comments
 (0)