Skip to content

Commit e4dd767

Browse files
committed
Merge pull request #4 from AzCiS/onesdk-avirupch
cmdlets for storsimple device failover
2 parents cc95374 + bf91842 commit e4dd767

File tree

9 files changed

+380
-24
lines changed

9 files changed

+380
-24
lines changed

setup/azurecmdfiles.wxi

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@
474474
<Component Id="cmpBF4C7868DB8CE8B4B50CAF51B647E2B1" Guid="*">
475475
<File Id="fil19BB25F9DA24781AACDA2274CE28507D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.ResourceManager.dll" />
476476
</Component>
477+
<Component Id="cmpF62DAC19C5372AC038D746C88EFEADFB" Guid="*">
478+
<File Id="filDABC128694F5874375CB4CB1753939B0" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Test.Framework.dll" />
479+
</Component>
480+
<Component Id="cmp59E348355866C4C93CF1C80074476F24" Guid="*">
481+
<File Id="filAA23C90DC2E0C4AB00805D1844FDCF81" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Azure.Test.HttpRecorder.dll" />
482+
</Component>
477483
<Component Id="cmpA937677C4B398F4B7A4CF18B5A1E292D" Guid="*">
478484
<File Id="fil850F0FF63537F0428126B3E04D5A49E6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.Data.Edm.dll" />
479485
</Component>
@@ -525,15 +531,15 @@
525531
<Component Id="cmpF750706356EAB58C8C81ED96B57288C8" Guid="*">
526532
<File Id="fil8D685FEB0876E6E1411E69E03A3CDB8F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.WindowsAzure.Management.Storage.dll" />
527533
</Component>
528-
<Component Id="cmp32A0C53BFC04028B9D6A48690191D6B3" Guid="*">
529-
<File Id="fil8E5F14631FFC90E7DABCD8CED70B99DF" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.WindowsAzure.Management.StorSimple.dll" />
530-
</Component>
531534
<Component Id="cmp607260D321DBB6DC85249332ACCCDF1E" Guid="*">
532535
<File Id="fil407E99E341C057EBEAA7597A7276562B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Microsoft.WindowsAzure.Storage.dll" />
533536
</Component>
534537
<Component Id="cmp81ACE07255D539B22EAAE5C07BF9C6B7" Guid="*">
535538
<File Id="fil20BBB718A749C1E485E5AAC0700CB59C" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Newtonsoft.Json.dll" />
536539
</Component>
540+
<Component Id="cmpE631AF96531CCAE5D68EC90A5F202819" Guid="*">
541+
<File Id="filE54271F9D1563CBA4916F0B949571B2C" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\StorSimple.Tests.dll" />
542+
</Component>
537543
<Component Id="cmp5B024A4E29BF400F1ED3DE2CE1F2E0DD" Guid="*">
538544
<File Id="filBDA4AC7C21781E73732383C29552E770" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\System.Net.Http.Extensions.dll" />
539545
</Component>
@@ -546,6 +552,9 @@
546552
<Component Id="cmpCADE67F2ED98E9D37A3889AE074E65ED" Guid="*">
547553
<File Id="fil59FE45D1790EB33DE9F5C7E23E2F7100" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\System.Spatial.dll" />
548554
</Component>
555+
<Component Id="cmp0DBB1A9E8815FACE01E98D9FC176F761" Guid="*">
556+
<File Id="filDA6AD875BE41A54DFE251E643544CE27" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\xunit.dll" />
557+
</Component>
549558
</Directory>
550559
<Directory Id="dir70AE8239A404E2C5D5621DBCDA6733C9" Name="Sql">
551560
<Component Id="cmp5746A3BAD258D8EA1473730146C01F1D" Guid="*">
@@ -822,9 +831,6 @@
822831
<Component Id="cmpCFF660734313D3C9592DB86F0D4B4EFE" Guid="*">
823832
<File Id="filD8D1F471ACDC72E34B1D13DA591F7B3F" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.Azure.Common.NetFramework.dll" />
824833
</Component>
825-
<Component Id="cmp4EC3226B54BFE0FF4970968ABD1746E3" Guid="*">
826-
<File Id="filBEF499CCE9B33E61EA5BEFE2BEE86E92" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.WindowsAzure.Management.Automation.dll" />
827-
</Component>
828834
<Component Id="cmp86A3FC330AB128431B87D9FC2A1D3109" Guid="*">
829835
<File Id="fil08829B0CC57BEE7E650F0AE7867D27EE" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.Azure.ResourceManager.dll" />
830836
</Component>
@@ -846,6 +852,9 @@
846852
<Component Id="cmp2AC34B496C31586E724E662B247950AF" Guid="*">
847853
<File Id="fil75C80AFB99C723F07FE74AA1C3858CED" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.WindowsAzure.Commands.Common.dll" />
848854
</Component>
855+
<Component Id="cmp72C8C02E06862525059DA2F6A04D5FE4" Guid="*">
856+
<File Id="filB12098DE4A2799A544C86635B4965210" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.WindowsAzure.Management.Automation.dll" />
857+
</Component>
849858
<Component Id="cmp79ECBE22B99E0C170107AAF0FE1ADE25" Guid="*">
850859
<File Id="filE4BFF743509EADFFFD4646D165D8065C" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.WindowsAzure.Management.dll" />
851860
</Component>
@@ -2382,6 +2391,12 @@
23822391
<Component Id="cmpF584FEE91889D98A4299209A1B9B1B94" Guid="*">
23832392
<File Id="fil1E84C52FC3BA4FCD7D38DF81574031BC" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.Azure.ResourceManager.dll" />
23842393
</Component>
2394+
<Component Id="cmp3A441B3B72BBDE324C9BE767A91B2B22" Guid="*">
2395+
<File Id="fil6EAE6F5F90187576171FD9854D69889F" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.Azure.Test.Framework.dll" />
2396+
</Component>
2397+
<Component Id="cmp1762C8B0F315879B27C69F85B4769909" Guid="*">
2398+
<File Id="filBF87CC17D5360E5C7047791E3CD7B294" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.Azure.Test.HttpRecorder.dll" />
2399+
</Component>
23852400
<Component Id="cmp9E03AAB684EA41B087D79346AE6C1073" Guid="*">
23862401
<File Id="fil501FE0FB963E03A9292BE5CC5A895CBB" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
23872402
</Component>
@@ -2412,12 +2427,12 @@
24122427
<Component Id="cmpBE0D655A7C1D36DC753F35A20389F05F" Guid="*">
24132428
<File Id="fil9F332E2D712A34BB01D4B387BE04650A" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.WindowsAzure.Management.Scheduler.dll" />
24142429
</Component>
2415-
<Component Id="cmp6DAD84F1908D5F2A7C204E57242034FF" Guid="*">
2416-
<File Id="filF3F26CC3250E7ABE6E572E542BD54E4E" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.WindowsAzure.Management.StorSimple.dll" />
2417-
</Component>
24182430
<Component Id="cmpB7DDB72F9DBAE9F9F12C674FFD00853C" Guid="*">
24192431
<File Id="filD2BEA0DE1FB483F4C3E220994E31B7D5" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Newtonsoft.Json.dll" />
24202432
</Component>
2433+
<Component Id="cmp60CF1E1226A52DEBD4407C452F81EEC5" Guid="*">
2434+
<File Id="fil4AD411694BEB4E517894626665DFF384" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\StorSimple.Tests.dll" />
2435+
</Component>
24212436
<Component Id="cmp0631D52AB2CC9A302EABD7E074F5677D" Guid="*">
24222437
<File Id="filF5DF3AE44556843B9BA2FC427BD6E2CE" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\System.Net.Http.Extensions.dll" />
24232438
</Component>
@@ -2427,6 +2442,9 @@
24272442
<Component Id="cmp4E07D562E97B5A66522EB87589E3C876" Guid="*">
24282443
<File Id="fil93F578F2247467F06FF71FF3FDEFCE4A" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\System.Net.Http.Primitives.dll" />
24292444
</Component>
2445+
<Component Id="cmp67B3347773445FF39CF8B39D8DE0C22F" Guid="*">
2446+
<File Id="filF03B803C5170E74903669AB13AB3A449" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\xunit.dll" />
2447+
</Component>
24302448
</Directory>
24312449
<Directory Id="dirE7E1C4D3416099C7648453EA7E433216" Name="TrafficManager">
24322450
<Component Id="cmp7A04B677540DBCD0BD49BD5C26172FF4" Guid="*">
@@ -2661,6 +2679,8 @@
26612679
<ComponentRef Id="cmp1E110B3A62CD167B9B41556BD0F2CD6F" />
26622680
<ComponentRef Id="cmpE1BF6EAEEB822D9D73DBCFAB13791982" />
26632681
<ComponentRef Id="cmpBF4C7868DB8CE8B4B50CAF51B647E2B1" />
2682+
<ComponentRef Id="cmpF62DAC19C5372AC038D746C88EFEADFB" />
2683+
<ComponentRef Id="cmp59E348355866C4C93CF1C80074476F24" />
26642684
<ComponentRef Id="cmpA937677C4B398F4B7A4CF18B5A1E292D" />
26652685
<ComponentRef Id="cmp49A15EDF3D2E72E177EF373D2E9AB2DE" />
26662686
<ComponentRef Id="cmpABB2FE63524DC4243E6F2FCDF24C7D5D" />
@@ -2678,13 +2698,14 @@
26782698
<ComponentRef Id="cmp820458093C358621EA214A7362ACCE1D" />
26792699
<ComponentRef Id="cmp0308F0BCCC45D37858315B38CEC3127D" />
26802700
<ComponentRef Id="cmpF750706356EAB58C8C81ED96B57288C8" />
2681-
<ComponentRef Id="cmp32A0C53BFC04028B9D6A48690191D6B3" />
26822701
<ComponentRef Id="cmp607260D321DBB6DC85249332ACCCDF1E" />
26832702
<ComponentRef Id="cmp81ACE07255D539B22EAAE5C07BF9C6B7" />
2703+
<ComponentRef Id="cmpE631AF96531CCAE5D68EC90A5F202819" />
26842704
<ComponentRef Id="cmp5B024A4E29BF400F1ED3DE2CE1F2E0DD" />
26852705
<ComponentRef Id="cmp997A920A652163E94E56A412D2BEC28C" />
26862706
<ComponentRef Id="cmp353F25E254A7722E3CADF046790D3C4D" />
26872707
<ComponentRef Id="cmpCADE67F2ED98E9D37A3889AE074E65ED" />
2708+
<ComponentRef Id="cmp0DBB1A9E8815FACE01E98D9FC176F761" />
26882709
<ComponentRef Id="cmp5746A3BAD258D8EA1473730146C01F1D" />
26892710
<ComponentRef Id="cmp56F52674BB946225BB64533814DCF37F" />
26902711
<ComponentRef Id="cmp499092B04619C0EDE4686B78E1128605" />
@@ -2773,14 +2794,14 @@
27732794
<ComponentRef Id="cmp614E0ECB4B4D1ACFBAA7502B66CB53AB" />
27742795
<ComponentRef Id="cmpB92C664A5015BD36E1B201D7BAE583E6" />
27752796
<ComponentRef Id="cmpCFF660734313D3C9592DB86F0D4B4EFE" />
2776-
<ComponentRef Id="cmp4EC3226B54BFE0FF4970968ABD1746E3" />
27772797
<ComponentRef Id="cmp86A3FC330AB128431B87D9FC2A1D3109" />
27782798
<ComponentRef Id="cmp1D87896B8DB222621598E697ABAF8676" />
27792799
<ComponentRef Id="cmpAAA3BFC9B04B6FC095AE39235747D692" />
27802800
<ComponentRef Id="cmp69914982EC2B4590B0A7EB3CFBAB4E06" />
27812801
<ComponentRef Id="cmpCE16EF6388EB7390B5991F43E5609278" />
27822802
<ComponentRef Id="cmp043C277BDC681C299BAA6E5E03E5960E" />
27832803
<ComponentRef Id="cmp2AC34B496C31586E724E662B247950AF" />
2804+
<ComponentRef Id="cmp72C8C02E06862525059DA2F6A04D5FE4" />
27842805
<ComponentRef Id="cmp79ECBE22B99E0C170107AAF0FE1ADE25" />
27852806
<ComponentRef Id="cmp674E543C58A62BC6BC8ECF44BCA31A9D" />
27862807
<ComponentRef Id="cmpB6773EA3F58057B9F419BA6DBF13CBED" />
@@ -3275,6 +3296,8 @@
32753296
<ComponentRef Id="cmpA56A6E7903A81BFA919217AE52A9F37B" />
32763297
<ComponentRef Id="cmp3AC709C29C5C98FAE63EC5ACF073B2AF" />
32773298
<ComponentRef Id="cmpF584FEE91889D98A4299209A1B9B1B94" />
3299+
<ComponentRef Id="cmp3A441B3B72BBDE324C9BE767A91B2B22" />
3300+
<ComponentRef Id="cmp1762C8B0F315879B27C69F85B4769909" />
32783301
<ComponentRef Id="cmp9E03AAB684EA41B087D79346AE6C1073" />
32793302
<ComponentRef Id="cmpEC794DBE4822765C546A06D80EAA3292" />
32803303
<ComponentRef Id="cmpB48F1BD4D2E8307615F7E22174FF4E6D" />
@@ -3285,11 +3308,12 @@
32853308
<ComponentRef Id="cmp96B7E859E6B1867E3949455DEEB4E6FE" />
32863309
<ComponentRef Id="cmpAD8A1A5D3992F815160303B36F74BD2B" />
32873310
<ComponentRef Id="cmpBE0D655A7C1D36DC753F35A20389F05F" />
3288-
<ComponentRef Id="cmp6DAD84F1908D5F2A7C204E57242034FF" />
32893311
<ComponentRef Id="cmpB7DDB72F9DBAE9F9F12C674FFD00853C" />
3312+
<ComponentRef Id="cmp60CF1E1226A52DEBD4407C452F81EEC5" />
32903313
<ComponentRef Id="cmp0631D52AB2CC9A302EABD7E074F5677D" />
32913314
<ComponentRef Id="cmpF717085B273764E99EDA68C7F0EE158E" />
32923315
<ComponentRef Id="cmp4E07D562E97B5A66522EB87589E3C876" />
3316+
<ComponentRef Id="cmp67B3347773445FF39CF8B39D8DE0C22F" />
32933317
<ComponentRef Id="cmp7A04B677540DBCD0BD49BD5C26172FF4" />
32943318
<ComponentRef Id="cmp0DBA9B291A7405C6A2536BF95D2BB5F2" />
32953319
<ComponentRef Id="cmp650509EFAB3198FBC7036F3B637A31A3" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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 System;
16+
using System.Management.Automation;
17+
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
18+
using Microsoft.WindowsAzure.Management.StorSimple.Models;
19+
using System.Collections.Generic;
20+
21+
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
22+
{
23+
24+
25+
[Cmdlet(VerbsCommon.Get, "AzureStorSimpleFailoverVolumeContainers", DefaultParameterSetName = StorSimpleCmdletParameterSet.Empty),
26+
OutputType(typeof(IList<DataContainerGroup>))]
27+
public class GetAzureStorSimpleFailoverVolumeContainers : StorSimpleCmdletBase
28+
{
29+
[Parameter(Position = 0, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceId)]
30+
[ValidateNotNullOrEmpty]
31+
public string DeviceId { get; set; }
32+
33+
[Parameter(Position = 0, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByName, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
34+
[ValidateNotNullOrEmpty]
35+
public string DeviceName { get; set; }
36+
37+
public override void ExecuteCmdlet()
38+
{
39+
try
40+
{
41+
string deviceid = null;
42+
43+
switch(ParameterSetName)
44+
{
45+
case StorSimpleCmdletParameterSet.IdentifyById:
46+
deviceid = DeviceId;
47+
break;
48+
case StorSimpleCmdletParameterSet.IdentifyByName:
49+
deviceid = StorSimpleClient.GetDeviceId(DeviceName);
50+
if (deviceid == null)
51+
{
52+
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage,
53+
StorSimpleContext.ResourceName, DeviceName));
54+
}
55+
break;
56+
default:
57+
break;
58+
}
59+
60+
if (string.IsNullOrEmpty(deviceid))
61+
{
62+
WriteObject(null);
63+
return;
64+
}
65+
66+
var dcgroupList = StorSimpleClient.GetFaileoverDataContainerGroups(deviceid).DataContainerGroupResponse.DCGroups;
67+
WriteObject(dcgroupList);
68+
WriteVerbose(string.Format(Resources.ReturnedCountDataContainerGroupMessage,
69+
dcgroupList.Count,
70+
dcgroupList.Count > 1 ? "s" : string.Empty));
71+
72+
}
73+
catch (Exception exception)
74+
{
75+
this.HandleException(exception);
76+
}
77+
}
78+
}
79+
}

0 commit comments

Comments
 (0)