Skip to content

Commit 9559f63

Browse files
author
Sankaranarayanan Mahadevan
committed
Merge branch 'onesdk-phase2' into sanmah
2 parents e6a6bec + b160c19 commit 9559f63

File tree

43 files changed

+468
-169
lines changed

Some content is hidden

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

43 files changed

+468
-169
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll</HintPath>
8484
</Reference>
8585
<Reference Include="Microsoft.WindowsAzure.Management.StorSimple">
86-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.StorSimple.1.0.0-preview\lib\net40\Microsoft.WindowsAzure.Management.StorSimple.dll</HintPath>
86+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.StorSimple.1.0.2-preview\lib\net40\Microsoft.WindowsAzure.Management.StorSimple.dll</HintPath>
8787
</Reference>
8888
<Reference Include="Newtonsoft.Json">
8989
<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.0.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.0-preview" targetFramework="net45" />
15+
<package id="Microsoft.WindowsAzure.Management.StorSimple" version="1.0.2-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>

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/GetAzureStorSimpleDeviceBackupPolicy.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System.Linq;
1615
using System.Management.Automation;
1716
using Microsoft.WindowsAzure.Management.StorSimple.Models;
18-
using Microsoft.WindowsAzure;
1917
using System;
2018
using System.Collections.Generic;
21-
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
2219
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2320

2421
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
@@ -78,10 +75,9 @@ private bool ProcessParameters()
7875

7976
if (deviceId == null)
8077
{
81-
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
82-
WriteObject(null);
83-
return false;
78+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
8479
}
80+
8581
return true;
8682
}
8783
}

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupPolicy.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System.Linq;
1615
using System.Management.Automation;
1716
using Microsoft.WindowsAzure.Management.StorSimple.Models;
18-
using Microsoft.WindowsAzure;
1917
using System;
2018
using System.Collections.Generic;
21-
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
2219
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2320

2421
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
@@ -84,11 +81,10 @@ public override void ExecuteCmdlet()
8481
private bool ProcessParameters()
8582
{
8683
deviceId = StorSimpleClient.GetDeviceId(DeviceName);
84+
8785
if (deviceId == null)
8886
{
89-
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
90-
WriteObject(null);
91-
return false;
87+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
9288
}
9389

9490
ProcessAddSchedules();

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupScheduleAddConfig.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414

1515
using System.Management.Automation;
1616
using Microsoft.WindowsAzure.Management.StorSimple.Models;
17-
using Microsoft.WindowsAzure;
1817
using System;
19-
using System.Collections.Generic;
20-
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
21-
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2218

2319
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
2420
{

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupScheduleUpdateConfig.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414

1515
using System.Management.Automation;
1616
using Microsoft.WindowsAzure.Management.StorSimple.Models;
17-
using Microsoft.WindowsAzure;
1817
using System;
19-
using System.Collections.Generic;
20-
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
21-
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2218

2319
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
2420
{

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/RemoveAzureStorSimpleDeviceBackupPolicy.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System.Linq;
1615
using System.Management.Automation;
1716
using Microsoft.WindowsAzure.Management.StorSimple.Models;
18-
using Microsoft.WindowsAzure;
1917
using System;
20-
using System.Collections.Generic;
21-
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
2218
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2319

2420
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
@@ -85,9 +81,7 @@ private bool ProcessParameters()
8581

8682
if (deviceId == null)
8783
{
88-
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
89-
WriteObject(null);
90-
return false;
84+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
9185
}
9286
switch (ParameterSetName)
9387
{

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/SetAzureStorSimpleDeviceBackupPolicy.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,11 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System.Diagnostics;
16-
using System.Linq;
1715
using System.Management.Automation;
1816
using Microsoft.WindowsAzure.Management.StorSimple.Models;
19-
using Microsoft.WindowsAzure;
2017
using System;
2118
using System.Collections.Generic;
22-
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
2319
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
24-
using System.Text.RegularExpressions;
2520

2621
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
2722
{
@@ -114,11 +109,10 @@ public override void ExecuteCmdlet()
114109
private bool ProcessParameters()
115110
{
116111
deviceId = StorSimpleClient.GetDeviceId(DeviceName);
112+
117113
if (deviceId == null)
118114
{
119-
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
120-
WriteObject(null);
121-
return false;
115+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
122116
}
123117

124118
ProcessAddSchedules();

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/GetAzureStorSimpleDeviceBackup.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System.Linq;
1615
using System.Management.Automation;
1716
using Microsoft.WindowsAzure.Management.StorSimple.Models;
18-
using Microsoft.WindowsAzure;
1917
using System;
2018
using System.Collections.Generic;
21-
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
2219
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2320

2421
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
2522
{
26-
[Cmdlet(VerbsCommon.Get, "AzureStorSimpleDeviceBackup", DefaultParameterSetName = StorSimpleCmdletParameterSet.Empty),OutputType(typeof(GetBackupResponse))]
23+
[Cmdlet(VerbsCommon.Get, "AzureStorSimpleDeviceBackup", DefaultParameterSetName = StorSimpleCmdletParameterSet.Empty),OutputType(typeof(IList<Backup>))]
2724
public class GetAzureStorSimpleDeviceBackup: StorSimpleCmdletBase
2825
{
2926
[Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.DeviceName, ParameterSetName = StorSimpleCmdletParameterSet.Empty)]
@@ -73,13 +70,15 @@ public override void ExecuteCmdlet()
7370
{
7471
try
7572
{
76-
if (!ProcessParameters()) return;
73+
if (!ProcessParameters())
74+
return;
7775
GetBackupResponse backupList = null;
7876
backupList = StorSimpleClient.GetAllBackups(deviceId, filterType, isAllSelected, IdToPass,
7977
FromDateTime.ToString(),
8078
ToDateTime.ToString(), Skip == null ? "0" : Skip.ToString(), First == null ? null : First.ToString());
8179
WriteObject(backupList.BackupSetsList, true);
8280
WriteVerbose(string.Format(Resources.BackupsReturnedCount, backupList.BackupSetsList.Count));
81+
8382
if (backupList.NextPageUri != null
8483
&& backupList.NextPageStartIdentifier!="1")
8584
{
@@ -113,9 +112,7 @@ private bool ProcessParameters()
113112

114113
if (deviceId == null)
115114
{
116-
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
117-
WriteObject(null);
118-
return false;
115+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
119116
}
120117

121118
if (string.IsNullOrEmpty(From))

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/RemoveAzureStorSimpleDeviceBackup.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System.Linq;
1615
using System.Management.Automation;
17-
using System.Runtime.InteropServices.WindowsRuntime;
1816
using Microsoft.WindowsAzure.Management.StorSimple.Models;
19-
using Microsoft.WindowsAzure;
2017
using System;
21-
using System.Collections.Generic;
22-
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
2318
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2419

2520

@@ -89,9 +84,7 @@ private bool ProcessParameters()
8984

9085
if (deviceId == null)
9186
{
92-
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
93-
WriteObject(null);
94-
return false;
87+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
9588
}
9689
switch (ParameterSetName)
9790
{

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/StartAzureStorSimpleDeviceBackupJob.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System.Linq;
1615
using System.Management.Automation;
1716
using Microsoft.WindowsAzure.Management.StorSimple.Models;
18-
using Microsoft.WindowsAzure;
1917
using System;
20-
using System.Collections.Generic;
21-
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
2218
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2319

2420
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
@@ -77,7 +73,7 @@ private void ProcessParameters()
7773

7874
if (deviceId == null)
7975
{
80-
WriteVerbose(Resources.NotFoundMessageDevice);
76+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
8177
}
8278

8379
BackupType backupTypeSelected = Management.StorSimple.Models.BackupType.Invalid;

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/StartAzureStorSimpleDeviceBackupRestoreJob.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System.Linq;
1615
using System.Management.Automation;
1716
using Microsoft.WindowsAzure.Management.StorSimple.Models;
18-
using Microsoft.WindowsAzure;
1917
using System;
20-
using System.Collections.Generic;
21-
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
2218
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2319

2420
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
@@ -87,7 +83,7 @@ private void ProcessParameters()
8783

8884
if (deviceId == null)
8985
{
90-
WriteVerbose(Resources.NotFoundMessageDevice);
86+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
9187
}
9288
}
9389
}

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Clone/StartAzureStorSimpleBackupCloneJob.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,22 @@ private bool ProcessParameters()
117117

118118
if (this.sourceDeviceId == null)
119119
{
120-
WriteVerbose(Resources.NoDeviceFoundWithGivenNameInResourceMessage);
121-
return false;
120+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, SourceDeviceName));
122121
}
123122

124123
this.targetDeviceId = StorSimpleClient.GetDeviceId(TargetDeviceName);
125124

126125
if (this.targetDeviceId == null)
127126
{
128-
WriteVerbose(Resources.NoDeviceFoundWithGivenNameInResourceMessage);
129-
return false;
127+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, TargetDeviceName));
130128
}
131129
break;
132130
}
133131

134132
return true;
135133
}
136134

137-
}//End Class
135+
}
138136

139-
}//End namespace
137+
}
140138

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/GetAzureStorSimpleDeviceVolumeContainer.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ public override void ExecuteCmdlet()
4242

4343
if (deviceid == null)
4444
{
45-
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
46-
WriteObject(null);
47-
return;
45+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
4846
}
4947

5048
if (VolumeContainerName == null)

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/NewAzureStorSimpleDeviceVolumeContainer.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ public override void ExecuteCmdlet()
6060
string deviceid = StorSimpleClient.GetDeviceId(DeviceName);
6161
if (deviceid == null)
6262
{
63-
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
64-
WriteObject(null);
65-
return;
63+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
6664
}
6765

6866
if(EncryptionEnabled == true && (string.IsNullOrEmpty(EncryptionKey) || !IsValidAsciiString(EncryptionKey)))

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/RemoveAzureStorSimpleDeviceVolumeContainer.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public override void ExecuteCmdlet()
5050

5151
if (deviceid == null)
5252
{
53-
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
54-
WriteObject(null);
55-
return;
53+
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
5654
}
5755

5856
if (WaitForComplete.IsPresent)

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceDetails/NewAzureStorSimpleNetworkConfig.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
using System;
1616
using System.Management.Automation;
17-
using Hyak.Common;
1817
using Microsoft.WindowsAzure.Management.StorSimple.Models;
1918
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2019
using System.Net;

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceDetails/SetAzureStorSimpleDevice.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@
1515
using System;
1616
using System.Linq;
1717
using System.Management.Automation;
18-
using Hyak.Common;
1918
using Microsoft.WindowsAzure.Management.StorSimple.Models;
2019
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
21-
using System.Net.Sockets;
2220
using System.Net;
23-
using System.Collections.Generic;
2421

2522
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
2623
{

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceDetails/SetAzureStorSimpleVirtualDevice.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16-
using System.Linq;
1716
using System.Management.Automation;
18-
using Hyak.Common;
1917
using Microsoft.WindowsAzure.Management.StorSimple.Models;
2018
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
21-
using System.Net.Sockets;
22-
using System.Net;
2319
using Microsoft.WindowsAzure.Commands.StorSimple.Encryption;
24-
using Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets.Library;
2520

2621
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
2722
{

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceJobs/GetAzureStorSimpleJob.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16-
using System.Linq;
1716
using System.Management.Automation;
18-
using Hyak.Common;
1917
using Microsoft.WindowsAzure.Management.StorSimple.Models;
2018
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
21-
using Microsoft.WindowsAzure.Commands.StorSimple;
22-
using System.Net.Sockets;
2319
using System.Collections.Generic;
2420
using System.Xml;
2521

0 commit comments

Comments
 (0)