Skip to content

Commit d22310a

Browse files
committed
Merge pull request #35 from AzCiS/LAMigration
Migration cmdlets
2 parents 2a6b43e + 91fdda1 commit d22310a

18 files changed

+877
-17
lines changed

setup/azurecmdfiles.wxi

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,12 @@
513513
<Component Id="cmpBF4C7868DB8CE8B4B50CAF51B647E2B1" Guid="*">
514514
<File Id="fil19BB25F9DA24781AACDA2274CE28507D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.ResourceManager.dll" />
515515
</Component>
516+
<Component Id="cmpF62DAC19C5372AC038D746C88EFEADFB" Guid="*">
517+
<File Id="filDABC128694F5874375CB4CB1753939B0" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Test.Framework.dll" />
518+
</Component>
519+
<Component Id="cmp59E348355866C4C93CF1C80074476F24" Guid="*">
520+
<File Id="filAA23C90DC2E0C4AB00805D1844FDCF81" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Test.HttpRecorder.dll" />
521+
</Component>
516522
<Component Id="cmpA937677C4B398F4B7A4CF18B5A1E292D" Guid="*">
517523
<File Id="fil850F0FF63537F0428126B3E04D5A49E6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Data.Edm.dll" />
518524
</Component>
@@ -570,15 +576,15 @@
570576
<Component Id="cmpF750706356EAB58C8C81ED96B57288C8" Guid="*">
571577
<File Id="fil8D685FEB0876E6E1411E69E03A3CDB8F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.WindowsAzure.Management.Storage.dll" />
572578
</Component>
573-
<Component Id="cmp32A0C53BFC04028B9D6A48690191D6B3" Guid="*">
574-
<File Id="fil8E5F14631FFC90E7DABCD8CED70B99DF" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.WindowsAzure.Management.StorSimple.dll" />
575-
</Component>
576579
<Component Id="cmp607260D321DBB6DC85249332ACCCDF1E" Guid="*">
577580
<File Id="fil407E99E341C057EBEAA7597A7276562B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.WindowsAzure.Storage.dll" />
578581
</Component>
579582
<Component Id="cmp81ACE07255D539B22EAAE5C07BF9C6B7" Guid="*">
580583
<File Id="fil20BBB718A749C1E485E5AAC0700CB59C" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Newtonsoft.Json.dll" />
581584
</Component>
585+
<Component Id="cmpE631AF96531CCAE5D68EC90A5F202819" Guid="*">
586+
<File Id="filE54271F9D1563CBA4916F0B949571B2C" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\StorSimple.Tests.dll" />
587+
</Component>
582588
<Component Id="cmp5B024A4E29BF400F1ED3DE2CE1F2E0DD" Guid="*">
583589
<File Id="filBDA4AC7C21781E73732383C29552E770" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\System.Net.Http.Extensions.dll" />
584590
</Component>
@@ -591,6 +597,9 @@
591597
<Component Id="cmpCADE67F2ED98E9D37A3889AE074E65ED" Guid="*">
592598
<File Id="fil59FE45D1790EB33DE9F5C7E23E2F7100" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\System.Spatial.dll" />
593599
</Component>
600+
<Component Id="cmp0DBB1A9E8815FACE01E98D9FC176F761" Guid="*">
601+
<File Id="filDA6AD875BE41A54DFE251E643544CE27" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\xunit.dll" />
602+
</Component>
594603
</Directory>
595604
<Directory Id="dir70AE8239A404E2C5D5621DBCDA6733C9" Name="Sql">
596605
<Component Id="cmp5746A3BAD258D8EA1473730146C01F1D" Guid="*">
@@ -2619,6 +2628,12 @@
26192628
<Component Id="cmp3AC709C29C5C98FAE63EC5ACF073B2AF" Guid="*">
26202629
<File Id="filBD421847424CAE48F72C74C69770D8C0" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.Azure.Common.NetFramework.dll" />
26212630
</Component>
2631+
<Component Id="cmp3A441B3B72BBDE324C9BE767A91B2B22" Guid="*">
2632+
<File Id="fil6EAE6F5F90187576171FD9854D69889F" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.Azure.Test.Framework.dll" />
2633+
</Component>
2634+
<Component Id="cmp1762C8B0F315879B27C69F85B4769909" Guid="*">
2635+
<File Id="filBF87CC17D5360E5C7047791E3CD7B294" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.Azure.Test.HttpRecorder.dll" />
2636+
</Component>
26222637
<Component Id="cmp9E03AAB684EA41B087D79346AE6C1073" Guid="*">
26232638
<File Id="fil501FE0FB963E03A9292BE5CC5A895CBB" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
26242639
</Component>
@@ -2649,12 +2664,12 @@
26492664
<Component Id="cmpBE0D655A7C1D36DC753F35A20389F05F" Guid="*">
26502665
<File Id="fil9F332E2D712A34BB01D4B387BE04650A" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.WindowsAzure.Management.Scheduler.dll" />
26512666
</Component>
2652-
<Component Id="cmp6DAD84F1908D5F2A7C204E57242034FF" Guid="*">
2653-
<File Id="filF3F26CC3250E7ABE6E572E542BD54E4E" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.WindowsAzure.Management.StorSimple.dll" />
2654-
</Component>
26552667
<Component Id="cmpB7DDB72F9DBAE9F9F12C674FFD00853C" Guid="*">
26562668
<File Id="filD2BEA0DE1FB483F4C3E220994E31B7D5" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Newtonsoft.Json.dll" />
26572669
</Component>
2670+
<Component Id="cmp60CF1E1226A52DEBD4407C452F81EEC5" Guid="*">
2671+
<File Id="fil4AD411694BEB4E517894626665DFF384" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\StorSimple.Tests.dll" />
2672+
</Component>
26582673
<Component Id="cmp0631D52AB2CC9A302EABD7E074F5677D" Guid="*">
26592674
<File Id="filF5DF3AE44556843B9BA2FC427BD6E2CE" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\System.Net.Http.Extensions.dll" />
26602675
</Component>
@@ -2664,6 +2679,9 @@
26642679
<Component Id="cmp4E07D562E97B5A66522EB87589E3C876" Guid="*">
26652680
<File Id="fil93F578F2247467F06FF71FF3FDEFCE4A" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\System.Net.Http.Primitives.dll" />
26662681
</Component>
2682+
<Component Id="cmp67B3347773445FF39CF8B39D8DE0C22F" Guid="*">
2683+
<File Id="filF03B803C5170E74903669AB13AB3A449" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\xunit.dll" />
2684+
</Component>
26672685
</Directory>
26682686
<Directory Id="dirE7E1C4D3416099C7648453EA7E433216" Name="TrafficManager">
26692687
<Component Id="cmp7A04B677540DBCD0BD49BD5C26172FF4" Guid="*">
@@ -2911,6 +2929,8 @@
29112929
<ComponentRef Id="cmpE1BF6EAEEB822D9D73DBCFAB13791982" />
29122930
<ComponentRef Id="cmpB571FD86C3A85FE12327FC783A65BC2E" />
29132931
<ComponentRef Id="cmpBF4C7868DB8CE8B4B50CAF51B647E2B1" />
2932+
<ComponentRef Id="cmpF62DAC19C5372AC038D746C88EFEADFB" />
2933+
<ComponentRef Id="cmp59E348355866C4C93CF1C80074476F24" />
29142934
<ComponentRef Id="cmpA937677C4B398F4B7A4CF18B5A1E292D" />
29152935
<ComponentRef Id="cmp49A15EDF3D2E72E177EF373D2E9AB2DE" />
29162936
<ComponentRef Id="cmpABB2FE63524DC4243E6F2FCDF24C7D5D" />
@@ -2930,13 +2950,14 @@
29302950
<ComponentRef Id="cmpE231A51CC41F80C051BC0663E08339BC" />
29312951
<ComponentRef Id="cmp0308F0BCCC45D37858315B38CEC3127D" />
29322952
<ComponentRef Id="cmpF750706356EAB58C8C81ED96B57288C8" />
2933-
<ComponentRef Id="cmp32A0C53BFC04028B9D6A48690191D6B3" />
29342953
<ComponentRef Id="cmp607260D321DBB6DC85249332ACCCDF1E" />
29352954
<ComponentRef Id="cmp81ACE07255D539B22EAAE5C07BF9C6B7" />
2955+
<ComponentRef Id="cmpE631AF96531CCAE5D68EC90A5F202819" />
29362956
<ComponentRef Id="cmp5B024A4E29BF400F1ED3DE2CE1F2E0DD" />
29372957
<ComponentRef Id="cmp997A920A652163E94E56A412D2BEC28C" />
29382958
<ComponentRef Id="cmp353F25E254A7722E3CADF046790D3C4D" />
29392959
<ComponentRef Id="cmpCADE67F2ED98E9D37A3889AE074E65ED" />
2960+
<ComponentRef Id="cmp0DBB1A9E8815FACE01E98D9FC176F761" />
29402961
<ComponentRef Id="cmp5746A3BAD258D8EA1473730146C01F1D" />
29412962
<ComponentRef Id="cmp56F52674BB946225BB64533814DCF37F" />
29422963
<ComponentRef Id="cmp499092B04619C0EDE4686B78E1128605" />
@@ -3589,6 +3610,8 @@
35893610
<ComponentRef Id="cmp844CE71A108EFCC5B93A410D5205E6DB" />
35903611
<ComponentRef Id="cmp6A927AFF9D7CBE438F31603C59A5D1A6" />
35913612
<ComponentRef Id="cmp3AC709C29C5C98FAE63EC5ACF073B2AF" />
3613+
<ComponentRef Id="cmp3A441B3B72BBDE324C9BE767A91B2B22" />
3614+
<ComponentRef Id="cmp1762C8B0F315879B27C69F85B4769909" />
35923615
<ComponentRef Id="cmp9E03AAB684EA41B087D79346AE6C1073" />
35933616
<ComponentRef Id="cmpEC794DBE4822765C546A06D80EAA3292" />
35943617
<ComponentRef Id="cmpB48F1BD4D2E8307615F7E22174FF4E6D" />
@@ -3599,11 +3622,12 @@
35993622
<ComponentRef Id="cmp96B7E859E6B1867E3949455DEEB4E6FE" />
36003623
<ComponentRef Id="cmpAD8A1A5D3992F815160303B36F74BD2B" />
36013624
<ComponentRef Id="cmpBE0D655A7C1D36DC753F35A20389F05F" />
3602-
<ComponentRef Id="cmp6DAD84F1908D5F2A7C204E57242034FF" />
36033625
<ComponentRef Id="cmpB7DDB72F9DBAE9F9F12C674FFD00853C" />
3626+
<ComponentRef Id="cmp60CF1E1226A52DEBD4407C452F81EEC5" />
36043627
<ComponentRef Id="cmp0631D52AB2CC9A302EABD7E074F5677D" />
36053628
<ComponentRef Id="cmpF717085B273764E99EDA68C7F0EE158E" />
36063629
<ComponentRef Id="cmp4E07D562E97B5A66522EB87589E3C876" />
3630+
<ComponentRef Id="cmp67B3347773445FF39CF8B39D8DE0C22F" />
36073631
<ComponentRef Id="cmp7A04B677540DBCD0BD49BD5C26172FF4" />
36083632
<ComponentRef Id="cmp2F3D9CC58C335CAB2C998183C40038B2" />
36093633
<ComponentRef Id="cmp0DBA9B291A7405C6A2536BF95D2BB5F2" />

src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Commands.StorSimple.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll</HintPath>
8282
</Reference>
8383
<Reference Include="Microsoft.WindowsAzure.Management.StorSimple">
84-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.StorSimple.1.0.2-preview\lib\net40\Microsoft.WindowsAzure.Management.StorSimple.dll</HintPath>
84+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.StorSimple.1.0.4-preview\lib\net40\Microsoft.WindowsAzure.Management.StorSimple.dll</HintPath>
8585
</Reference>
8686
<Reference Include="Newtonsoft.Json">
8787
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>

src/ServiceManagement/StorSimple/Commands.StorSimple.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1313
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
1414
<package id="Microsoft.WindowsAzure.Management.Scheduler" version="6.0.0" targetFramework="net45" />
15-
<package id="Microsoft.WindowsAzure.Management.StorSimple" version="1.0.2-preview" targetFramework="net45" />
15+
<package id="Microsoft.WindowsAzure.Management.StorSimple" version="1.0.4-preview" targetFramework="net45" />
1616
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
1717
<package id="xunit" version="1.9.2" targetFramework="net45" />
1818
</packages>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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.StorSimple.Properties;
16+
using Microsoft.WindowsAzure.Management.StorSimple;
17+
using Microsoft.WindowsAzure.Management.StorSimple.Models;
18+
using System;
19+
using System.Collections.Generic;
20+
using System.Linq;
21+
using System.Management.Automation;
22+
using System.Text;
23+
24+
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
25+
{
26+
[Cmdlet(VerbsLifecycle.Confirm, "AzureStorSimpleLegacyVolumeContainerStatus")]
27+
public class ConfirmAzureStorSimpleLegacyVolumeContainerStatus : StorSimpleCmdletBase
28+
{
29+
[Parameter(Mandatory = true, Position = 0, HelpMessage = StorSimpleCmdletHelpMessage.MigrationConfigId)]
30+
[ValidateNotNullOrEmpty]
31+
public string LegacyConfigId { get; set; }
32+
33+
[Parameter(Mandatory = true, Position = 1, HelpMessage = StorSimpleCmdletHelpMessage.MigrationOperation)]
34+
[ValidateSet("Commit", "Rollback", IgnoreCase = true)]
35+
public string MigrationOperation { get; set; }
36+
37+
[Parameter(Mandatory = false, Position = 2,
38+
HelpMessage = StorSimpleCmdletHelpMessage.MigrationLegacyDataContainers)]
39+
public string[] LegacyContainerNames { get; set; }
40+
41+
public override void ExecuteCmdlet()
42+
{
43+
try
44+
{
45+
var confirmMigrationRequest = new MigrationConfirmStatusRequest();
46+
confirmMigrationRequest.Operation =
47+
(MigrationOperation) Enum.Parse(typeof (MigrationOperation), MigrationOperation, true);
48+
confirmMigrationRequest.DataContainerNameList = (null != LegacyContainerNames)
49+
? new List<string>(LegacyContainerNames.ToList().Distinct())
50+
: new List<string>();
51+
var status = StorSimpleClient.ConfirmLegacyVolumeContainerStatus(LegacyConfigId, confirmMigrationRequest);
52+
MigrationCommonModelFormatter opFormatter = new MigrationCommonModelFormatter();
53+
WriteObject(opFormatter.GetResultMessage(Resources.ConfirmMigrationSuccessMessage, status));
54+
}
55+
catch (Exception except)
56+
{
57+
this.HandleException(except);
58+
}
59+
}
60+
}
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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.Management.StorSimple;
16+
using System;
17+
using System.Linq;
18+
using System.Management.Automation;
19+
20+
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
21+
{
22+
[Cmdlet(VerbsCommon.Get, "AzureStorSimpleLegacyVolumeContainerConfirmStatus")]
23+
public class GetAzureStorSimpleLegacyVolumeContainerConfirmStatus : StorSimpleCmdletBase
24+
{
25+
[Parameter(Mandatory = true, Position = 0, HelpMessage = StorSimpleCmdletHelpMessage.MigrationConfigId)]
26+
[ValidateNotNullOrEmpty]
27+
public string LegacyConfigId { get; set; }
28+
29+
[Parameter(Mandatory = false, Position = 1,
30+
HelpMessage = StorSimpleCmdletHelpMessage.MigrationLegacyDataContainers)]
31+
public string[] LegacyContainerNames { get; set; }
32+
33+
public override void ExecuteCmdlet()
34+
{
35+
try
36+
{
37+
StorSimpleClient.UpdateMigrationConfirmStatusSync(LegacyConfigId);
38+
var confirmStatus = StorSimpleClient.GetMigrationConfirmStatus(LegacyConfigId);
39+
if (0 < confirmStatus.ContainerConfirmStatus.Count)
40+
{
41+
if (null != LegacyContainerNames)
42+
{
43+
var legacyContainerNameList = LegacyContainerNames.ToList();
44+
confirmStatus.ContainerConfirmStatus = confirmStatus.ContainerConfirmStatus.ToList().FindAll(
45+
status => legacyContainerNameList.Contains(status.CloudConfigurationName));
46+
}
47+
}
48+
49+
var confirmStatusMsg = new ConfirmMigrationStatusMsg(LegacyConfigId, confirmStatus);
50+
WriteObject(confirmStatusMsg);
51+
}
52+
catch (Exception except)
53+
{
54+
this.HandleException(except);
55+
}
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)