diff --git a/AzurePowershell.Test.targets b/AzurePowershell.Test.targets
index a65a3a1882e7..daff74d84911 100644
--- a/AzurePowershell.Test.targets
+++ b/AzurePowershell.Test.targets
@@ -113,6 +113,14 @@
+
+
+
+ <_StorSimpleTestAssembly>.\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll
+
+
+
diff --git a/build.proj b/build.proj
index 2f3cf1d77e9b..f9b9a39c8122 100644
--- a/build.proj
+++ b/build.proj
@@ -195,7 +195,7 @@
-
+
diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi
index 3bcc9e71e4e9..c8afbd78f388 100644
--- a/setup/azurecmdfiles.wxi
+++ b/setup/azurecmdfiles.wxi
@@ -433,12 +433,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -921,6 +933,9 @@
+
+
+
@@ -1281,6 +1296,9 @@
+
+
+
@@ -1614,6 +1632,9 @@
+
+
+
@@ -2111,6 +2132,9 @@
+
+
+
@@ -2270,6 +2294,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2490,8 +2573,12 @@
+
+
+
+
@@ -2648,6 +2735,7 @@
+
@@ -2766,6 +2854,7 @@
+
@@ -2875,6 +2964,7 @@
+
@@ -3026,6 +3116,7 @@
+
@@ -3078,6 +3169,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/AzurePowershell.sln b/src/AzurePowershell.sln
index b6bafadf97b1..55b994b9795b 100644
--- a/src/AzurePowershell.sln
+++ b/src/AzurePowershell.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
-VisualStudioVersion = 12.0.30501.0
+VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
ProjectSection(SolutionItems) = preProject
@@ -151,6 +151,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RecoveryServices",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RecoveryServices.Test", "ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\Commands.RecoveryServices.Test.csproj", "{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StorSimple", "ServiceManagement\StorSimple\Commands.StorSimple\Commands.StorSimple.csproj", "{11524D98-6C40-4091-A8E1-86463FEE607C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StorSimple.Test", "ServiceManagement\StorSimple\Commands.StorSimple.Test\Commands.StorSimple.Test.csproj", "{0FA676D5-1349-4086-B33F-65EC2CB7DA41}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StreamAnalytics", "ResourceManager\StreamAnalytics\Commands.StreamAnalytics\Commands.StreamAnalytics.csproj", "{F49A314A-A235-47D3-A654-1EC19ACA366C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StreamAnalytics.Test", "ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\Commands.StreamAnalytics.Test.csproj", "{7E6683BE-ECFF-4709-89EB-1325E9E70512}"
@@ -365,6 +369,14 @@ Global
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Release|Any CPU.Build.0 = Release|Any CPU
{F49A314A-A235-47D3-A654-1EC19ACA366C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F49A314A-A235-47D3-A654-1EC19ACA366C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F49A314A-A235-47D3-A654-1EC19ACA366C}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -403,6 +415,7 @@ Global
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{080B0477-7E52-4455-90AB-23BD13D1B1CE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{7E6683BE-ECFF-4709-89EB-1325E9E70512} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
EndGlobalSection
EndGlobal
diff --git a/src/Common/Commands.Common/Constants.cs b/src/Common/Commands.Common/Constants.cs
index 33794d1e455d..65543c7b00df 100644
--- a/src/Common/Commands.Common/Constants.cs
+++ b/src/Common/Commands.Common/Constants.cs
@@ -34,6 +34,11 @@ public static class ApiConstants
}
+ public static class StorSimpleConstants
+ {
+ public const string DefaultStorageAccountEndpoint = "core.windows.net";
+ }
+
public class SDKVersion
{
public const string Version180 = "1.8.0";
diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj
index 8d39def107f7..b6aedb416dd9 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj
+++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj
@@ -232,6 +232,10 @@
{c60342b1-47d3-4a0e-8081-9b97ce60b7af}
Commands.Profile
+
+ {11524d98-6c40-4091-a8e1-86463fee607c}
+ Commands.StorSimple
+
{d470e50a-9607-48d6-a924-4f9f86502704}
Commands.Batch
diff --git a/src/ServiceManagement.StorSimple.sln b/src/ServiceManagement.StorSimple.sln
new file mode 100644
index 000000000000..2988be4bbf2f
--- /dev/null
+++ b/src/ServiceManagement.StorSimple.sln
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.21005.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StorSimple.Library", "Commands.StorSimple.Library\Commands.StorSimple.Library.csproj", "{B0E9C13F-4E03-4DF0-91FA-9A8C76E7422D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StorSimple", "ServiceManagement\StorSimple\Commands.StorSimple\Commands.StorSimple.csproj", "{11524D98-6C40-4091-A8E1-86463FEE607C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StorSimple.Test", "ServiceManagement\StorSimple\Commands.StorSimple.Test\Commands.StorSimple.Test.csproj", "{0FA676D5-1349-4086-B33F-65EC2CB7DA41}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B0E9C13F-4E03-4DF0-91FA-9A8C76E7422D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0E9C13F-4E03-4DF0-91FA-9A8C76E7422D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0E9C13F-4E03-4DF0-91FA-9A8C76E7422D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0E9C13F-4E03-4DF0-91FA-9A8C76E7422D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/src/ServiceManagement/Services/Commands.Utilities/Azure.psd1 b/src/ServiceManagement/Services/Commands.Utilities/Azure.psd1
index b8625368486e..3fd0522b339a 100644
--- a/src/ServiceManagement/Services/Commands.Utilities/Azure.psd1
+++ b/src/ServiceManagement/Services/Commands.Utilities/Azure.psd1
@@ -84,6 +84,7 @@ NestedModules = '.\Services\Microsoft.WindowsAzure.Commands.dll',
'.\ManagedCache\Microsoft.Azure.Commands.ManagedCache.dll',
'.\HDInsight\Microsoft.WindowsAzure.Commands.HDInsight.dll',
'.\Network\Microsoft.Azure.Commands.Network.dll',
+ '.\StorSimple\Microsoft.WindowsAzure.Commands.StorSimple.dll',
'.\RecoveryServices\Microsoft.Azure.Commands.RecoveryServices.dll'
# Functions to export from this module
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Commands.StorSimple.Test.csproj b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Commands.StorSimple.Test.csproj
new file mode 100644
index 000000000000..2ee4f8eb07ca
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Commands.StorSimple.Test.csproj
@@ -0,0 +1,173 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}
+ Library
+ Properties
+ Microsoft.WindowsAzure.Commands.StorSimple.Test
+ Microsoft.WindowsAzure.Commands.StorSimple.Test
+ v4.5
+ 512
+ ..\..\..\
+ true
+ 8ec1c917
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+
+
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+
+
+ ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+
+
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+
+
+ ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+
+
+ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+
+
+ False
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+
+
+ False
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+
+
+ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll
+
+
+ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll
+
+
+ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll
+
+
+ False
+ ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll
+
+
+ ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll
+
+
+ ..\..\..\packages\Microsoft.WindowsAzure.Management.StorSimple.0.9.0-preview\lib\net40\Microsoft.WindowsAzure.Management.StorSimple.dll
+
+
+ ..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll
+
+
+
+
+
+
+ False
+ C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll
+
+
+
+
+ False
+ ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll
+
+
+ False
+ ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll
+
+
+
+
+
+
+
+
+ ..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll
+
+
+
+
+
+
+
+
+
+ {5ee72c53-1720-4309-b54b-5fb79703195f}
+ Commands.Common
+
+
+ {c1bda476-a5cc-4394-914d-48b0ec31a710}
+ Commands.ScenarioTests.Common
+
+
+ {11524d98-6c40-4091-a8e1-86463fee607c}
+ Commands.StorSimple
+
+
+
+
+ Designer
+
+
+ Designer
+
+
+ PreserveNewest
+
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+ xcopy "$(SolutionDir)Package\$(ConfigurationName)\*.*" $(TargetDir) /Y /E
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Properties/AssemblyInfo.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000000..c5b5f7db3dcf
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Microsoft.WindowsAzure.Commands.StorSimple.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Microsoft.WindowsAzure.Commands.StorSimple.Test")]
+[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("d1c35c6d-1778-4d39-92c8-0bf709cc5b23")]
+
+[assembly: AssemblyVersion(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyVersion)]
+[assembly: AssemblyFileVersion(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyFileVersion)]
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/BackupPolicyTests.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/BackupPolicyTests.cs
new file mode 100644
index 000000000000..cef8140f2927
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/BackupPolicyTests.cs
@@ -0,0 +1,37 @@
+// ----------------------------------------------------------------------------------
+//
+// 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 Xunit;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Test.ScenarioTests
+{
+ public class BackupPolicyTests:StorSimpleTestBase
+ {
+ #region New-AzureStorSimpleDeviceBackupScheduleAddConfig
+ [Fact]
+ [Trait("StorSimpleCmdlets", "New-BackupPolicyConfig")]
+ public void TestNewBackupPolicyConfig()
+ {
+ RunPowerShellTest("Test-NewBackupPolicyAddConfig");
+ }
+
+ [Fact]
+ [Trait("StorSimpleCmdlets", "New-BackupPolicyConfig")]
+ public void TestNewBackupPolicyAddConfigDefaultValues()
+ {
+ RunPowerShellTest("Test-NewBackupPolicyAddConfig-DefaultValues");
+ }
+ #endregion New-AzureStorSimpleDeviceBackupScheduleAddConfig
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/BackupPolicyTests.ps1 b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/BackupPolicyTests.ps1
new file mode 100644
index 000000000000..3e1f848bc902
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/BackupPolicyTests.ps1
@@ -0,0 +1,54 @@
+# ----------------------------------------------------------------------------------
+#
+# 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
+Sets context to default resource
+#>
+function Set-DefaultResource
+{
+ $selectedResource = Select-AzureStorSimpleResource -ResourceName OneSDK-Resource -RegistrationKey "1975530557201809476:eOqMQdvHon3lGwKVYctxZVnwpZcqi8ZS1uyCLJAl6Wg=:JovQDqP1KyWdh4m3mYkdzQ==#4edfc1cde41104e5"
+}
+
+<#
+.SYNOPSIS
+Tests creating new resource group and a simple resource.
+#>
+function Test-NewBackupPolicyAddConfig
+{
+ Set-DefaultResource
+ $config = New-AzureStorSimpleDeviceBackupScheduleAddConfig -BackupType LocalSnapshot -RecurrenceType Daily -RecurrenceValue 1 -RetentionCount 1 -Enabled 0 -StartFromDateTime "10/23/2014 7:00 AM"
+ Assert-AreEqual $config.BackupType LocalSnapshot 'BackupType doesnt match'
+ Assert-AreEqual $config.Recurrence.RecurrenceType 'Daily' 'RecurrenceType doesnt match'
+ Assert-AreEqual $config.Recurrence.RecurrenceValue 1 'RecurrentValue doesnt match'
+ Assert-AreEqual $config.Status Disabled 'Status doesnt match'
+ #Assert-AreEqual $config.StartTime 2014-10-23T07:00:00+05:30 'StartTime doesnt match' #timezone specific test
+ Assert-AreEqual $config.RetentionCount 1 'RetentionCount doesnt match'
+}
+
+function Test-NewBackupPolicyAddConfig-DefaultValues
+{
+ Set-DefaultResource
+ $currenttime = get-date
+ $config = New-AzureStorSimpleDeviceBackupScheduleAddConfig -BackupType CloudSnapshot -RecurrenceType Daily -RecurrenceValue 10 -RetentionCount 10 -Enabled 1
+ $startTimeFromConfig = [datetime]::ParseExact($config.StartTime,"yyyy-MM-ddTHH:mm:sszzz",$null)
+ $timespan = $startTimeFromConfig - $currenttime
+
+ Assert-True {$timespan.TotalSeconds -le 1} "StartDateTime is not matching"
+ Assert-AreEqual $config.BackupType CloudSnapshot 'BackupType doesnt match'
+ Assert-AreEqual $config.Recurrence.RecurrenceType 'Daily' 'RecurrenceType doesnt match'
+ Assert-AreEqual $config.Recurrence.RecurrenceValue 10 'RecurrentValue doesnt match'
+ Assert-AreEqual $config.Status Enabled 'Status doesnt match'
+ Assert-AreEqual $config.RetentionCount 10 'RetentionCount doesnt match'
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/Configuration/ConfigurationReader.ps1 b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/Configuration/ConfigurationReader.ps1
new file mode 100644
index 000000000000..266f7a3a5f2b
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/Configuration/ConfigurationReader.ps1
@@ -0,0 +1,109 @@
+# ----------------------------------------------------------------------------------
+#
+# 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.
+# ----------------------------------------------------------------------------------
+
+$global:StorSimpleGlobalConfigMap = $null
+
+function Read-XMLConfigFile($configFilePath)
+{
+ $methodName = "Read-ConfigFile"
+
+ Write-Verbose "$methodName : Reading configuration file '$configFilePath'"
+ if([string]::IsNullOrEmpty($configFilePath)) {
+ throw "$methodName : Config file path is not specified. Please specify file path OR set the environment variable STORSIMPLE_SDK_TEST_CONFIG_PATH."
+ }
+
+ [xml] $configContent = Get-Content $configFilePath
+ if(!$configContent) {
+ throw "$methodName : Config file '$configFilePath' is either not readable or is empty"
+ }
+ Write-Verbose "$methodName : Configuration file read. Extracting configuration keys."
+
+ $configMap=@{}
+ foreach($configEntry in $configContent.configuration.appSettings.add) {
+ Write-Verbose ("{0} : {1}" -F $configEntry.key, $configEntry.Value)
+ if($configMap.ContainsKey($configEntry.key)) {
+ throw "Duplicate configuration entries for key '$($configEntry.key)' - please check the configuration file '$configFilePath' for correctness"
+ } else {
+ $configMap.Add($configEntry.key, $configEntry.Value)
+ }
+ }
+ $global:StorSimpleGlobalConfigMap = $configMap
+
+ Write-Verbose "$methodName : Completed reading configuration items from file '$configFilePath'. Found $($configMap.Count) keys : "
+ $configMap.GetEnumerator() | foreach-object -begin { $i = 1 } -process { Write-Verbose ("$methodName : Config entry #{0}: '{1}' : '{2}'" -F $i, $_.Key, $_.Value); $i++}
+ return $configMap
+}
+
+function Read-ConfigFile($configFilePath)
+{
+ $methodName = "Read-ConfigFile"
+
+ Write-Verbose "$methodName : Reading configuration file '$configFilePath'"
+ if([string]::IsNullOrEmpty($configFilePath)) {
+ throw "$methodName : Config file path is not specified. Please specify file path OR set the environment variable STORSIMPLE_SDK_TEST_CONFIG_PATH."
+ }
+
+ $configContent = Get-Content $configFilePath
+ if(!$configContent) {
+ throw "$methodName : Config file '$configFilePath' is either not readable or is empty"
+ }
+ Write-Verbose "$methodName : Configuration file read. Extracting configuration keys."
+
+ $configContent | foreach-object -begin {$configMap=@{}} -process { $k = [regex]::split($_,'='); if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True) -and ($k[0].StartsWith("#") -ne $True)) { $configMap.Add($k[0], $k[1]) } }
+ $global:StorSimpleGlobalConfigMap = $configMap
+
+ Write-Verbose "$methodName : Completed reading configuration items from file '$configFilePath'. Found $($configMap.Count) keys : "
+ $configMap.GetEnumerator() | foreach-object -begin { $i = 1 } -process { Write-Verbose ("$methodName : Config entry #{0}: '{1}' : '{2}'" -F $i, $_.Key, $_.Value); $i++}
+ return $configMap
+}
+
+function Get-ConfigFileMap ()
+{
+ $methodName = "Get-ConfigFileMap"
+
+ if($global:StorSimpleGlobalConfigMap) {
+ Write-Verbose "$methodName : Using cached config map"
+ return $global:StorSimpleGlobalConfigMap
+ }
+
+ $configFilePath = $env:STORSIMPLE_SDK_TEST_CONFIG_PATH
+ $configurationMap = Read-XMLConfigFile $configFilePath
+
+ if(!$configurationMap -or $configurationMap.Count -eq 0) {
+ throw "$methodName : The configuration map does not contain any keys - please check the configuration file '$configFilePath' for correctness"
+ }
+
+ return $configurationMap
+}
+
+<#
+.SYNOPSIS
+#>
+function Get-Configuration ($configPropertyKey)
+{
+ $methodName = "Get-Configuration"
+ Write-Verbose "$methodName : Fetching from configuration map, value of key '$configPropertyKey'"
+
+ $configurationMap = Get-ConfigFileMap
+
+ if($configurationMap.ContainsKey($configPropertyKey)) {
+ $configurationValue = $configurationMap[$configPropertyKey]
+ Write-Verbose "$methodName : Returning configuration property with value '$configurationValue' for key '$configPropertyKey'"
+
+ return $configurationValue;
+ }
+
+ Write-Verbose "$methodName : Could not find any property in the configuration map with the key '$configPropertyKey'"
+ return $null
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/StorSimpleTestBase.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/StorSimpleTestBase.cs
new file mode 100644
index 000000000000..6764ee2c1598
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/StorSimpleTestBase.cs
@@ -0,0 +1,176 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Configuration;
+using System.Net;
+using System.Net.Http;
+using System.Net.Security;
+using System.Reflection;
+using Microsoft.Azure;
+using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Test;
+using Microsoft.Azure.Test.HttpRecorder;
+using Microsoft.WindowsAzure.Commands.ScenarioTest;
+using Microsoft.WindowsAzure.Management.Scheduler;
+using Microsoft.WindowsAzure.Management.StorSimple;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Test.ScenarioTests
+{
+ public class StorSimpleTestBase
+ {
+ private EnvironmentSetupHelper helper;
+ private RDFETestEnvironmentFactory rdfeTestFactory;
+
+ protected StorSimpleTestBase()
+ {
+ this.helper = new EnvironmentSetupHelper();
+ this.rdfeTestFactory = new RDFETestEnvironmentFactory();
+ }
+
+ protected void SetupManagementClients()
+ {
+ var storSimpleManagementClient = GetStorSimpleClient();
+ var cloudServiceClient = GetCloudServiceClient();
+ helper.SetupManagementClients(storSimpleManagementClient, cloudServiceClient);
+
+ //helper.SetupSomeOfManagementClients();
+ }
+
+ private StorSimpleManagementClient GetStorSimpleClient()
+ {
+ try
+ {
+ //var testEnvironment = this.rdfeTestFactory.GetTestEnvironment();
+
+ var storSimpleClient = GetServiceClient();
+
+ //var storSimpleClient = new StorSimpleManagementClient("", "", "", "", "",
+ // testEnvironment.Credentials as SubscriptionCloudCredentials, testEnvironment.BaseUri).WithHandler(HttpMockServer.CreateInstance());
+ return storSimpleClient;
+ }
+ catch (ReflectionTypeLoadException leException)
+ {
+
+ throw leException;
+ }
+
+ }
+
+ private CloudServiceManagementClient GetCloudServiceClient()
+ {
+ return TestBase.GetServiceClient(this.rdfeTestFactory);
+ }
+
+ protected void RunPowerShellTest(params string[] scripts)
+ {
+ using (UndoContext context = UndoContext.Current)
+ {
+ context.Start(TestUtilities.GetCallingClass(2), TestUtilities.GetCurrentMethodName(2));
+
+ SetupManagementClients();
+
+ helper.SetupEnvironment(AzureModule.AzureServiceManagement);
+
+ helper.SetupModules(AzureModule.AzureServiceManagement, "ScenarioTests\\" + this.GetType().Name + ".ps1");
+ helper.RunPowerShellTest(scripts);
+ }
+ }
+
+ public static T GetServiceClient() where T : class
+ {
+ var factory = (TestEnvironmentFactory)new RDFETestEnvironmentFactory();
+
+ var testEnvironment = factory.GetTestEnvironment();
+
+ ServicePointManager.ServerCertificateValidationCallback = IgnoreCertificateErrorHandler;
+
+ StorSimpleManagementClient client;
+
+ if (testEnvironment.UsesCustomUri())
+ {
+ client = new StorSimpleManagementClient(
+ ConfigurationManager.AppSettings["CloudServiceName"],
+ ConfigurationManager.AppSettings["ResourceName"],
+ ConfigurationManager.AppSettings["ResourceId"],
+ ConfigurationManager.AppSettings["ResourceNamespace"],
+ ConfigurationManager.AppSettings["CisStampId"],
+ testEnvironment.Credentials as SubscriptionCloudCredentials,
+ testEnvironment.BaseUri);
+ }
+
+ else
+ {
+ client = new StorSimpleManagementClient(
+ ConfigurationManager.AppSettings["CloudServiceName"],
+ ConfigurationManager.AppSettings["ResourceName"],
+ ConfigurationManager.AppSettings["ResourceId"],
+ ConfigurationManager.AppSettings["ResourceNamespace"],
+ ConfigurationManager.AppSettings["CisStampId"],
+ testEnvironment.Credentials as SubscriptionCloudCredentials);
+ }
+
+ return GetServiceClient(factory, client);
+ }
+
+ public static T GetServiceClient(TestEnvironmentFactory factory, StorSimpleManagementClient client) where T : class
+ {
+ TestEnvironment testEnvironment = factory.GetTestEnvironment();
+
+ HttpMockServer instance;
+ try
+ {
+ instance = HttpMockServer.CreateInstance();
+ }
+ catch (ApplicationException)
+ {
+ HttpMockServer.Initialize("TestEnvironment", "InitialCreation");
+ instance = HttpMockServer.CreateInstance();
+ }
+ T obj2 = typeof(T).GetMethod("WithHandler", new Type[1]
+ {
+ typeof (DelegatingHandler)
+ }).Invoke((object)client, new object[1]
+ {
+ (object) instance
+ }) as T;
+
+ if (HttpMockServer.Mode == HttpRecorderMode.Record)
+ {
+ HttpMockServer.Variables[TestEnvironment.SubscriptionIdKey] = testEnvironment.SubscriptionId;
+ }
+
+ if (HttpMockServer.Mode == HttpRecorderMode.Playback)
+ {
+ PropertyInfo property1 = typeof(T).GetProperty("LongRunningOperationInitialTimeout", typeof(int));
+ PropertyInfo property2 = typeof(T).GetProperty("LongRunningOperationRetryTimeout", typeof(int));
+ if (property1 != (PropertyInfo)null && property2 != (PropertyInfo)null)
+ {
+ property1.SetValue((object)obj2, (object)0);
+ property2.SetValue((object)obj2, (object)0);
+ }
+ }
+ return obj2;
+ }
+
+ private static bool IgnoreCertificateErrorHandler
+ (object sender,
+ System.Security.Cryptography.X509Certificates.X509Certificate certificate,
+ System.Security.Cryptography.X509Certificates.X509Chain chain,
+ SslPolicyErrors sslPolicyErrors)
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/SessionRecords/Microsoft.WindowsAzure.Commands.StorSimple.Test.ScenarioTests.BackupPolicyTests/TestNewBackupPolicyAddConfigDefaultValues.json b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/SessionRecords/Microsoft.WindowsAzure.Commands.StorSimple.Test.ScenarioTests.BackupPolicyTests/TestNewBackupPolicyAddConfigDefaultValues.json
new file mode 100644
index 000000000000..150334d5d199
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/SessionRecords/Microsoft.WindowsAzure.Commands.StorSimple.Test.ScenarioTests.BackupPolicyTests/TestNewBackupPolicyAddConfigDefaultValues.json
@@ -0,0 +1,179 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "/062c67a6-019b-40af-a775-c4dc1abe56ed/CloudServices",
+ "EncodedRequestUri": "LzA2MmM2N2E2LTAxOWItNDBhZi1hNzc1LWM0ZGMxYWJlNTZlZC9DbG91ZFNlcnZpY2Vz",
+ "RequestMethod": "GET",
+ "RequestBody": "",
+ "RequestHeaders": {
+ "x-ms-version": [
+ "2013-03-01"
+ ],
+ "User-Agent": [
+ "Microsoft.WindowsAzure.Management.Scheduler.CloudServiceManagementClient/3.0.0.0"
+ ]
+ },
+ "ResponseBody": "\r\n \r\n AzCisIntRunnerWUS\r\n \r\n AzCisIntRunnerWUS\r\n West US\r\n \r\n \r\n WACis\r\n CisVault\r\n AzCisIntRunnerWUS\r\n \r\n 1.1\r\n 227f07eb-392b-4cc8-8972-baf13a6299f6\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n e7b9e848-2f14-47a9-9bad-d77ce5f0ed9a\r\n \r\n \r\n ResourceId\r\n 164364985811234912\r\n \r\n \r\n BackendStampId\r\n 7ef900f6-ad91-497d-a9c5-2742b7ed4a75\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisProdCSEA01\r\n \r\n 8a5ca166-7394-49c4-90bf-c5c10cc891bc\r\n East Asia\r\n \r\n \r\n WACiS\r\n CiSVault\r\n CisProdResEA01\r\n \r\n 1.1\r\n 5b45ac98-8cd8-45ca-993d-43643b03d5d5\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 64437628-f3e5-4d8a-928b-44b2c9889117\r\n \r\n \r\n ResourceId\r\n 4627730753422042572\r\n \r\n \r\n BackendStampId\r\n b0fbf6e0-4c86-4dc9-a74a-99f5148cfaab\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisProdCSNE01\r\n \r\n a6fcbf5d-433c-4248-ab3e-2d002847cbc1\r\n North Europe\r\n \r\n \r\n \r\n CisProdCSSEA01\r\n \r\n d5e0ba9a-f87e-4dc5-8c14-f0ff7389a40f\r\n Southeast Asia\r\n \r\n \r\n WACiS\r\n CiSVault\r\n CisProdResSEA01\r\n \r\n 1.1\r\n b8851cc1-98f1-4f57-852f-7179be0175f3\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 1cf1938f-b7f4-4be1-96e6-567e8057402b\r\n \r\n \r\n ResourceId\r\n 5075532093917877646\r\n \r\n \r\n BackendStampId\r\n 290b924d-c44a-41dc-89ee-a997105110c5\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisProdCSWE01\r\n \r\n fe1ced8c-78f1-4165-b60c-c40684f69300\r\n West Europe\r\n \r\n \r\n WACiS\r\n CiSVault\r\n CisProdResWE01\r\n \r\n 1.1\r\n f24cdf9e-ebe0-4acc-8cef-a4a46fe79c37\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n ff53cef6-1773-4067-8473-4f823067b722\r\n \r\n \r\n ResourceId\r\n 2009177452664442965\r\n \r\n \r\n BackendStampId\r\n 8e8b42d1-72f9-4506-9291-b48125c38d0f\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CiSProdEACS01\r\n \r\n f2cb7490-fc5f-4292-8d46-d8d08c677f78\r\n East Asia\r\n \r\n \r\n \r\n CiSProdNECS01\r\n \r\n 2319d679-db7d-44ed-a90b-0fac9ccfeff8\r\n North Europe\r\n \r\n \r\n \r\n CiSProdNECS02\r\n \r\n 0ae9fbd2-0f15-4d30-9d0c-052bf8a374b4\r\n North Europe\r\n \r\n \r\n \r\n CiSProdSEACS01\r\n \r\n f3900e44-ace6-4d11-8e1b-8ee42102b450\r\n Southeast Asia\r\n \r\n \r\n \r\n CiSProdWECS01\r\n \r\n a3052591-2669-47ce-98ab-337c5fb9db20\r\n West Europe\r\n \r\n \r\n \r\n CiSProdWECS02\r\n \r\n 0dbeae1e-4e4d-4cf0-97ea-04300b1ae771\r\n West Europe\r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-Australia-East\r\n \r\n 39509ffc-374f-4eeb-aa67-7c10ea817d46\r\n Australia East\r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-Australia-Southeast\r\n \r\n b25d9509-76a1-4e4e-9896-46f72b02ff11\r\n Australia Southeast\r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-east-asia\r\n \r\n 063a9747-e74e-42a0-a934-e907f0ae62ff\r\n east asia\r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-east-us\r\n \r\n d5aa1928-d752-4aec-8863-925d5810eddd\r\n east us\r\n \r\n \r\n WACis\r\n CisVault\r\n eus1410smoketest\r\n \r\n 1.1\r\n ac5750ee-5b1b-488a-9b95-aa351c57927a\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 8f764ff5-e5cf-48ad-83ad-941967b2b3de\r\n \r\n \r\n ResourceId\r\n 280409181064783549\r\n \r\n \r\n BackendStampId\r\n 8ba344e5-fd0a-46f1-8df3-34295e520f28\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-japan-east\r\n \r\n 9ac4dc08-77b3-40b7-a4ff-18f546e7cb67\r\n japan east\r\n \r\n \r\n WACis\r\n CisVault\r\n PreQfe2Res\r\n \r\n 1.1\r\n 6d6526a5-e3b0-487b-94e0-3ea37304d02d\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 1fdbbe77-1522-48a0-b8bb-08fc3a5538a0\r\n \r\n \r\n ResourceId\r\n 6617468074916048322\r\n \r\n \r\n BackendStampId\r\n 1b48cca2-9a1a-441d-a9e3-efa8043c61bf\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-japan-west\r\n \r\n f634db14-e5e4-4c74-b0d1-112088bae978\r\n japan west\r\n \r\n \r\n WACis\r\n CisVault\r\n jpwSmokeTestrajsing\r\n \r\n 1.1\r\n 997c1105-f304-411f-b075-285ab4a10e70\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n a84366fd-4dbc-48aa-a3b7-ae61bea20620\r\n \r\n \r\n ResourceId\r\n 1538313057736326684\r\n \r\n \r\n BackendStampId\r\n 1a9ce821-796d-4402-a594-a6eae5767ad8\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-north-europe\r\n \r\n 31be64d6-8656-4c44-aab4-f57329d39317\r\n north europe\r\n \r\n \r\n WACis\r\n CisVault\r\n nesmoke1410\r\n \r\n 1.1\r\n cf9c0707-0b7f-4802-8e9c-dd9a4fc5b81a\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 5bbb0b31-877c-4d43-9f55-bfde5b22e284\r\n \r\n \r\n ResourceId\r\n 9009498038937266079\r\n \r\n \r\n BackendStampId\r\n 1001f743-93e2-4b98-8e3a-8891b96c9967\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-southeast-asia\r\n \r\n cfd274d6-a650-4521-ac6d-2357512bf2da\r\n southeast asia\r\n \r\n \r\n WACis\r\n CisVault\r\n Oct29SaaSBugBash\r\n \r\n 1.1\r\n 45f83bb9-f30f-4a02-92e1-27a09beae9bc\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 1cf1938f-b7f4-4be1-96e6-567e8057402b\r\n \r\n \r\n ResourceId\r\n 1140492213348126260\r\n \r\n \r\n BackendStampId\r\n 290b924d-c44a-41dc-89ee-a997105110c5\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-europe\r\n \r\n 9662b3da-b74b-4773-a3c4-c520e4566795\r\n west europe\r\n \r\n \r\n WACis\r\n CisVault\r\n azcistest1208\r\n \r\n 1.1\r\n c23da0f9-1623-4d31-a3ad-88ce4b83c868\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n ff53cef6-1773-4067-8473-4f823067b722\r\n \r\n \r\n ResourceId\r\n 826983654462536656\r\n \r\n \r\n BackendStampId\r\n 8e8b42d1-72f9-4506-9291-b48125c38d0f\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n WACis\r\n CisVault\r\n bvtsignoff0311\r\n \r\n 1.1\r\n 274882c4-548e-4d6e-9448-3e123d83e0e1\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n ff53cef6-1773-4067-8473-4f823067b722\r\n \r\n \r\n ResourceId\r\n 3958653693786389562\r\n \r\n \r\n BackendStampId\r\n 8e8b42d1-72f9-4506-9291-b48125c38d0f\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-us\r\n \r\n 8a433d75-e7ba-4062-b9ea-02be05a6b474\r\n west us\r\n \r\n \r\n WACis\r\n CisVault\r\n OneSDK-avirupch\r\n \r\n 1.1\r\n 0537b90c-21c0-4d41-b1ce-48cdbb5dc98d\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n e7b9e848-2f14-47a9-9bad-d77ce5f0ed9a\r\n \r\n \r\n ResourceId\r\n 7541213550276549295\r\n \r\n \r\n BackendStampId\r\n 7ef900f6-ad91-497d-a9c5-2742b7ed4a75\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n WACis\r\n CisVault\r\n OneSDK-avirupch2\r\n \r\n 1.1\r\n ee3a7da5-d122-42eb-b02b-dd6161fc626b\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n e7b9e848-2f14-47a9-9bad-d77ce5f0ed9a\r\n \r\n \r\n ResourceId\r\n 7165349060819837375\r\n \r\n \r\n BackendStampId\r\n 7ef900f6-ad91-497d-a9c5-2742b7ed4a75\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n WACis\r\n CisVault\r\n OneSDK-Resource\r\n \r\n 1.1\r\n df9da875-d5b9-47f3-a8d1-a5819e56a898\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n e7b9e848-2f14-47a9-9bad-d77ce5f0ed9a\r\n \r\n \r\n ResourceId\r\n 1975530557201809476\r\n \r\n \r\n BackendStampId\r\n 7ef900f6-ad91-497d-a9c5-2742b7ed4a75\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CloudServiceCisVaultST141031EA\r\n \r\n CloudServiceCisVaultST141031EA\r\n East Asia\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113EUS\r\n \r\n CloudServiceCisVaultST14113EUS\r\n East US\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113JPE\r\n \r\n CloudServiceCisVaultST14113JPE\r\n Japan East\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113JPW\r\n \r\n CloudServiceCisVaultST14113JPW\r\n Japan West\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113NE\r\n \r\n CloudServiceCisVaultST14113NE\r\n North Europe\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113SEA\r\n \r\n CloudServiceCisVaultST14113SEA\r\n Southeast Asia\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113WE\r\n \r\n CloudServiceCisVaultST14113WE\r\n West Europe\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113WUS\r\n \r\n CloudServiceCisVaultST14113WUS\r\n West US\r\n \r\n \r\n \r\n CloudServiceCisVaultST14114SEA\r\n \r\n CloudServiceCisVaultST14114SEA\r\n Southeast Asia\r\n \r\n \r\n \r\n japancs\r\n \r\n 2b192d62-ca75-4cb5-8736-1e8b30afec32\r\n Japan East\r\n \r\n \r\n \r\n japancsw\r\n \r\n 3b679670-756f-4603-bc0d-ab75c0eaa6fb\r\n Japan West\r\n \r\n \r\n \r\n MyCloudService\r\n \r\n 5bfde7b9-ab53-420c-9adc-f77554ee492b\r\n Japan West\r\n \r\n \r\n WACiS\r\n CiSVault\r\n JPWsmoketestJohn\r\n \r\n 1.1\r\n fda2e259-d101-4723-b727-fb11e33a7436\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n a84366fd-4dbc-48aa-a3b7-ae61bea20620\r\n \r\n \r\n ResourceId\r\n 6778614164335460954\r\n \r\n \r\n BackendStampId\r\n 1a9ce821-796d-4402-a594-a6eae5767ad8\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n ParvezPSTest\r\n \r\n 63b8154c-3395-4566-bdc6-f1eb76fc8f89\r\n West US\r\n \r\n \r\n \r\n RecoveryServices-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-east-asia\r\n \r\n 9fac8b3d-4795-494b-ad8a-3dc00d8c03e8\r\n east asia\r\n \r\n \r\n \r\n RecoveryServices-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-east-us\r\n \r\n a41e4655-2e73-4e97-bb71-7d39e3f6191b\r\n east us\r\n \r\n \r\n \r\n RecoveryServices-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-southeast-asia\r\n \r\n 3fcbc01e-5b95-4770-bfba-252f07e28838\r\n southeast asia\r\n \r\n \r\n \r\n RecoveryServices-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-europe\r\n \r\n c8854e24-afa3-4d7f-91af-58fedd6e7ca9\r\n west europe\r\n \r\n \r\n \r\n RecoveryServices-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-us\r\n \r\n 81528a97-8b3c-4516-b682-21c8c946a668\r\n west us\r\n \r\n \r\n",
+ "ResponseHeaders": {
+ "Content-Length": [
+ "19405"
+ ],
+ "Content-Type": [
+ "application/xml; charset=utf-8"
+ ],
+ "x-ms-servedbyregion": [
+ "ussouth2"
+ ],
+ "x-ms-request-id": [
+ "7b6fd4e4bee35b358898f0a4e033a1db"
+ ],
+ "Cache-Control": [
+ "no-cache"
+ ],
+ "Date": [
+ "Thu, 18 Dec 2014 12:49:34 GMT"
+ ],
+ "Server": [
+ "1.0.6198.167",
+ "(rd_rdfe_stable.141203-1417)",
+ "Microsoft-HTTPAPI/2.0"
+ ]
+ },
+ "StatusCode": 200
+ },
+ {
+ "RequestUri": "/062c67a6-019b-40af-a775-c4dc1abe56ed/cloudservices/CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-us/resources/WACis/~/CiSVault/OneSDK-Resource/api/devices?api-version=2014-01-01.1.0",
+ "EncodedRequestUri": "LzA2MmM2N2E2LTAxOWItNDBhZi1hNzc1LWM0ZGMxYWJlNTZlZC9jbG91ZHNlcnZpY2VzL0Npc1NlcnZpY2UtRFRZSEM1TllCNEJVVFYzWkhGTlNFNUVLSVpaR0xHWVI0NE9KVUw1T1FHRzRJMkVNWU9aQS13ZXN0LXVzL3Jlc291cmNlcy9XQUNpcy9+L0NpU1ZhdWx0L09uZVNESy1SZXNvdXJjZS9hcGkvZGV2aWNlcz9hcGktdmVyc2lvbj0yMDE0LTAxLTAxLjEuMA==",
+ "RequestMethod": "GET",
+ "RequestBody": "",
+ "RequestHeaders": {
+ "Accept": [
+ "application/xml"
+ ],
+ "Accept-Language": [
+ "en-US"
+ ],
+ "x-ms-client-request-id": [
+ "c1946240-087b-4919-b0d0-ec4442bf1845_PS"
+ ],
+ "x-ms-version": [
+ "2014-01-01"
+ ],
+ "User-Agent": [
+ "Microsoft.WindowsAzure.Management.StorSimple.StorSimpleManagementClient/1.0.0.0"
+ ]
+ },
+ "ResponseBody": "\r\n \r\n 0\r\n 2014-11-28T06:04:49.2510897Z\r\n Unknown\r\n 1095364144128\r\n 0\r\n en-US\r\n Unknown\r\n 0\r\n \r\n 29f9be68-04f7-437d-a466-b90a1ed324b5\r\n 6.3.9600.17215\r\n Avirupch_App3\r\n true\r\n false\r\n \r\n 100\r\n 6\r\n 4147483648\r\n 123456789\r\n Online\r\n iqn.1991-05.com.microsoft:storsimple100-123456789-target\r\n Pacific Standard Time\r\n 1099511627776\r\n Appliance\r\n 0\r\n 0\r\n \r\n \r\n 0\r\n 2014-12-11T17:33:21.6765566Z\r\n Unknown\r\n 32985348833280\r\n 0\r\n en-US\r\n Unknown\r\n 0\r\n \r\n 2b4bda4e-5ab6-4668-a681-ca47cee7ca64\r\n 6.3.9600.17215\r\n test-madhurta\r\n false\r\n false\r\n West US\r\n 1100\r\n 0\r\n 0\r\n 2B4BDA4E-5AB6-4668-A681-CA47CEE7CA64\r\n Offline\r\n iqn.1991-05.com.microsoft:storsimple1100-2b4bda4e-5ab6-4668-a681-ca47cee7ca64-target\r\n UTC\r\n 32985348833280\r\n VirtualAppliance\r\n 0\r\n 0\r\n \r\n",
+ "ResponseHeaders": {
+ "Content-Length": [
+ "2472"
+ ],
+ "Content-Type": [
+ "application/xml; charset=utf-8"
+ ],
+ "Expires": [
+ "-1"
+ ],
+ "Pragma": [
+ "no-cache"
+ ],
+ "x-ms-servedbyregion": [
+ "ussouth2"
+ ],
+ "x-ms-client-request-id": [
+ "c1946240-087b-4919-b0d0-ec4442bf1845_PS,c1946240-087b-4919-b0d0-ec4442bf1845_PS"
+ ],
+ "Strict-Transport-Security": [
+ "max-age=15724800; includeSubDomains,max-age=15724800; includeSubDomains"
+ ],
+ "x-ms-request-id": [
+ "6b2f66aee24f5e3fbbaaa15003f0672f"
+ ],
+ "Cache-Control": [
+ "no-cache"
+ ],
+ "Date": [
+ "Thu, 18 Dec 2014 12:49:36 GMT"
+ ],
+ "Server": [
+ "1.0.6198.167",
+ "(rd_rdfe_stable.141203-1417)",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "X-Powered-By": [
+ "ASP.NET"
+ ]
+ },
+ "StatusCode": 200
+ },
+ {
+ "RequestUri": "/062c67a6-019b-40af-a775-c4dc1abe56ed/cloudservices/CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-us/resources/WACis/~/CiSVault/OneSDK-Resource/stamps/7ef900f6-ad91-497d-a9c5-2742b7ed4a75/secretmanagement/publickey?api-version=2014-01-01.1.0",
+ "EncodedRequestUri": "LzA2MmM2N2E2LTAxOWItNDBhZi1hNzc1LWM0ZGMxYWJlNTZlZC9jbG91ZHNlcnZpY2VzL0Npc1NlcnZpY2UtRFRZSEM1TllCNEJVVFYzWkhGTlNFNUVLSVpaR0xHWVI0NE9KVUw1T1FHRzRJMkVNWU9aQS13ZXN0LXVzL3Jlc291cmNlcy9XQUNpcy9+L0NpU1ZhdWx0L09uZVNESy1SZXNvdXJjZS9zdGFtcHMvN2VmOTAwZjYtYWQ5MS00OTdkLWE5YzUtMjc0MmI3ZWQ0YTc1L3NlY3JldG1hbmFnZW1lbnQvcHVibGlja2V5P2FwaS12ZXJzaW9uPTIwMTQtMDEtMDEuMS4w",
+ "RequestMethod": "GET",
+ "RequestBody": "",
+ "RequestHeaders": {
+ "Accept": [
+ "application/xml"
+ ],
+ "Accept-Language": [
+ "en-US"
+ ],
+ "x-ms-client-request-id": [
+ "6868ae09-c96c-4554-bf82-83ef46d8ec26_PS"
+ ],
+ "x-ms-version": [
+ "2014-01-01"
+ ],
+ "User-Agent": [
+ "Microsoft.WindowsAzure.Management.StorSimple.StorSimpleManagementClient/1.0.0.0"
+ ]
+ },
+ "ResponseBody": "\r\n EAAAAH/n8WeCQBimBXNIArQtLGliov1nVuoOYLCry/yBWCdDFajYwo6v7PKBYuEkv7I/lfvfh908SM5QQ/Vj5sUeZVLsck98NJuXv/ziR/VXbgSAjxIIDwpDlgBIV3dfhigen2dmp8SjKT2mCGZ81kDf0wub/vRo/ktp3tZbU0yJnP/ueTQo3pZco/J1mJMHCxjqymbFfRg54ex0Go/Z4CxjuNlTN1Pe7q7ohP61KxQ7o1R1qJdLHTaslOdYiSNzDrHNzrGjXEz322wlzZL6+hGRy7LQP06BO4xvJPIwF4k0+k/U0AQ4GtotQ9KWyDeEjuwN2htEOSkwzRnetnzBX45129CkrzyvdeGI4clZz8KOrcMyIUL66hXyK9e1gyllLU+0aU1HEQ127dJwrHYtHYdw/UjPFlVJFi2DpO6SWJCCX13DOpvCeMvrdvyHp40Y/j+Uvg7miKRWrvRnuKLoxhgAPhX4SL4Py2CHQmodp+Yl5Mqv+arqv4EwZH+Pjo4AOYJzyJ/xJma3cBK9VXsVw4B6r392EUdscf+WRY4lL2VoEVbmXklUIMlmecyDaCxiZblzFreD1DJyOTJrlZIvQXKj7zmm8RjY+p54Sivc5RZ21Swk7nWtTArZlr7zf3B394TnzfdIcqLR6hkOw6cH1bkJEivEtkxmv8mKRywmYnsCo1F0GEtZOE+b/xjqnTcG+JUAXJ8vErUMkwmE2sXGr9F6DZuBOqXYtHh0XNorl78DzYRnMcANQYTJ9JG9LUN7Tp9NzqfApKL6Vxe1IgUyuO+XR0DauEaGmZTAZIK3OzVFO2SU6ASmlnjZT5Rzk8GGi1unvWQYyhwHHNlMqsoWl1R5ugeD5dy5STXOOGUGrBDLS2P3vS52Id/x+bBc/Zv8i+V7EOt2103Ejs5VeCaDBbFWPa7AKnUjrI7nUCtHfVXJRCx8t0aqAPfYRImcve2phrSzR6LxwzhlgsPjG5JWJGuYEcCd6CJw9fOmX98WptHPOGUaxlOBqqCGjOK98oCwZN/EaPueB9ry9/RAxcioNhuc20EnqMBGXzj1j2a1Eyu022IC/nkmiKvFEnl6YA0uU+iG+aC7CQxJcindk7CSoazDJwWwnueVxGy1w2cCu03giUvnRmBhs8UyZqDEE4ASx4fq+g/d6TWSZGgJd713XhNGSsyaAfuB6jowkxp2ayhqSSigDPYy1DDrGYCf2msxTBVoRquWJkXMV8O0J8XbflIIs07hAYLl6SllR11Aoskp9owpryREzTAm+dhm9ZX8ChGJU02mgFD+2iAaFNyWAwmM2xShTXCq7AnfJ7fJIwNaT/VjeJlaQx8ch7lIWFxsMOjohNl2z5dGdid3LLPmMueBx+RvO91RAj50zQEgnPUq5Fb6pxEHrQahC4Q1i47NKmHb2LXmqnyvSQgqeQeeNw1WqsKVtVgGsUl/cqwMTbdd/u6mG9Mr5y8Rw0kW829Yf48mcw29bi6Ye3vNUb64HRgnBVozKlRK3AVKj9IgDHzu7MwEb+zxDUS3m2r5cnXH69U/uA==\r\n \r\n 24260B738017EE3EBE3CC75225A3ABB204D871A0\r\n",
+ "ResponseHeaders": {
+ "Content-Length": [
+ "1862"
+ ],
+ "Content-Type": [
+ "application/xml; charset=utf-8"
+ ],
+ "Expires": [
+ "-1"
+ ],
+ "Pragma": [
+ "no-cache"
+ ],
+ "x-ms-servedbyregion": [
+ "ussouth2"
+ ],
+ "x-ms-client-request-id": [
+ "6868ae09-c96c-4554-bf82-83ef46d8ec26_PS,6868ae09-c96c-4554-bf82-83ef46d8ec26_PS"
+ ],
+ "Strict-Transport-Security": [
+ "max-age=15724800; includeSubDomains,max-age=15724800; includeSubDomains"
+ ],
+ "x-ms-request-id": [
+ "10045ed435015dcf82384f8360feb689"
+ ],
+ "Cache-Control": [
+ "no-cache"
+ ],
+ "Date": [
+ "Thu, 18 Dec 2014 12:49:38 GMT"
+ ],
+ "Server": [
+ "1.0.6198.167",
+ "(rd_rdfe_stable.141203-1417)",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "X-Powered-By": [
+ "ASP.NET"
+ ]
+ },
+ "StatusCode": 200
+ }
+ ],
+ "Names": {},
+ "Variables": {
+ "SubscriptionId": "062c67a6-019b-40af-a775-c4dc1abe56ed"
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/SessionRecords/Microsoft.WindowsAzure.Commands.StorSimple.Test.ScenarioTests.BackupPolicyTests/TestNewBackupPolicyConfig.json b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/SessionRecords/Microsoft.WindowsAzure.Commands.StorSimple.Test.ScenarioTests.BackupPolicyTests/TestNewBackupPolicyConfig.json
new file mode 100644
index 000000000000..c0acc0c11b72
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/SessionRecords/Microsoft.WindowsAzure.Commands.StorSimple.Test.ScenarioTests.BackupPolicyTests/TestNewBackupPolicyConfig.json
@@ -0,0 +1,179 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "/062c67a6-019b-40af-a775-c4dc1abe56ed/CloudServices",
+ "EncodedRequestUri": "LzA2MmM2N2E2LTAxOWItNDBhZi1hNzc1LWM0ZGMxYWJlNTZlZC9DbG91ZFNlcnZpY2Vz",
+ "RequestMethod": "GET",
+ "RequestBody": "",
+ "RequestHeaders": {
+ "x-ms-version": [
+ "2013-03-01"
+ ],
+ "User-Agent": [
+ "Microsoft.WindowsAzure.Management.Scheduler.CloudServiceManagementClient/3.0.0.0"
+ ]
+ },
+ "ResponseBody": "\r\n \r\n AzCisIntRunnerWUS\r\n \r\n AzCisIntRunnerWUS\r\n West US\r\n \r\n \r\n WACis\r\n CisVault\r\n AzCisIntRunnerWUS\r\n \r\n 1.1\r\n 227f07eb-392b-4cc8-8972-baf13a6299f6\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n e7b9e848-2f14-47a9-9bad-d77ce5f0ed9a\r\n \r\n \r\n ResourceId\r\n 164364985811234912\r\n \r\n \r\n BackendStampId\r\n 7ef900f6-ad91-497d-a9c5-2742b7ed4a75\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisProdCSEA01\r\n \r\n 8a5ca166-7394-49c4-90bf-c5c10cc891bc\r\n East Asia\r\n \r\n \r\n WACiS\r\n CiSVault\r\n CisProdResEA01\r\n \r\n 1.1\r\n 5b45ac98-8cd8-45ca-993d-43643b03d5d5\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 64437628-f3e5-4d8a-928b-44b2c9889117\r\n \r\n \r\n ResourceId\r\n 4627730753422042572\r\n \r\n \r\n BackendStampId\r\n b0fbf6e0-4c86-4dc9-a74a-99f5148cfaab\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisProdCSNE01\r\n \r\n a6fcbf5d-433c-4248-ab3e-2d002847cbc1\r\n North Europe\r\n \r\n \r\n \r\n CisProdCSSEA01\r\n \r\n d5e0ba9a-f87e-4dc5-8c14-f0ff7389a40f\r\n Southeast Asia\r\n \r\n \r\n WACiS\r\n CiSVault\r\n CisProdResSEA01\r\n \r\n 1.1\r\n b8851cc1-98f1-4f57-852f-7179be0175f3\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 1cf1938f-b7f4-4be1-96e6-567e8057402b\r\n \r\n \r\n ResourceId\r\n 5075532093917877646\r\n \r\n \r\n BackendStampId\r\n 290b924d-c44a-41dc-89ee-a997105110c5\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisProdCSWE01\r\n \r\n fe1ced8c-78f1-4165-b60c-c40684f69300\r\n West Europe\r\n \r\n \r\n WACiS\r\n CiSVault\r\n CisProdResWE01\r\n \r\n 1.1\r\n f24cdf9e-ebe0-4acc-8cef-a4a46fe79c37\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n ff53cef6-1773-4067-8473-4f823067b722\r\n \r\n \r\n ResourceId\r\n 2009177452664442965\r\n \r\n \r\n BackendStampId\r\n 8e8b42d1-72f9-4506-9291-b48125c38d0f\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CiSProdEACS01\r\n \r\n f2cb7490-fc5f-4292-8d46-d8d08c677f78\r\n East Asia\r\n \r\n \r\n \r\n CiSProdNECS01\r\n \r\n 2319d679-db7d-44ed-a90b-0fac9ccfeff8\r\n North Europe\r\n \r\n \r\n \r\n CiSProdNECS02\r\n \r\n 0ae9fbd2-0f15-4d30-9d0c-052bf8a374b4\r\n North Europe\r\n \r\n \r\n \r\n CiSProdSEACS01\r\n \r\n f3900e44-ace6-4d11-8e1b-8ee42102b450\r\n Southeast Asia\r\n \r\n \r\n \r\n CiSProdWECS01\r\n \r\n a3052591-2669-47ce-98ab-337c5fb9db20\r\n West Europe\r\n \r\n \r\n \r\n CiSProdWECS02\r\n \r\n 0dbeae1e-4e4d-4cf0-97ea-04300b1ae771\r\n West Europe\r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-Australia-East\r\n \r\n 39509ffc-374f-4eeb-aa67-7c10ea817d46\r\n Australia East\r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-Australia-Southeast\r\n \r\n b25d9509-76a1-4e4e-9896-46f72b02ff11\r\n Australia Southeast\r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-east-asia\r\n \r\n 063a9747-e74e-42a0-a934-e907f0ae62ff\r\n east asia\r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-east-us\r\n \r\n d5aa1928-d752-4aec-8863-925d5810eddd\r\n east us\r\n \r\n \r\n WACis\r\n CisVault\r\n eus1410smoketest\r\n \r\n 1.1\r\n ac5750ee-5b1b-488a-9b95-aa351c57927a\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 8f764ff5-e5cf-48ad-83ad-941967b2b3de\r\n \r\n \r\n ResourceId\r\n 280409181064783549\r\n \r\n \r\n BackendStampId\r\n 8ba344e5-fd0a-46f1-8df3-34295e520f28\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-japan-east\r\n \r\n 9ac4dc08-77b3-40b7-a4ff-18f546e7cb67\r\n japan east\r\n \r\n \r\n WACis\r\n CisVault\r\n PreQfe2Res\r\n \r\n 1.1\r\n 6d6526a5-e3b0-487b-94e0-3ea37304d02d\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 1fdbbe77-1522-48a0-b8bb-08fc3a5538a0\r\n \r\n \r\n ResourceId\r\n 6617468074916048322\r\n \r\n \r\n BackendStampId\r\n 1b48cca2-9a1a-441d-a9e3-efa8043c61bf\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-japan-west\r\n \r\n f634db14-e5e4-4c74-b0d1-112088bae978\r\n japan west\r\n \r\n \r\n WACis\r\n CisVault\r\n jpwSmokeTestrajsing\r\n \r\n 1.1\r\n 997c1105-f304-411f-b075-285ab4a10e70\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n a84366fd-4dbc-48aa-a3b7-ae61bea20620\r\n \r\n \r\n ResourceId\r\n 1538313057736326684\r\n \r\n \r\n BackendStampId\r\n 1a9ce821-796d-4402-a594-a6eae5767ad8\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-north-europe\r\n \r\n 31be64d6-8656-4c44-aab4-f57329d39317\r\n north europe\r\n \r\n \r\n WACis\r\n CisVault\r\n nesmoke1410\r\n \r\n 1.1\r\n cf9c0707-0b7f-4802-8e9c-dd9a4fc5b81a\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 5bbb0b31-877c-4d43-9f55-bfde5b22e284\r\n \r\n \r\n ResourceId\r\n 9009498038937266079\r\n \r\n \r\n BackendStampId\r\n 1001f743-93e2-4b98-8e3a-8891b96c9967\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-southeast-asia\r\n \r\n cfd274d6-a650-4521-ac6d-2357512bf2da\r\n southeast asia\r\n \r\n \r\n WACis\r\n CisVault\r\n Oct29SaaSBugBash\r\n \r\n 1.1\r\n 45f83bb9-f30f-4a02-92e1-27a09beae9bc\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n 1cf1938f-b7f4-4be1-96e6-567e8057402b\r\n \r\n \r\n ResourceId\r\n 1140492213348126260\r\n \r\n \r\n BackendStampId\r\n 290b924d-c44a-41dc-89ee-a997105110c5\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-europe\r\n \r\n 9662b3da-b74b-4773-a3c4-c520e4566795\r\n west europe\r\n \r\n \r\n WACis\r\n CisVault\r\n azcistest1208\r\n \r\n 1.1\r\n c23da0f9-1623-4d31-a3ad-88ce4b83c868\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n ff53cef6-1773-4067-8473-4f823067b722\r\n \r\n \r\n ResourceId\r\n 826983654462536656\r\n \r\n \r\n BackendStampId\r\n 8e8b42d1-72f9-4506-9291-b48125c38d0f\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n WACis\r\n CisVault\r\n bvtsignoff0311\r\n \r\n 1.1\r\n 274882c4-548e-4d6e-9448-3e123d83e0e1\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n ff53cef6-1773-4067-8473-4f823067b722\r\n \r\n \r\n ResourceId\r\n 3958653693786389562\r\n \r\n \r\n BackendStampId\r\n 8e8b42d1-72f9-4506-9291-b48125c38d0f\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-us\r\n \r\n 8a433d75-e7ba-4062-b9ea-02be05a6b474\r\n west us\r\n \r\n \r\n WACis\r\n CisVault\r\n OneSDK-avirupch\r\n \r\n 1.1\r\n 0537b90c-21c0-4d41-b1ce-48cdbb5dc98d\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n e7b9e848-2f14-47a9-9bad-d77ce5f0ed9a\r\n \r\n \r\n ResourceId\r\n 7541213550276549295\r\n \r\n \r\n BackendStampId\r\n 7ef900f6-ad91-497d-a9c5-2742b7ed4a75\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n WACis\r\n CisVault\r\n OneSDK-avirupch2\r\n \r\n 1.1\r\n ee3a7da5-d122-42eb-b02b-dd6161fc626b\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n e7b9e848-2f14-47a9-9bad-d77ce5f0ed9a\r\n \r\n \r\n ResourceId\r\n 7165349060819837375\r\n \r\n \r\n BackendStampId\r\n 7ef900f6-ad91-497d-a9c5-2742b7ed4a75\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n WACis\r\n CisVault\r\n OneSDK-Resource\r\n \r\n 1.1\r\n df9da875-d5b9-47f3-a8d1-a5819e56a898\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n e7b9e848-2f14-47a9-9bad-d77ce5f0ed9a\r\n \r\n \r\n ResourceId\r\n 1975530557201809476\r\n \r\n \r\n BackendStampId\r\n 7ef900f6-ad91-497d-a9c5-2742b7ed4a75\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n CloudServiceCisVaultST141031EA\r\n \r\n CloudServiceCisVaultST141031EA\r\n East Asia\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113EUS\r\n \r\n CloudServiceCisVaultST14113EUS\r\n East US\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113JPE\r\n \r\n CloudServiceCisVaultST14113JPE\r\n Japan East\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113JPW\r\n \r\n CloudServiceCisVaultST14113JPW\r\n Japan West\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113NE\r\n \r\n CloudServiceCisVaultST14113NE\r\n North Europe\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113SEA\r\n \r\n CloudServiceCisVaultST14113SEA\r\n Southeast Asia\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113WE\r\n \r\n CloudServiceCisVaultST14113WE\r\n West Europe\r\n \r\n \r\n \r\n CloudServiceCisVaultST14113WUS\r\n \r\n CloudServiceCisVaultST14113WUS\r\n West US\r\n \r\n \r\n \r\n CloudServiceCisVaultST14114SEA\r\n \r\n CloudServiceCisVaultST14114SEA\r\n Southeast Asia\r\n \r\n \r\n \r\n japancs\r\n \r\n 2b192d62-ca75-4cb5-8736-1e8b30afec32\r\n Japan East\r\n \r\n \r\n \r\n japancsw\r\n \r\n 3b679670-756f-4603-bc0d-ab75c0eaa6fb\r\n Japan West\r\n \r\n \r\n \r\n MyCloudService\r\n \r\n 5bfde7b9-ab53-420c-9adc-f77554ee492b\r\n Japan West\r\n \r\n \r\n WACiS\r\n CiSVault\r\n JPWsmoketestJohn\r\n \r\n 1.1\r\n fda2e259-d101-4723-b727-fb11e33a7436\r\n Started\r\n Ok\r\n \r\n \r\n StampId\r\n a84366fd-4dbc-48aa-a3b7-ae61bea20620\r\n \r\n \r\n ResourceId\r\n 6778614164335460954\r\n \r\n \r\n BackendStampId\r\n 1a9ce821-796d-4402-a594-a6eae5767ad8\r\n \r\n \r\n \r\n Create\r\n Succeeded\r\n \r\n \r\n \r\n \r\n \r\n \r\n ParvezPSTest\r\n \r\n 63b8154c-3395-4566-bdc6-f1eb76fc8f89\r\n West US\r\n \r\n \r\n \r\n RecoveryServices-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-east-asia\r\n \r\n 9fac8b3d-4795-494b-ad8a-3dc00d8c03e8\r\n east asia\r\n \r\n \r\n \r\n RecoveryServices-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-east-us\r\n \r\n a41e4655-2e73-4e97-bb71-7d39e3f6191b\r\n east us\r\n \r\n \r\n \r\n RecoveryServices-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-southeast-asia\r\n \r\n 3fcbc01e-5b95-4770-bfba-252f07e28838\r\n southeast asia\r\n \r\n \r\n \r\n RecoveryServices-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-europe\r\n \r\n c8854e24-afa3-4d7f-91af-58fedd6e7ca9\r\n west europe\r\n \r\n \r\n \r\n RecoveryServices-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-us\r\n \r\n 81528a97-8b3c-4516-b682-21c8c946a668\r\n west us\r\n \r\n \r\n",
+ "ResponseHeaders": {
+ "Content-Length": [
+ "19405"
+ ],
+ "Content-Type": [
+ "application/xml; charset=utf-8"
+ ],
+ "x-ms-servedbyregion": [
+ "ussouth2"
+ ],
+ "x-ms-request-id": [
+ "a783003796f85876b2d829114d73d179"
+ ],
+ "Cache-Control": [
+ "no-cache"
+ ],
+ "Date": [
+ "Thu, 18 Dec 2014 12:15:23 GMT"
+ ],
+ "Server": [
+ "1.0.6198.167",
+ "(rd_rdfe_stable.141203-1417)",
+ "Microsoft-HTTPAPI/2.0"
+ ]
+ },
+ "StatusCode": 200
+ },
+ {
+ "RequestUri": "/062c67a6-019b-40af-a775-c4dc1abe56ed/cloudservices/CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-us/resources/WACis/~/CiSVault/OneSDK-Resource/api/devices?api-version=2014-01-01.1.0",
+ "EncodedRequestUri": "LzA2MmM2N2E2LTAxOWItNDBhZi1hNzc1LWM0ZGMxYWJlNTZlZC9jbG91ZHNlcnZpY2VzL0Npc1NlcnZpY2UtRFRZSEM1TllCNEJVVFYzWkhGTlNFNUVLSVpaR0xHWVI0NE9KVUw1T1FHRzRJMkVNWU9aQS13ZXN0LXVzL3Jlc291cmNlcy9XQUNpcy9+L0NpU1ZhdWx0L09uZVNESy1SZXNvdXJjZS9hcGkvZGV2aWNlcz9hcGktdmVyc2lvbj0yMDE0LTAxLTAxLjEuMA==",
+ "RequestMethod": "GET",
+ "RequestBody": "",
+ "RequestHeaders": {
+ "Accept": [
+ "application/xml"
+ ],
+ "Accept-Language": [
+ "en-US"
+ ],
+ "x-ms-client-request-id": [
+ "dfb6c8e0-ec21-4d9c-8592-3137e9709fc3_PS"
+ ],
+ "x-ms-version": [
+ "2014-01-01"
+ ],
+ "User-Agent": [
+ "Microsoft.WindowsAzure.Management.StorSimple.StorSimpleManagementClient/1.0.0.0"
+ ]
+ },
+ "ResponseBody": "\r\n \r\n 0\r\n 2014-11-28T06:04:49.2510897Z\r\n Unknown\r\n 1097364144128\r\n 0\r\n en-US\r\n Unknown\r\n 0\r\n \r\n 29f9be68-04f7-437d-a466-b90a1ed324b5\r\n 6.3.9600.17215\r\n Avirupch_App3\r\n true\r\n false\r\n \r\n 100\r\n 6\r\n 2147483648\r\n 123456789\r\n Online\r\n iqn.1991-05.com.microsoft:storsimple100-123456789-target\r\n Pacific Standard Time\r\n 1099511627776\r\n Appliance\r\n 0\r\n 0\r\n \r\n \r\n 0\r\n 2014-12-11T17:33:21.6765566Z\r\n Unknown\r\n 32985348833280\r\n 0\r\n en-US\r\n Unknown\r\n 0\r\n \r\n 2b4bda4e-5ab6-4668-a681-ca47cee7ca64\r\n 6.3.9600.17215\r\n test-madhurta\r\n false\r\n false\r\n West US\r\n 1100\r\n 0\r\n 0\r\n 2B4BDA4E-5AB6-4668-A681-CA47CEE7CA64\r\n Offline\r\n iqn.1991-05.com.microsoft:storsimple1100-2b4bda4e-5ab6-4668-a681-ca47cee7ca64-target\r\n UTC\r\n 32985348833280\r\n VirtualAppliance\r\n 0\r\n 0\r\n \r\n",
+ "ResponseHeaders": {
+ "Content-Length": [
+ "2472"
+ ],
+ "Content-Type": [
+ "application/xml; charset=utf-8"
+ ],
+ "Expires": [
+ "-1"
+ ],
+ "Pragma": [
+ "no-cache"
+ ],
+ "x-ms-servedbyregion": [
+ "ussouth2"
+ ],
+ "x-ms-client-request-id": [
+ "dfb6c8e0-ec21-4d9c-8592-3137e9709fc3_PS,dfb6c8e0-ec21-4d9c-8592-3137e9709fc3_PS"
+ ],
+ "Strict-Transport-Security": [
+ "max-age=15724800; includeSubDomains,max-age=15724800; includeSubDomains"
+ ],
+ "x-ms-request-id": [
+ "8e392d1a633e584eb2f4d73996732373"
+ ],
+ "Cache-Control": [
+ "no-cache"
+ ],
+ "Date": [
+ "Thu, 18 Dec 2014 12:15:28 GMT"
+ ],
+ "Server": [
+ "1.0.6198.167",
+ "(rd_rdfe_stable.141203-1417)",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "X-Powered-By": [
+ "ASP.NET"
+ ]
+ },
+ "StatusCode": 200
+ },
+ {
+ "RequestUri": "/062c67a6-019b-40af-a775-c4dc1abe56ed/cloudservices/CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-us/resources/WACis/~/CiSVault/OneSDK-Resource/stamps/7ef900f6-ad91-497d-a9c5-2742b7ed4a75/secretmanagement/publickey?api-version=2014-01-01.1.0",
+ "EncodedRequestUri": "LzA2MmM2N2E2LTAxOWItNDBhZi1hNzc1LWM0ZGMxYWJlNTZlZC9jbG91ZHNlcnZpY2VzL0Npc1NlcnZpY2UtRFRZSEM1TllCNEJVVFYzWkhGTlNFNUVLSVpaR0xHWVI0NE9KVUw1T1FHRzRJMkVNWU9aQS13ZXN0LXVzL3Jlc291cmNlcy9XQUNpcy9+L0NpU1ZhdWx0L09uZVNESy1SZXNvdXJjZS9zdGFtcHMvN2VmOTAwZjYtYWQ5MS00OTdkLWE5YzUtMjc0MmI3ZWQ0YTc1L3NlY3JldG1hbmFnZW1lbnQvcHVibGlja2V5P2FwaS12ZXJzaW9uPTIwMTQtMDEtMDEuMS4w",
+ "RequestMethod": "GET",
+ "RequestBody": "",
+ "RequestHeaders": {
+ "Accept": [
+ "application/xml"
+ ],
+ "Accept-Language": [
+ "en-US"
+ ],
+ "x-ms-client-request-id": [
+ "65f78ed2-7f3d-46d7-91a0-9cb6eccec419_PS"
+ ],
+ "x-ms-version": [
+ "2014-01-01"
+ ],
+ "User-Agent": [
+ "Microsoft.WindowsAzure.Management.StorSimple.StorSimpleManagementClient/1.0.0.0"
+ ]
+ },
+ "ResponseBody": "\r\n EAAAAH/n8WeCQBimBXNIArQtLGliov1nVuoOYLCry/yBWCdDFajYwo6v7PKBYuEkv7I/lfvfh908SM5QQ/Vj5sUeZVLsck98NJuXv/ziR/VXbgSAjxIIDwpDlgBIV3dfhigen2dmp8SjKT2mCGZ81kDf0wub/vRo/ktp3tZbU0yJnP/ueTQo3pZco/J1mJMHCxjqymbFfRg54ex0Go/Z4CxjuNlTN1Pe7q7ohP61KxQ7o1R1qJdLHTaslOdYiSNzDrHNzrGjXEz322wlzZL6+hGRy7LQP06BO4xvJPIwF4k0+k/U0AQ4GtotQ9KWyDeEjuwN2htEOSkwzRnetnzBX45129CkrzyvdeGI4clZz8KOrcMyIUL66hXyK9e1gyllLU+0aU1HEQ127dJwrHYtHYdw/UjPFlVJFi2DpO6SWJCCX13DOpvCeMvrdvyHp40Y/j+Uvg7miKRWrvRnuKLoxhgAPhX4SL4Py2CHQmodp+Yl5Mqv+arqv4EwZH+Pjo4AOYJzyJ/xJma3cBK9VXsVw4B6r392EUdscf+WRY4lL2VoEVbmXklUIMlmecyDaCxiZblzFreD1DJyOTJrlZIvQXKj7zmm8RjY+p54Sivc5RZ21Swk7nWtTArZlr7zf3B394TnzfdIcqLR6hkOw6cH1bkJEivEtkxmv8mKRywmYnsCo1F0GEtZOE+b/xjqnTcG+JUAXJ8vErUMkwmE2sXGr9F6DZuBOqXYtHh0XNorl78DzYRnMcANQYTJ9JG9LUN7Tp9NzqfApKL6Vxe1IgUyuO+XR0DauEaGmZTAZIK3OzVFO2SU6ASmlnjZT5Rzk8GGi1unvWQYyhwHHNlMqsoWl1R5ugeD5dy5STXOOGUGrBDLS2P3vS52Id/x+bBc/Zv8i+V7EOt2103Ejs5VeCaDBbFWPa7AKnUjrI7nUCtHfVXJRCx8t0aqAPfYRImcve2phrSzR6LxwzhlgsPjG5JWJGuYEcCd6CJw9fOmX98WptHPOGUaxlOBqqCGjOK98oCwZN/EaPueB9ry9/RAxcioNhuc20EnqMBGXzj1j2a1Eyu022IC/nkmiKvFEnl6YA0uU+iG+aC7CQxJcindk7CSoazDJwWwnueVxGy1w2cCu03giUvnRmBhs8UyZqDEE4ASx4fq+g/d6TWSZGgJd713XhNGSsyaAfuB6jowkxp2ayhqSSigDPYy1DDrGYCf2msxTBVoRquWJkXMV8O0J8XbflIIs07hAYLl6SllR11Aoskp9owpryREzTAm+dhm9ZX8ChGJU02mgFD+2iAaFNyWAwmM2xShTXCq7AnfJ7fJIwNaT/VjeJlaQx8ch7lIWFxsMOjohNl2z5dGdid3LLPmMueBx+RvO91RAj50zQEgnPUq5Fb6pxEHrQahC4Q1i47NKmHb2LXmqnyvSQgqeQeeNw1WqsKVtVgGsUl/cqwMTbdd/u6mG9Mr5y8Rw0kW829Yf48mcw29bi6Ye3vNUb64HRgnBVozKlRK3AVKj9IgDHzu7MwEb+zxDUS3m2r5cnXH69U/uA==\r\n \r\n 24260B738017EE3EBE3CC75225A3ABB204D871A0\r\n",
+ "ResponseHeaders": {
+ "Content-Length": [
+ "1862"
+ ],
+ "Content-Type": [
+ "application/xml; charset=utf-8"
+ ],
+ "Expires": [
+ "-1"
+ ],
+ "Pragma": [
+ "no-cache"
+ ],
+ "x-ms-servedbyregion": [
+ "ussouth2"
+ ],
+ "x-ms-client-request-id": [
+ "65f78ed2-7f3d-46d7-91a0-9cb6eccec419_PS,65f78ed2-7f3d-46d7-91a0-9cb6eccec419_PS"
+ ],
+ "Strict-Transport-Security": [
+ "max-age=15724800; includeSubDomains,max-age=15724800; includeSubDomains"
+ ],
+ "x-ms-request-id": [
+ "009d30c69fca5207b552d0cd9a849566"
+ ],
+ "Cache-Control": [
+ "no-cache"
+ ],
+ "Date": [
+ "Thu, 18 Dec 2014 12:15:28 GMT"
+ ],
+ "Server": [
+ "1.0.6198.167",
+ "(rd_rdfe_stable.141203-1417)",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "X-Powered-By": [
+ "ASP.NET"
+ ]
+ },
+ "StatusCode": 200
+ }
+ ],
+ "Names": {},
+ "Variables": {
+ "SubscriptionId": "062c67a6-019b-40af-a775-c4dc1abe56ed"
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/app.config b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/app.config
new file mode 100644
index 000000000000..fb92df3d1885
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/app.config
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/packages.config b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/packages.config
new file mode 100644
index 000000000000..56c5975bcf97
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/packages.config
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/GetAzureStorSimpleDeviceBackupPolicy.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/GetAzureStorSimpleDeviceBackupPolicy.cs
new file mode 100644
index 000000000000..2232f64e4d9d
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/GetAzureStorSimpleDeviceBackupPolicy.cs
@@ -0,0 +1,88 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Linq;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure;
+using System;
+using System.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// commandlet that returns one or more BackupPolicy objects for a given DeviceName and BackupPolicyName
+ ///
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleDeviceBackupPolicy"),
+ OutputType(typeof(IList), typeof(BackupPolicyDetails))]
+ public class GetAzureStorSimpleDeviceBackupPolicy:StorSimpleCmdletBase
+ {
+ private string deviceId = null;
+
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string DeviceName { get; set; }
+
+ [Alias("Name")]
+ [Parameter(Position = 1, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupPolicyName)]
+ public string BackupPolicyName { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ if (!ProcessParameters())
+ return;
+ if (string.IsNullOrEmpty(BackupPolicyName))
+ {
+ BackupPolicyListResponse backupPolicyList = null;
+ backupPolicyList = StorSimpleClient.GetAllBackupPolicies(deviceId);
+ WriteObject(backupPolicyList.BackupPolicies);
+ WriteVerbose(string.Format(Resources.BackupPolicyGet_StatusMessage, backupPolicyList.BackupPolicies.Count, backupPolicyList.BackupPolicies.Count > 1 ? "ies" : "y"));
+ }
+ else
+ {
+ GetBackupPolicyDetailsResponse backupPolicyDetail = null;
+ backupPolicyDetail = StorSimpleClient.GetBackupPolicyByName(deviceId, BackupPolicyName);
+ if (string.IsNullOrEmpty(backupPolicyDetail.BackupPolicyDetails.InstanceId))
+ WriteVerbose(string.Format(Resources.NoBackupPolicyWithGivenNameFound,BackupPolicyName,DeviceName));
+ else
+ {
+ WriteObject(backupPolicyDetail.BackupPolicyDetails);
+ WriteVerbose(string.Format(Resources.BackupPolicyFound, backupPolicyDetail.BackupPolicyDetails.InstanceId));
+ }
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+
+ private bool ProcessParameters()
+ {
+ deviceId = StorSimpleClient.GetDeviceId(DeviceName);
+
+ if (deviceId == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return false;
+ }
+ return true;
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupPolicy.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupPolicy.cs
new file mode 100644
index 000000000000..953b7e90a8e4
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupPolicy.cs
@@ -0,0 +1,138 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Linq;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure;
+using System;
+using System.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// this commandlet will let you create a new backuppolicy with schedules
+ ///
+ [Cmdlet(VerbsCommon.New, "AzureStorSimpleDeviceBackupPolicy")]
+ public class NewAzureStorSimpleDeviceBackupPolicy:StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string DeviceName { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageNewBackupPolicyName)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string BackupPolicyName { get; set; }
+
+ [Parameter(Position = 2, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupsToAddList)]
+ public PSObject[] BackupSchedulesToAdd { get; set; }
+
+ [Parameter(Position = 3, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeIdsToAddList)]
+ public PSObject[] VolumeIdsToAdd { get; set; }
+
+ [Parameter(Position = 4, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ private string deviceId = null;
+ private List volumeIdsToAddList = null;
+ private NewBackupPolicyConfig newConfig = null;
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ newConfig = new NewBackupPolicyConfig();
+ newConfig.Name = BackupPolicyName;
+
+ if (!ProcessParameters())
+ return;
+
+ if (WaitForComplete.IsPresent)
+ {
+ var taskStatusInfo = StorSimpleClient.CreateBackupPolicy(deviceId, newConfig);
+ HandleSyncTaskResponse(taskStatusInfo, "add");
+ if (taskStatusInfo.AsyncTaskAggregatedResult == AsyncTaskAggregatedResult.Succeeded)
+ {
+ var createdBackupPolicy = StorSimpleClient.GetBackupPolicyByName(deviceId, BackupPolicyName);
+ WriteObject(createdBackupPolicy.BackupPolicyDetails);
+ }
+ }
+ else
+ {
+ var taskresult = StorSimpleClient.CreateBackupPolicyAsync(deviceId, newConfig);
+ HandleAsyncTaskResponse(taskresult, "add");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ private bool ProcessParameters()
+ {
+ deviceId = StorSimpleClient.GetDeviceId(DeviceName);
+ if (deviceId == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return false;
+ }
+
+ ProcessAddSchedules();
+ ProcessAddVolumeIds();
+ return true;
+ }
+
+ ///
+ /// reads the PSObject[] containing BackupSchedule objects and generates a list out of them
+ ///
+ private void ProcessAddSchedules()
+ {
+ newConfig.BackupSchedules = new List();
+ if (BackupSchedulesToAdd.Length > 0)
+ {
+ foreach (var addSchedule in BackupSchedulesToAdd)
+ {
+ newConfig.BackupSchedules.Add((BackupScheduleBase) addSchedule.BaseObject);
+ }
+ }
+ else
+ {
+ throw new ArgumentException(Resources.InvalidBackupSchedulesToAddParameter);
+ }
+ }
+
+ ///
+ /// reads the PSObject[] containing VolumeId objects (string) and generates a list out of them
+ ///
+ private void ProcessAddVolumeIds()
+ {
+ volumeIdsToAddList = new List();
+ if (VolumeIdsToAdd.Length > 0)
+ {
+ foreach (var volume in VolumeIdsToAdd)
+ {
+ volumeIdsToAddList.Add((string) volume.BaseObject);
+ }
+ }
+ else
+ {
+ throw new ArgumentException(Resources.InvalidVolumeIdsToAddParameter);
+ }
+ newConfig.VolumeIds = volumeIdsToAddList;
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupScheduleAddConfig.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupScheduleAddConfig.cs
new file mode 100644
index 000000000000..1c708fa20bf4
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupScheduleAddConfig.cs
@@ -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 System.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure;
+using System;
+using System.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// this commandlet will help in creating a new Addconfig that can be used to create a new BackupPolicy subsequently
+ ///
+ [Cmdlet(VerbsCommon.New, "AzureStorSimpleDeviceBackupScheduleAddConfig"),OutputType(typeof(BackupScheduleBase))]
+ public class NewAzureStorSimpleDeviceBackupScheduleAddConfig : StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupTypeDesc)]
+ [ValidateNotNullOrEmptyAttribute]
+ [ValidateSet("LocalSnapshot", "CloudSnapshot")]
+ public string BackupType { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageRecurrenceTypeDesc)]
+ [ValidateNotNullOrEmptyAttribute]
+ [ValidateSet("Minutes", "Hourly", "Daily", "Weekly")]
+ public string RecurrenceType { get; set; }
+
+ [Parameter(Position = 2, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageRecurrenceValueDesc)]
+ [ValidateNotNullOrEmptyAttribute]
+ public int RecurrenceValue { get; set; }
+
+ [Parameter(Position = 3, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageRetentionCountDesc)]
+ [ValidateNotNullOrEmptyAttribute]
+ public long RetentionCount { get; set; }
+
+ [Parameter(Position = 4, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupStartFromDesc)]
+ public string StartFromDateTime { get; set; }
+
+ [Parameter(Position = 5, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupEnabledDesc)]
+ public bool Enabled { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ BackupScheduleBase newScheduleObject = new BackupScheduleBase();
+ newScheduleObject.BackupType = (BackupType)Enum.Parse(typeof(BackupType), BackupType);
+ newScheduleObject.Status = Enabled ? ScheduleStatus.Enabled : ScheduleStatus.Disabled;
+ newScheduleObject.RetentionCount = RetentionCount;
+ newScheduleObject.StartTime = StartFromDateTime;
+ newScheduleObject.Recurrence = new ScheduleRecurrence();
+ newScheduleObject.Recurrence.RecurrenceType = (RecurrenceType)Enum.Parse(typeof(RecurrenceType), RecurrenceType);
+ newScheduleObject.Recurrence.RecurrenceValue = RecurrenceValue;
+ StorSimpleClient.ValidateBackupScheduleBase(newScheduleObject);
+ WriteObject(newScheduleObject);
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupScheduleUpdateConfig.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupScheduleUpdateConfig.cs
new file mode 100644
index 000000000000..93d2d78cffb6
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/NewAzureStorSimpleDeviceBackupScheduleUpdateConfig.cs
@@ -0,0 +1,83 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure;
+using System;
+using System.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+
+ ///
+ /// this commandlet will help in creating a new updateconfig that can be used to update an existing backuppolicy subsequently
+ ///
+ [Cmdlet(VerbsCommon.New, "AzureStorSimpleDeviceBackupScheduleUpdateConfig"), OutputType(typeof(BackupScheduleUpdateRequest))]
+ public class NewAzureStorSimpleDeviceBackupScheduleUpdateConfig:StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupScheduleId)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string Id { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupTypeDesc)]
+ [ValidateNotNullOrEmptyAttribute]
+ [ValidateSet("LocalSnapshot", "CloudSnapshot")]
+ public string BackupType { get; set; }
+
+ [Parameter(Position = 2, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageRecurrenceTypeDesc)]
+ [ValidateNotNullOrEmptyAttribute]
+ [ValidateSet("Minutes", "Hourly", "Daily", "Weekly")]
+ public string RecurrenceType { get; set; }
+
+ [Parameter(Position = 3, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageRecurrenceValueDesc)]
+ [ValidateNotNullOrEmptyAttribute]
+ public int RecurrenceValue { get; set; }
+
+ [Parameter(Position = 4, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageRetentionCountDesc)]
+ [ValidateNotNullOrEmptyAttribute]
+ public long RetentionCount { get; set; }
+
+ [Parameter(Position = 5, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupStartFromDesc)]
+ public string StartFromDateTime { get; set; }
+
+ [Parameter(Position = 6, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupEnabledDesc)]
+ public bool Enabled { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ BackupScheduleUpdateRequest updateScheduleObject = new BackupScheduleUpdateRequest();
+ updateScheduleObject.BackupType = (BackupType)Enum.Parse(typeof(BackupType), BackupType);
+ updateScheduleObject.Status = Enabled ? ScheduleStatus.Enabled : ScheduleStatus.Disabled;
+ updateScheduleObject.RetentionCount = RetentionCount;
+ updateScheduleObject.StartTime = StartFromDateTime;
+ updateScheduleObject.Recurrence = new ScheduleRecurrence();
+ updateScheduleObject.Recurrence.RecurrenceType = (RecurrenceType)Enum.Parse(typeof(RecurrenceType), RecurrenceType);
+ updateScheduleObject.Recurrence.RecurrenceValue = RecurrenceValue;
+ updateScheduleObject.Id = Id;
+ StorSimpleClient.ValidateBackupScheduleUpdateRequest(updateScheduleObject);
+ WriteObject(updateScheduleObject);
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/RemoveAzureStorSimpleDeviceBackupPolicy.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/RemoveAzureStorSimpleDeviceBackupPolicy.cs
new file mode 100644
index 000000000000..cdd4f583bc2a
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/RemoveAzureStorSimpleDeviceBackupPolicy.cs
@@ -0,0 +1,117 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Linq;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure;
+using System;
+using System.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsCommon.Remove, "AzureStorSimpleDeviceBackupPolicy", DefaultParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ public class RemoveAzureStorSimpleDeviceBackupPolicy : StorSimpleCmdletBase
+ {
+ private string deviceId = null;
+
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string DeviceName { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupPolicyIdToDelete, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ public string BackupPolicyId { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupPolicyToDelete, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject)]
+ public BackupPolicyDetails BackupPolicy { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageForce)]
+ public SwitchParameter Force { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ private string backupPolicyIdFinal = null;
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ if (!ProcessParameters())
+ return;
+ ConfirmAction(
+ Force.IsPresent,
+ string.Format(Resources.RemoveASSDBackupPolicyWarningMessage, backupPolicyIdFinal),
+ string.Format(Resources.RemoveASSDBackupPolicyMessage, backupPolicyIdFinal),
+ backupPolicyIdFinal,
+ () =>
+ {
+ if (WaitForComplete.IsPresent)
+ {
+ WriteVerbose("About to run a task to remove your backuppolicy!");
+ var deleteTaskStatusInfo = StorSimpleClient.DeleteBackupPolicy(deviceId, backupPolicyIdFinal);
+ HandleSyncTaskResponse(deleteTaskStatusInfo, "remove");
+ }
+ else
+ {
+ WriteVerbose("About to create a task to remove your backuppolicy!");
+ var taskresult = StorSimpleClient.DeleteBackupPolicyAsync(deviceId, backupPolicyIdFinal);
+ HandleAsyncTaskResponse(taskresult, "remove");
+ }
+ });
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+
+ private bool ProcessParameters()
+ {
+ deviceId = StorSimpleClient.GetDeviceId(DeviceName);
+
+ if (deviceId == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return false;
+ }
+ switch (ParameterSetName)
+ {
+ case StorSimpleCmdletParameterSet.IdentifyById:
+ Guid backuppolicyIdGuid;
+ bool isIdValidGuid = Guid.TryParse(BackupPolicyId,out backuppolicyIdGuid);
+ if (string.IsNullOrEmpty(BackupPolicyId)
+ || !isIdValidGuid)
+ throw new ArgumentException(Resources.InvalidBackupPolicyIdParameter);
+ else
+ {
+ backupPolicyIdFinal = BackupPolicyId;
+ }
+ break;
+ case StorSimpleCmdletParameterSet.IdentifyByObject:
+ if (BackupPolicy == null || string.IsNullOrEmpty(BackupPolicy.InstanceId))
+ throw new ArgumentException(Resources.InvalidBackupPolicyObjectParameter);
+ else
+ {
+ backupPolicyIdFinal = BackupPolicy.InstanceId;
+ }
+ break;
+ }
+ return true;
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/SetAzureStorSimpleDeviceBackupPolicy.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/SetAzureStorSimpleDeviceBackupPolicy.cs
new file mode 100644
index 000000000000..2e0e9d739f8e
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupPolicy/SetAzureStorSimpleDeviceBackupPolicy.cs
@@ -0,0 +1,183 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Diagnostics;
+using System.Linq;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure;
+using System;
+using System.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using System.Text.RegularExpressions;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// this commandlet can be used to update an existing backuppolicy
+ ///
+ [Cmdlet(VerbsCommon.Set, "AzureStorSimpleDeviceBackupPolicy"), OutputType(typeof(BackupPolicyDetails))]
+ public class SetAzureStorSimpleDeviceBackupPolicy: StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string DeviceName { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupPolicyIdToUpdate)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string BackupPolicyId { get; set; }
+
+ [Parameter(Position = 2, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupPolicyNameChange)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string BackupPolicyName { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupScheduleBaseObjsToAdd)]
+ public PSObject[] BackupSchedulesToAdd { get; set; }
+
+ [Parameter(Position = 4, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupScheduleBaseObjsToUpdate)]
+ public PSObject[] BackupSchedulesToUpdate { get; set; }
+
+ [Parameter(Position = 5, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupScheduleBaseObjsToDelete)]
+ public PSObject[] BackupScheduleIdsToDelete { get; set; }
+
+ [Parameter(Position = 6, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeObjsToUpdate)]
+ public PSObject[] VolumeIdsToUpdate { get; set; }
+
+ [Parameter(Position = 7, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ private string deviceId = null;
+ private List schedulesToAdd = null;
+ private List schedulesToUpdate = null;
+ private List scheduleIdsTodelete = null;
+ private List volumeIdsToUpdate = null;
+
+ private UpdateBackupPolicyConfig updateConfig = null;
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ updateConfig = new UpdateBackupPolicyConfig();
+ if (!ProcessParameters())
+ return;
+
+ updateConfig.InstanceId = BackupPolicyId;
+ updateConfig.Name = BackupPolicyName;
+ updateConfig.IsPolicyRenamed = true;
+ updateConfig.BackupSchedulesToBeAdded = schedulesToAdd;
+ updateConfig.BackupSchedulesToBeUpdated = schedulesToUpdate;
+ updateConfig.BackupSchedulesToBeDeleted = scheduleIdsTodelete;
+ updateConfig.VolumeIds = volumeIdsToUpdate;
+
+ if (WaitForComplete.IsPresent)
+ {
+ WriteVerbose("About to run a task to update your backuppolicy!");
+ var taskStatusInfo = StorSimpleClient.UpdateBackupPolicy(deviceId, BackupPolicyId, updateConfig);
+ HandleSyncTaskResponse(taskStatusInfo, "update");
+ if (taskStatusInfo.AsyncTaskAggregatedResult == AsyncTaskAggregatedResult.Succeeded)
+ {
+ var updatedBackupPolicy = StorSimpleClient.GetBackupPolicyByName(deviceId, BackupPolicyName);
+ WriteObject(updatedBackupPolicy.BackupPolicyDetails);
+ }
+ }
+ else
+ {
+ WriteVerbose("About to create a task to update your backuppolicy!");
+ var taskresult = StorSimpleClient.UpdateBackupPolicyAsync(deviceId, BackupPolicyId, updateConfig);
+ HandleAsyncTaskResponse(taskresult, "Update");
+ }
+ }
+
+ catch(Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+
+
+ private bool ProcessParameters()
+ {
+ deviceId = StorSimpleClient.GetDeviceId(DeviceName);
+ if (deviceId == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return false;
+ }
+
+ ProcessAddSchedules();
+ ProcessUpdateSchedules();
+ ProcessDeleteScheduleIds();
+ ProcessUpdateVolumeIds();
+ return true;
+ }
+
+ private void ProcessAddSchedules()
+ {
+ if (BackupSchedulesToAdd!=null && BackupSchedulesToAdd.Length > 0)
+ {
+ schedulesToAdd = new List();
+ foreach (var addSchedule in BackupSchedulesToAdd)
+ {
+ BackupScheduleBase backupSchedule = (BackupScheduleBase)addSchedule.BaseObject;
+ schedulesToAdd.Add(backupSchedule);
+ }
+ }
+ updateConfig.BackupSchedulesToBeAdded = schedulesToAdd;
+ }
+
+ private void ProcessUpdateSchedules()
+ {
+ if (BackupSchedulesToUpdate!=null && BackupSchedulesToUpdate.Length > 0)
+ {
+ schedulesToUpdate = new List();
+ foreach (var updateSchedule in BackupSchedulesToUpdate)
+ {
+ BackupScheduleUpdateRequest updateschedule = (BackupScheduleUpdateRequest) updateSchedule.BaseObject;
+ schedulesToUpdate.Add(updateschedule);
+ }
+ }
+ updateConfig.BackupSchedulesToBeUpdated = schedulesToUpdate;
+ }
+
+ private void ProcessDeleteScheduleIds()
+ {
+ if (BackupScheduleIdsToDelete!=null && BackupScheduleIdsToDelete.Length > 0)
+ {
+ scheduleIdsTodelete = new List();
+ foreach (var deleteSchedule in BackupScheduleIdsToDelete)
+ {
+ string scheduleIdToDelete = (string)deleteSchedule.BaseObject;
+ scheduleIdsTodelete.Add(scheduleIdToDelete);
+ }
+ }
+ updateConfig.BackupSchedulesToBeDeleted = scheduleIdsTodelete;
+ }
+
+ private void ProcessUpdateVolumeIds()
+ {
+ if (VolumeIdsToUpdate!=null && VolumeIdsToUpdate.Length > 0)
+ {
+ volumeIdsToUpdate = new List();
+ foreach (var volume in VolumeIdsToUpdate)
+ {
+ string volumeId = (string)volume.BaseObject;
+ volumeIdsToUpdate.Add(volumeId);
+ }
+ }
+ updateConfig.VolumeIds = volumeIdsToUpdate;
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/GetAzureStorSimpleDeviceBackup.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/GetAzureStorSimpleDeviceBackup.cs
new file mode 100644
index 000000000000..ebc1a4e7e9f0
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/GetAzureStorSimpleDeviceBackup.cs
@@ -0,0 +1,171 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Linq;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure;
+using System;
+using System.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleDeviceBackup", DefaultParameterSetName = StorSimpleCmdletParameterSet.Empty),OutputType(typeof(GetBackupResponse))]
+ public class GetAzureStorSimpleDeviceBackup: StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.Empty)]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById2)]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject)]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject2)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string DeviceName { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupPolicyId, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ public string BackupPolicyId { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, HelpMessage =StorSimpleCmdletHelpMessage.HelpMessageVolumeIdForBackup , ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById2)]
+ public string VolumeId { get; set; }
+
+ [Alias("BackupPolicyDetails")]
+ [Parameter(Position = 1, Mandatory = true, ValueFromPipeline = true, HelpMessage =StorSimpleCmdletHelpMessage.HelpMessageBackupPolicyDetailsObject ,ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject)]
+ public BackupPolicyDetails BackupPolicy { get; set; }
+
+ [Alias("VirtualDiskInfo")]
+ [Parameter(Position = 1, Mandatory = true, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeObject, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject2)]
+ public VirtualDisk Volume { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage =StorSimpleCmdletHelpMessage.HelpMessageStartFrom )]
+ public string From { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageEndTime)]
+ public string To { get; set; }
+
+ [Parameter(Position = 4, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageFirstDesc)]
+ [ValidateRange(0, Int32.MaxValue)]
+ public int? First { get; set; }
+
+ [Parameter(Position = 5, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageSkipDesc)]
+ [ValidateRange(0, Int32.MaxValue)]
+ public int? Skip { get; set; }
+
+ private string deviceId = null;
+ private string IdToPass;
+ private string isAllSelected;
+ private string filterType;
+ private DateTime FromDateTime;
+ private DateTime ToDateTime;
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ if (!ProcessParameters()) return;
+ GetBackupResponse backupList = null;
+ backupList = StorSimpleClient.GetAllBackups(deviceId, filterType, isAllSelected, IdToPass,
+ FromDateTime.ToString(),
+ ToDateTime.ToString(), Skip == null ? "0" : Skip.ToString(), First == null ? null : First.ToString());
+ WriteObject(backupList.BackupSetsList, true);
+ WriteVerbose(string.Format(Resources.BackupsReturnedCount, backupList.BackupSetsList.Count));
+ if (backupList.NextPageUri != null
+ && backupList.NextPageStartIdentifier!="1")
+ {
+ if (First != null)
+ {
+ //user has provided First(Top) parameter while calling the commandlet
+ //so we need to provide it to him for calling the next page
+ WriteVerbose(string.Format(Resources.BackupNextPageFormatMessage, First, backupList.NextPageStartIdentifier));
+ }
+ else
+ {
+ //user has NOT provided First(Top) parameter while calling the commandlet
+ //so we DONT need to provide it to him for calling the next page
+ WriteVerbose(string.Format(Resources.BackupNextPagewithNoFirstMessage, backupList.NextPageStartIdentifier));
+ }
+ }
+ else
+ {
+ WriteVerbose(Resources.BackupNoMorePagesMessage);
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+
+ private bool ProcessParameters()
+ {
+ deviceId = StorSimpleClient.GetDeviceId(DeviceName);
+
+ if (deviceId == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return false;
+ }
+
+ if (string.IsNullOrEmpty(From))
+ FromDateTime = DateTime.MinValue;
+ else
+ {
+ bool result = DateTime.TryParse(From, out FromDateTime);
+ if (!result)
+ throw new ArgumentException(Resources.InvalidFromMessage);
+ }
+ if (string.IsNullOrEmpty(To))
+ ToDateTime = DateTime.MaxValue;
+ else
+ {
+ bool result = DateTime.TryParse(To, out ToDateTime);
+ if (!result)
+ throw new ArgumentException(Resources.InvalidFromMessage);
+ }
+
+ switch (ParameterSetName)
+ {
+ case StorSimpleCmdletParameterSet.IdentifyById:
+ filterType = "BackupPolicy";
+ isAllSelected = Boolean.FalseString;
+ IdToPass = BackupPolicyId;
+ break;
+ case StorSimpleCmdletParameterSet.IdentifyById2:
+ filterType = "Volume";
+ isAllSelected = Boolean.FalseString;
+ IdToPass = VolumeId;
+ break;
+ case StorSimpleCmdletParameterSet.IdentifyByObject:
+ filterType = "BackupPolicy";
+ isAllSelected = Boolean.FalseString;
+ IdToPass = BackupPolicy.InstanceId;
+ break;
+ case StorSimpleCmdletParameterSet.IdentifyByObject2:
+ filterType = "Volume";
+ isAllSelected = Boolean.FalseString;
+ IdToPass = Volume.InstanceId;
+ break;
+ default:
+ //case where only deviceName is passed
+ filterType = "BackupPolicy";
+ isAllSelected = Boolean.TrueString;
+ IdToPass = null;
+ break;
+ }
+ return true;
+ }
+
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/RemoveAzureStorSimpleDeviceBackup.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/RemoveAzureStorSimpleDeviceBackup.cs
new file mode 100644
index 000000000000..2180c2486448
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/RemoveAzureStorSimpleDeviceBackup.cs
@@ -0,0 +1,118 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Linq;
+using System.Management.Automation;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure;
+using System;
+using System.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// This commandlet will remove a given backup from the device
+ ///
+ [Cmdlet(VerbsCommon.Remove, "AzureStorSimpleDeviceBackup", DefaultParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ public class RemoveAzureStorSimpleDeviceBackup:StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string DeviceName { get; set; }
+
+
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupIdToDelete,ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ public string BackupId { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true,ValueFromPipeline = true,HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupIdToDelete,ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject)]
+ public Backup Backup { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageForce)]
+ public SwitchParameter Force { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ private string deviceId = null;
+ private string finalBackupId = null;
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ if (!ProcessParameters()) return;
+ ConfirmAction(
+ Force.IsPresent,
+ string.Format(Resources.RemoveASSDBackupWarningMessage, finalBackupId),
+ string.Format(Resources.RemoveASSDBackupMessage, finalBackupId),
+ BackupId,
+ () =>
+ {
+
+ if (WaitForComplete.IsPresent)
+ {
+ var deleteTaskStatusInfo = StorSimpleClient.DeleteBackup(deviceId, finalBackupId);
+ HandleSyncTaskResponse(deleteTaskStatusInfo, "remove");
+ }
+ else
+ {
+ var taskresult = StorSimpleClient.DeleteBackupAsync(deviceId, finalBackupId);
+ HandleAsyncTaskResponse(taskresult, "remove");
+ }
+ });
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+
+ private bool ProcessParameters()
+ {
+ deviceId = StorSimpleClient.GetDeviceId(DeviceName);
+
+ if (deviceId == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return false;
+ }
+ switch (ParameterSetName)
+ {
+ case StorSimpleCmdletParameterSet.IdentifyById:
+ if (string.IsNullOrEmpty(BackupId))
+ throw new ArgumentException(Resources.InvalidBackupIdParameter);
+ else
+ {
+ finalBackupId = BackupId;
+ }
+ break;
+ case StorSimpleCmdletParameterSet.IdentifyByObject:
+ if(Backup==null || string.IsNullOrEmpty(Backup.InstanceId))
+ throw new ArgumentException(Resources.InvalidBackupObjectParameter);
+ else
+ {
+ finalBackupId = Backup.InstanceId;
+ }
+ break;
+ }
+ return true;
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/StartAzureStorSimpleDeviceBackupJob.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/StartAzureStorSimpleDeviceBackupJob.cs
new file mode 100644
index 000000000000..3e7a44d92837
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/StartAzureStorSimpleDeviceBackupJob.cs
@@ -0,0 +1,97 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Linq;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure;
+using System;
+using System.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsLifecycle.Start, "AzureStorSimpleDeviceBackupJob", DefaultParameterSetName = StorSimpleCmdletParameterSet.Empty),OutputType(typeof(TaskResponse), typeof(TaskStatusInfo))]
+ public class StartAzureStorSimpleDeviceBackupJob : StorSimpleCmdletBase
+ {
+ private const string PARAMETERSET_BACKUPTYPE = "BackupTypeGiven";
+
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.Empty)]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = PARAMETERSET_BACKUPTYPE)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string DeviceName { get; set; }
+
+
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupPolicyIdForCreate, ParameterSetName = StorSimpleCmdletParameterSet.Empty)]
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupPolicyIdForCreate, ParameterSetName = PARAMETERSET_BACKUPTYPE)]
+ public string BackupPolicyId { get; set; }
+
+
+ [Parameter(Position = 2, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupTypeDesc, ParameterSetName = PARAMETERSET_BACKUPTYPE)]
+ [ValidateSet("LocalSnapshot", "CloudSnapshot")]
+ public string BackupType { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ private string deviceId = null;
+ private BackupNowRequest backupNowRequest = null;
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ ProcessParameters();
+ if (WaitForComplete.IsPresent)
+ {
+ var taskStatusInfo = StorSimpleClient.DoBackup(deviceId, BackupPolicyId, backupNowRequest);
+ HandleSyncTaskResponse(taskStatusInfo, "start");
+ }
+ else
+ {
+ var taskresult = StorSimpleClient.DoBackupAsync(deviceId, BackupPolicyId, backupNowRequest);
+ HandleAsyncTaskResponse(taskresult, "start");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+
+ private void ProcessParameters()
+ {
+ deviceId = StorSimpleClient.GetDeviceId(DeviceName);
+
+ if (deviceId == null)
+ {
+ WriteVerbose(Resources.NotFoundMessageDevice);
+ }
+
+ BackupType backupTypeSelected = Management.StorSimple.Models.BackupType.Invalid;
+ switch (ParameterSetName)
+ {
+ case StorSimpleCmdletParameterSet.Empty:
+ backupTypeSelected = Microsoft.WindowsAzure.Management.StorSimple.Models.BackupType.LocalSnapshot;
+ break;
+ case PARAMETERSET_BACKUPTYPE:
+ backupTypeSelected = (BackupType)Enum.Parse(typeof(BackupType), BackupType);
+ break;
+ }
+ backupNowRequest = new BackupNowRequest();
+ backupNowRequest.Type = backupTypeSelected;
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/StartAzureStorSimpleDeviceBackupRestoreJob.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/StartAzureStorSimpleDeviceBackupRestoreJob.cs
new file mode 100644
index 000000000000..402f3d05ed47
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/BackupSet/StartAzureStorSimpleDeviceBackupRestoreJob.cs
@@ -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 System.Linq;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure;
+using System;
+using System.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsLifecycle.Start, "AzureStorSimpleDeviceBackupRestoreJob",DefaultParameterSetName = StorSimpleCmdletParameterSet.Empty),OutputType(typeof(TaskResponse), typeof(TaskStatusInfo))]
+ public class StartAzureStorSimpleDeviceBackupRestoreJob: StorSimpleCmdletBase
+ {
+ private string deviceId = null;
+
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.Empty)]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ [ValidateNotNullOrEmptyAttribute]
+ public string DeviceName { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupIdToRestore, ParameterSetName = StorSimpleCmdletParameterSet.Empty)]
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageBackupIdToRestore, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ public string BackupId { get; set; }
+
+ [Parameter(Position = 2, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessagesnapshotIdToRestore, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById)]
+ public string SnapshotId { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ [Parameter(Position = 4, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageForce)]
+ public SwitchParameter Force { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ ProcessParameters();
+ ConfirmAction(
+ Force.IsPresent,
+ string.Format(Resources.StartASSDBackupRestoreJobWarningMessage, BackupId),
+ string.Format(Resources.StartASSDBackupRestoreJobMessage, BackupId),
+ BackupId,
+ () =>
+ {
+ RestoreBackupRequest request = new RestoreBackupRequest();
+ request.BackupSetId = BackupId;
+ request.SnapshotId = SnapshotId;
+
+ if (WaitForComplete.IsPresent)
+ {
+ var restoreBackupResult = StorSimpleClient.RestoreBackup(deviceId, request);
+ HandleSyncTaskResponse(restoreBackupResult, "start");
+ }
+ else
+ {
+ //async scenario
+ var taskresult = StorSimpleClient.RestoreBackupAsync(deviceId, request);
+ HandleAsyncTaskResponse(taskresult, "start");
+ }
+ });
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+
+ private void ProcessParameters()
+ {
+ deviceId = StorSimpleClient.GetDeviceId(DeviceName);
+
+ if (deviceId == null)
+ {
+ WriteVerbose(Resources.NotFoundMessageDevice);
+ }
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/GetAzureStorSimpleDeviceVolumeContainer.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/GetAzureStorSimpleDeviceVolumeContainer.cs
new file mode 100644
index 000000000000..48495d0117fc
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/GetAzureStorSimpleDeviceVolumeContainer.cs
@@ -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 System;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Collections.Generic;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+
+
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleDeviceVolumeContainer"),OutputType(typeof(DataContainer), typeof(IList))]
+ public class GetAzureStorSimpleDeviceVolumeContainer : StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceName { get; set; }
+
+ [Alias("Name")]
+ [Parameter(Position = 1, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDataContainerName)]
+ [ValidateNotNullOrEmpty]
+ public string VolumeContainerName { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ var deviceid = StorSimpleClient.GetDeviceId(DeviceName);
+
+ if (deviceid == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return;
+ }
+
+ if (VolumeContainerName == null)
+ {
+ var dataContainerList = StorSimpleClient.GetAllDataContainers(deviceid);
+ WriteObject(dataContainerList.DataContainers);
+ WriteVerbose(string.Format(Resources.ReturnedCountDataContainerMessage, dataContainerList.DataContainers.Count, dataContainerList.DataContainers.Count > 1 ? "s" : string.Empty));
+ }
+ else
+ {
+ var dataContainer = StorSimpleClient.GetDataContainer(deviceid, VolumeContainerName);
+ if(dataContainer != null
+ && dataContainer.DataContainerInfo != null
+ && dataContainer.DataContainerInfo.InstanceId != null)
+ {
+ WriteObject(dataContainer.DataContainerInfo);
+ WriteVerbose(string.Format(Resources.FoundDataContainerMessage, VolumeContainerName));
+ }
+ else
+ {
+ WriteVerbose(string.Format(Resources.NotFoundDataContainerMessage, VolumeContainerName));
+ }
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/NewAzureStorSimpleDeviceVolumeContainer.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/NewAzureStorSimpleDeviceVolumeContainer.cs
new file mode 100644
index 000000000000..0c2c00fe4d18
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/NewAzureStorSimpleDeviceVolumeContainer.cs
@@ -0,0 +1,140 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Encryption;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsCommon.New, "AzureStorSimpleDeviceVolumeContainer"), OutputType(typeof(TaskStatusInfo))]
+ public class NewAzureStorSimpleDeviceVolumeContainer : StorSimpleCmdletBase
+ {
+
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceName { get; set; }
+
+ [Alias("Name")]
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDataContainerName)]
+ [ValidateNotNullOrEmpty]
+ public string VolumeContainerName { get; set; }
+
+ [Alias("StorageAccount")]
+ [Parameter(Position = 2, Mandatory = true, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageSACObject)]
+ [ValidateNotNullOrEmpty]
+ public StorageAccountCredentialResponse PrimaryStorageAccountCredential { get; set; }
+
+ [Alias("CloudBandwidthInMbps")]
+ [Parameter(Position = 3, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDataContainerBandwidth)]
+ [ValidateNotNullOrEmpty]
+ public int BandWidthRateInMbps { get; set; }
+
+ [Parameter(Position = 4, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDataContainerEncryptionEnabled)]
+ [ValidateNotNullOrEmpty]
+ public bool? EncryptionEnabled { get; set; }
+
+ [Parameter(Position = 5, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDataContainerEncryptionkey)]
+ [ValidateNotNullOrEmpty]
+ public string EncryptionKey { get; set; }
+
+ [Parameter(Position = 6, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ string deviceid = StorSimpleClient.GetDeviceId(DeviceName);
+ if (deviceid == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return;
+ }
+
+ if(EncryptionEnabled == true && string.IsNullOrEmpty(EncryptionKey))
+ {
+ throw new ArgumentNullException("EncryptionKey");
+ }
+
+ string encryptedKey = null;
+ StorSimpleCryptoManager storSimpleCryptoManager = new StorSimpleCryptoManager(StorSimpleClient);
+ if (EncryptionEnabled == true)
+ {
+ WriteVerbose(Resources.EncryptionInProgressMessage);
+ storSimpleCryptoManager.EncryptSecretWithRakPub(EncryptionKey, out encryptedKey);
+ }
+
+ if (string.IsNullOrEmpty(PrimaryStorageAccountCredential.InstanceId))
+ {
+ //The SAC needs to be created inline
+ WriteVerbose(Resources.InlineSacCreationMessage);
+
+ var sac = PrimaryStorageAccountCredential;
+
+ //validate storage account credentials
+ bool storageAccountPresent;
+ string encryptedPassword;
+ string thumbprint;
+ string endpoint = GetEndpointFromHostname(sac.Hostname);
+ string location = GetStorageAccountLocation(sac.Name, out storageAccountPresent);
+ if (!storageAccountPresent
+ || !ValidateAndEncryptStorageCred(sac.Name, sac.Password, endpoint, out encryptedPassword, out thumbprint))
+ {
+ return;
+ }
+
+ sac.Password = encryptedPassword;
+ sac.PasswordEncryptionCertThumbprint = thumbprint;
+ sac.Location = location;
+ }
+
+ var dc = new DataContainerRequest
+ {
+ IsDefault = false,
+ Name = VolumeContainerName,
+ BandwidthRate = BandWidthRateInMbps,
+ IsEncryptionEnabled = EncryptionEnabled ?? false,
+ EncryptionKey = encryptedKey,
+ VolumeCount = 0,
+ PrimaryStorageAccountCredential = PrimaryStorageAccountCredential,
+ SecretsEncryptionThumbprint = storSimpleCryptoManager.GetSecretsEncryptionThumbprint()
+ };
+
+ if (WaitForComplete.IsPresent)
+ {
+ var taskStatus = StorSimpleClient.CreateDataContainer(deviceid, dc);
+ HandleSyncTaskResponse(taskStatus, "create");
+ if (taskStatus.AsyncTaskAggregatedResult == AsyncTaskAggregatedResult.Succeeded)
+ {
+ var createdDataContainer = StorSimpleClient.GetDataContainer(deviceid, VolumeContainerName);
+ WriteObject(createdDataContainer.DataContainerInfo);
+ }
+ }
+
+ else
+ {
+ var taskstatus = StorSimpleClient.CreateDataContainerAsync(deviceid, dc);
+ HandleAsyncTaskResponse(taskstatus, "create");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/RemoveAzureStorSimpleDeviceVolumeContainer.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/RemoveAzureStorSimpleDeviceVolumeContainer.cs
new file mode 100644
index 000000000000..1d0f877ef2d6
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/RemoveAzureStorSimpleDeviceVolumeContainer.cs
@@ -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 System;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsCommon.Remove, "AzureStorSimpleDeviceVolumeContainer"), OutputType(typeof(TaskStatusInfo))]
+ public class RemoveAzureStorSimpleDeviceVolumeContainer : StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceName { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDataContainerName)]
+ [ValidateNotNullOrEmpty]
+ public DataContainer VolumeContainer { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageForce)]
+ public SwitchParameter Force { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ ConfirmAction(Force.IsPresent,
+ Resources.RemoveWarningVolume,
+ Resources.RemoveConfirmationVolume,
+ string.Empty,
+ () =>
+ {
+ try
+ {
+ var deviceid = StorSimpleClient.GetDeviceId(DeviceName);
+
+ if (deviceid == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return;
+ }
+
+ if (WaitForComplete.IsPresent)
+ {
+ WriteVerbose("About to run a task to remove your Volume container!");
+ var taskstatusInfo = StorSimpleClient.DeleteDataContainer(deviceid, VolumeContainer.InstanceId);
+ HandleSyncTaskResponse(taskstatusInfo, "delete");
+ }
+ else
+ {
+ WriteVerbose("About to create a task to remove your Volume container!");
+ var taskresult = StorSimpleClient.DeleteDataContainerAsync(deviceid, VolumeContainer.InstanceId);
+ HandleAsyncTaskResponse(taskresult, "delete");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleDevice.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleDevice.cs
new file mode 100644
index 000000000000..ba053def9521
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleDevice.cs
@@ -0,0 +1,103 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Management.Automation;
+using System.Linq;
+using System;
+using System.Collections.Generic;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleDevice", DefaultParameterSetName = StorSimpleCmdletParameterSet.Empty),
+ OutputType(typeof(List), typeof(IEnumerable))]
+ public class GetAzureStorSimpleDevice : StorSimpleCmdletBase
+ {
+ [Alias("ID")]
+ [Parameter(Position = 0, Mandatory = false, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceId)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceId { get; set; }
+
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = false, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByName, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceName { get; set; }
+
+ [Parameter(Position = 1, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceType)]
+ [ValidateNotNullOrEmpty]
+ public string Type { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceModel)]
+ [ValidateNotNullOrEmpty]
+ public string ModelID { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceConfigRequired)]
+ public SwitchParameter Detailed { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ var deviceInfos = StorSimpleClient.GetAllDevices();
+ switch(ParameterSetName)
+ {
+ case StorSimpleCmdletParameterSet.IdentifyByName:
+ deviceInfos = deviceInfos.Where(x => x.FriendlyName.Equals(DeviceName, System.StringComparison.InvariantCultureIgnoreCase));
+ break;
+ case StorSimpleCmdletParameterSet.IdentifyById:
+ deviceInfos = deviceInfos.Where(x => x.DeviceId.Equals(DeviceId, System.StringComparison.InvariantCultureIgnoreCase));
+ break;
+ default:
+ break;
+ }
+
+ if (Type != null)
+ {
+ DeviceType deviceType;
+ bool parseSuccess = Enum.TryParse(Type, true, out deviceType);
+ if (parseSuccess)
+ {
+ deviceInfos = deviceInfos.Where(x => x.Type.Equals(deviceType));
+ }
+ }
+
+ if (ModelID != null)
+ {
+ deviceInfos = deviceInfos.Where(x => x.ModelDescription.Equals(ModelID, System.StringComparison.InvariantCultureIgnoreCase));
+ }
+
+ if (Detailed.IsPresent)
+ {
+ List deviceDetailsList = new List();
+ foreach (var deviceInfo in deviceInfos)
+ {
+ deviceDetailsList.Add(StorSimpleClient.GetDeviceDetails(deviceInfo.DeviceId));
+ }
+ WriteObject(deviceDetailsList, true);
+ }
+
+ else
+ {
+ WriteObject(deviceInfos, true);
+ }
+ WriteVerbose(string.Format(Resources.DeviceGet_StatusMessage, deviceInfos.Count(), deviceInfos.Count() > 1 ? "s" : string.Empty));
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleDeviceConnectedInitiator.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleDeviceConnectedInitiator.cs
new file mode 100644
index 000000000000..05454de02fc5
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleDeviceConnectedInitiator.cs
@@ -0,0 +1,75 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Linq;
+using System.Collections.Generic;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// Lists all the connected ISCSI initiators
+ ///
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleDeviceConnectedInitiator"), OutputType(typeof(List))]
+ public class GetAzureStorSimpleDeviceConnectedInitiator : StorSimpleCmdletBase
+ {
+ [Alias("ID")]
+ [Parameter(Position = 0, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceId)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceId { get; set; }
+
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByName, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceName { get; set; }
+
+ //not overriding BeginProcessing so resource context validation will happen here
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ List iscsiConnections = null;
+ var currentResourceName = StorSimpleClient.GetResourceContext().ResourceName;
+ string deviceIdFinal = null;
+ if(ParameterSetName == StorSimpleCmdletParameterSet.IdentifyByName)
+ {
+ var deviceToUse = StorSimpleClient.GetAllDevices().Where(x => x.FriendlyName.Equals(DeviceName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+ if (deviceToUse == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, currentResourceName , DeviceName));
+ WriteObject(null);
+ return;
+ }
+ deviceIdFinal = deviceToUse.DeviceId;
+ }
+ else
+ deviceIdFinal = DeviceId;
+
+ //verify that this device is configured
+ this.VerifyDeviceConfigurationCompleteForDevice(deviceIdFinal);
+ iscsiConnections = StorSimpleClient.GetAllIscsiConnections(deviceIdFinal);
+ WriteObject(iscsiConnections);
+ WriteVerbose(string.Format(Resources.IscsiConnectionGet_StatusMessage,iscsiConnections.Count, (iscsiConnections.Count > 1?"s":string.Empty)));
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleResource.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleResource.cs
new file mode 100644
index 000000000000..6740564079d7
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleResource.cs
@@ -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 System;
+using System.Management.Automation;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// this commandlet returns all resources available in your subscription
+ ///
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleResource"), OutputType(typeof(IEnumerable), typeof(ResourceCredentials))]
+ public class GetAzureStorSimpleResource : StorSimpleCmdletBase
+ {
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = false, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByName, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageResourceName)]
+ [ValidateNotNullOrEmpty]
+ public string ResourceName { get; set; }
+
+ //suppress resource check for this commandlet
+ public GetAzureStorSimpleResource() : base(false) { }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ var serviceList = StorSimpleClient.GetAllResources().Cast().ToList();
+ if(serviceList == null
+ || serviceList.Count() == 0)
+ {
+ WriteVerbose(Resources.NoResourceFoundInSubscriptionMessage);
+ WriteObject(null);
+ return;
+ }
+
+ if(ParameterSetName == StorSimpleCmdletParameterSet.IdentifyByName)
+ {
+ serviceList = serviceList.Where(x => x.ResourceName.Equals(ResourceName, System.StringComparison.InvariantCultureIgnoreCase)).Cast().ToList();
+ if (serviceList.Count() == 0)
+ {
+ WriteVerbose(string.Format(Resources.NoResourceFoundWithGivenNameInSubscriptionMessage, ResourceName));
+ WriteObject(null);
+ return;
+ }
+ }
+ this.WriteObject(serviceList, true);
+ WriteVerbose(string.Format(Resources.ResourceGet_StatusMessage, serviceList.Count(),(serviceList.Count() > 1 ? "s" : string.Empty)));
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleResourceContext.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleResourceContext.cs
new file mode 100644
index 000000000000..7ee2b5bd3577
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleResourceContext.cs
@@ -0,0 +1,42 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.WindowsAzure.Commands.StorSimple.Properties;
+using System;
+using System.Management.Automation;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// This commandlet will return the currently selected resource. If no resource is selected will throw a ResourceContextNotFoundException
+ ///
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleResourceContext"),OutputType(typeof(StorSimpleResourceContext))]
+ public class GetAzureStorSimpleResourceContext : StorSimpleCmdletBase
+ {
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ var currentContext = StorSimpleClient.GetResourceContext();
+ this.WriteObject(currentContext);
+ this.WriteVerbose(string.Format(Resources.ResourceContextFound,currentContext.ResourceName, currentContext.ResourceId));
+ }
+
+ catch(Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/SelectAzureStorSimpleResource.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/SelectAzureStorSimpleResource.cs
new file mode 100644
index 000000000000..35347c86f2d6
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/SelectAzureStorSimpleResource.cs
@@ -0,0 +1,86 @@
+// ----------------------------------------------------------------------------------
+//
+// 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 Microsoft.WindowsAzure.Commands.StorSimple.Encryption;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using System.Management.Automation;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// this commandlet will set a particular resource to the current context
+ ///
+ [Cmdlet(VerbsCommon.Select, "AzureStorSimpleResource"),OutputType(typeof(StorSimpleResourceContext))]
+ public class SelectAzureStorSimpleResource : StorSimpleCmdletBase
+ {
+ [Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true)]
+ [ValidateNotNullOrEmpty]
+ public string ResourceName { get; set; }
+
+ [Parameter(Mandatory = false, Position = 2, ValueFromPipelineByPropertyName = true)]
+ [ValidateNotNullOrEmpty]
+ public string RegistrationKey { get; set; }
+
+ //suppress resource check for this commandlet
+ public SelectAzureStorSimpleResource() : base(false) { }
+
+ ///
+ /// ProcessRecord of the command.
+ ///
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ this.WriteVerbose(Resources.ResourceContextInitializeMessage);
+ var resCred = StorSimpleClient.GetResourceDetails(ResourceName);
+ if (resCred == null)
+ {
+ this.WriteVerbose(Resources.NotFoundMessageResource);
+ throw GetGenericException(Resources.NotFoundMessageResource, null);
+ }
+
+ StorSimpleClient.SetResourceContext(resCred);
+ var deviceInfos = StorSimpleClient.GetAllDevices();
+ if (!deviceInfos.Any())
+ {
+ StorSimpleClient.ResetResourceContext();
+ throw base.GetGenericException(Resources.DeviceNotRegisteredMessage, null);
+ }
+
+ //now check for the key
+ if (string.IsNullOrEmpty(RegistrationKey))
+ {
+ this.WriteVerbose(Resources.RegistrationKeyNotPassedMessage);
+ }
+ else
+ {
+ this.WriteVerbose(Resources.RegistrationKeyPassedMessage);
+ EncryptionCmdLetHelper.PersistCIK(this, resCred.ResourceId, StorSimpleClient.ParseCIKFromRegistrationKey(RegistrationKey));
+ }
+ EncryptionCmdLetHelper.ValidatePersistedCIK(this, resCred.ResourceId);
+ this.WriteVerbose(Resources.SecretsValidationCompleteMessage);
+
+ this.WriteVerbose(Resources.SuccessMessageSetResourceContext);
+ var currentContext = StorSimpleClient.GetResourceContext();
+ this.WriteObject(currentContext);
+ }
+ catch(Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/GetAzureStorSimpleAccessControlRecord.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/GetAzureStorSimpleAccessControlRecord.cs
new file mode 100644
index 000000000000..2b8ca7a30c73
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/GetAzureStorSimpleAccessControlRecord.cs
@@ -0,0 +1,64 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Linq;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// Get a list of Access Control Records present in the StorSimple Manager Service Configuration or retrieves a specific named ACR Object
+ ///
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleAccessControlRecord"), OutputType(typeof(AccessControlRecord), typeof(IList))]
+ public class GetAzureStorSimpleAccessControlRecord : StorSimpleCmdletBase
+ {
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageACRName)]
+ public string ACRName { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ var allACRs = StorSimpleClient.GetAllAccessControlRecords();
+ if (ACRName == null)
+ {
+ WriteObject(allACRs);
+ WriteVerbose(string.Format(Resources.ACRGet_StatusMessage, allACRs.Count, allACRs.Count > 1 ? "s" : string.Empty));
+ return;
+ }
+
+ var acr = allACRs.Where(x => x.Name.Equals(ACRName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+ if (acr == null)
+ {
+ WriteObject(null);
+ WriteVerbose(string.Format(Resources.NotFoundMessageACR,ACRName));
+ }
+ else
+ {
+ WriteObject(acr);
+ WriteVerbose(string.Format(Resources.FoundMessageACR, ACRName));
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/GetAzureStorSimpleStorageAccountCredential.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/GetAzureStorSimpleStorageAccountCredential.cs
new file mode 100644
index 000000000000..f08897f83946
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/GetAzureStorSimpleStorageAccountCredential.cs
@@ -0,0 +1,64 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Linq;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// Get a list of Storage accounts from the StorSimple Service config or retrieves a specified Storage Account Cred
+ ///
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleStorageAccountCredential"), OutputType(typeof(StorageAccountCredential), typeof(IList))]
+ public class GetAzureStorSimpleStorageAccountCredential : StorSimpleCmdletBase
+ {
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageStorageAccountName)]
+ public string StorageAccountName { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ var allSACs = StorSimpleClient.GetAllStorageAccountCredentials();
+ if (StorageAccountName == null)
+ {
+ WriteObject(allSACs);
+ WriteVerbose(string.Format(Resources.SACGet_StatusMessage, allSACs.Count, allSACs.Count > 1 ? "s" : string.Empty));
+ return;
+ }
+
+ var sac = allSACs.Where(x => x.Name.Equals(StorageAccountName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+ if (sac == null)
+ {
+ WriteVerbose(string.Format(Resources.SACNotFoundWithName, StorageAccountName));
+ WriteObject(null);
+ }
+ else
+ {
+ WriteVerbose(string.Format(Resources.SACFoundWithName, StorageAccountName));
+ WriteObject(sac);
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/NewAzureStorSimpleAccessControlRecord.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/NewAzureStorSimpleAccessControlRecord.cs
new file mode 100644
index 000000000000..f193fe9d0de2
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/NewAzureStorSimpleAccessControlRecord.cs
@@ -0,0 +1,92 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Collections.Generic;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// Add New Access Control Record to the StorSimple Manager Service Configuration
+ ///
+ [Cmdlet(VerbsCommon.New, "AzureStorSimpleAccessControlRecord"), OutputType(typeof(TaskStatusInfo))]
+
+ public class NewAzureStorSimpleAccessControlRecord : StorSimpleCmdletBase
+ {
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageACRName)]
+ [ValidateNotNullOrEmpty]
+ public string ACRName { get; set; }
+
+ [Alias("IQN")]
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageIQNforACR)]
+ [ValidateNotNullOrEmpty]
+ public string IQNInitiatorName { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ var serviceConfig = new ServiceConfiguration()
+ {
+ AcrChangeList = new AcrChangeList()
+ {
+ Added = new[]
+ {
+ new AccessControlRecord()
+ {
+ GlobalId = null,
+ InitiatorName = IQNInitiatorName,
+ InstanceId = null,
+ Name = ACRName,
+ VolumeCount = 0
+ },
+ },
+ Deleted = new List(),
+ Updated = new List()
+ },
+ CredentialChangeList = new SacChangeList(),
+ };
+
+ if (WaitForComplete.IsPresent)
+ {
+ var taskStatus = StorSimpleClient.ConfigureService(serviceConfig);
+ HandleSyncTaskResponse(taskStatus, "create");
+ if (taskStatus.AsyncTaskAggregatedResult == AsyncTaskAggregatedResult.Succeeded)
+ {
+ var createdAcr = StorSimpleClient.GetAllAccessControlRecords()
+ .Where(x => x.Name.Equals(ACRName, StringComparison.InvariantCultureIgnoreCase));
+ WriteObject(createdAcr);
+ }
+ }
+ else
+ {
+ var taskResponse = StorSimpleClient.ConfigureServiceAsync(serviceConfig);
+ HandleAsyncTaskResponse(taskResponse, "create");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
+
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/NewAzureStorSimpleInlineStorageAccountCredential.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/NewAzureStorSimpleInlineStorageAccountCredential.cs
new file mode 100644
index 000000000000..8f8ce5c19410
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/NewAzureStorSimpleInlineStorageAccountCredential.cs
@@ -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 System;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Commands.Common;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// Create Storage Account Credential to be added inline during Volume Container creation
+ ///
+ [Cmdlet(VerbsCommon.New, "AzureStorSimpleInlineStorageAccountCredential"),
+ OutputType(typeof (StorageAccountCredentialResponse))]
+
+ public class NewAzureStorSimpleInlineStorageAccountCredential : StorSimpleCmdletBase
+ {
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageStorageAccountName)]
+ [ValidateNotNullOrEmpty]
+ public string StorageAccountName { get; set; }
+
+ [Alias("Key")]
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageStorageAccountKey)]
+ [ValidateNotNullOrEmpty]
+ public string StorageAccountKey { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageEndpoint)]
+ [ValidateNotNullOrEmpty]
+ public string Endpoint { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ string endpoint = string.IsNullOrEmpty(Endpoint) ? StorSimpleConstants.DefaultStorageAccountEndpoint : Endpoint;
+
+ var sac = new StorageAccountCredentialResponse()
+ {
+ CloudType = CloudType.Azure,
+ Hostname = GetHostnameFromEndpoint(endpoint),
+ Login = StorageAccountName,
+ Password = StorageAccountKey,
+ UseSSL = true,
+ Name = StorageAccountName
+ };
+
+ WriteObject(sac);
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
+
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/NewAzureStorSimpleStorageAccountCredential.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/NewAzureStorSimpleStorageAccountCredential.cs
new file mode 100644
index 000000000000..e5f602a593c0
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/NewAzureStorSimpleStorageAccountCredential.cs
@@ -0,0 +1,119 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.Common;
+using Microsoft.WindowsAzure.Commands.StorSimple.Encryption;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Collections.Generic;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// Add Azure Storage account to the StorSimple Manager Service
+ ///
+ [Cmdlet(VerbsCommon.New, "AzureStorSimpleStorageAccountCredential"), OutputType(typeof(TaskStatusInfo))]
+
+ public class NewAzureStorSimpleStorageAccountCredential : StorSimpleCmdletBase
+ {
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageStorageAccountName)]
+ [ValidateNotNullOrEmpty]
+ public string StorageAccountName { get; set; }
+
+ [Alias("Key")]
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageStorageAccountKey)]
+ [ValidateNotNullOrEmpty]
+ public string StorageAccountKey { get; set; }
+
+ [Parameter(Position = 2, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageUseSSL)]
+ [ValidateNotNullOrEmpty]
+ public bool UseSSL { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageEndpoint)]
+ [ValidateNotNullOrEmpty]
+ public string Endpoint { get; set; }
+
+ [Parameter(Position = 4, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ string endpoint = string.IsNullOrEmpty(Endpoint) ? StorSimpleConstants.DefaultStorageAccountEndpoint : Endpoint;
+
+ //validate storage account credentials
+ bool storageAccountPresent;
+ string encryptedKey;
+ string thumbprint;
+ string location = GetStorageAccountLocation(StorageAccountName, out storageAccountPresent);
+ if (!storageAccountPresent
+ || !ValidateAndEncryptStorageCred(StorageAccountName, StorageAccountKey, endpoint, out encryptedKey, out thumbprint))
+ {
+ return;
+ }
+
+ var serviceConfig = new ServiceConfiguration()
+ {
+ AcrChangeList = new AcrChangeList(),
+ CredentialChangeList = new SacChangeList()
+ {
+ Added = new[]
+ {
+ new StorageAccountCredential()
+ {
+ CloudType = CloudType.Azure,
+ Hostname = GetHostnameFromEndpoint(endpoint),
+ Login = StorageAccountName,
+ Password = encryptedKey,
+ PasswordEncryptionCertThumbprint = thumbprint,
+ UseSSL = UseSSL,
+ Name = StorageAccountName,
+ Location = location
+ },
+ },
+ Deleted = new List(),
+ Updated = new List()
+ }
+ };
+
+ if (WaitForComplete.IsPresent)
+ {
+ var taskStatus = StorSimpleClient.ConfigureService(serviceConfig);
+ HandleSyncTaskResponse(taskStatus, "create");
+ if (taskStatus.AsyncTaskAggregatedResult == AsyncTaskAggregatedResult.Succeeded)
+ {
+ var createdSac = StorSimpleClient.GetAllStorageAccountCredentials()
+ .Where(x => x.Name.Equals(StorageAccountName, StringComparison.InvariantCultureIgnoreCase));
+ WriteObject(createdSac);
+ }
+ }
+ else
+ {
+ var taskResponse = StorSimpleClient.ConfigureServiceAsync(serviceConfig);
+ HandleAsyncTaskResponse(taskResponse, "create");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
+
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/RemoveAzureStorSimpleAccessControlRecord.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/RemoveAzureStorSimpleAccessControlRecord.cs
new file mode 100644
index 000000000000..ffae4a626675
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/RemoveAzureStorSimpleAccessControlRecord.cs
@@ -0,0 +1,109 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// Removes a ACR from the StorSimple Manager Service Configuration
+ ///
+ [Cmdlet(VerbsCommon.Remove, "AzureStorSimpleAccessControlRecord"), OutputType(typeof(TaskStatusInfo))]
+
+ public class RemoveAzureStorSimpleAccessControlRecord : StorSimpleCmdletBase
+ {
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByName, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageACRName)]
+ [ValidateNotNullOrEmpty]
+ public string ACRName { get; set; }
+
+ [Parameter(Position = 0, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageACRObject)]
+ [ValidateNotNullOrEmpty]
+ public AccessControlRecord ACR { get; set; }
+
+ [Parameter(Position = 1, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageForce)]
+ public SwitchParameter Force { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ ConfirmAction(Force.IsPresent,
+ Resources.RemoveWarningACR,
+ Resources.RemoveConfirmationACR,
+ string.Empty,
+ () =>
+ {
+ try
+ {
+ AccessControlRecord existingAcr = null;
+ string acrName = null;
+ switch (ParameterSetName)
+ {
+ case StorSimpleCmdletParameterSet.IdentifyByName:
+ var allACRs = StorSimpleClient.GetAllAccessControlRecords();
+ existingAcr = allACRs.Where(x => x.Name.Equals(ACRName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+ acrName = ACRName;
+ break;
+ case StorSimpleCmdletParameterSet.IdentifyByObject:
+ existingAcr = ACR;
+ acrName = ACR.Name;
+ break;
+ }
+ if (existingAcr == null)
+ {
+ WriteObject(null);
+ WriteVerbose(string.Format(Resources.NotFoundMessageACR, acrName));
+ return;
+ }
+
+ var serviceConfig = new ServiceConfiguration()
+ {
+ AcrChangeList = new AcrChangeList()
+ {
+ Added = new List(),
+ Deleted = new[] { existingAcr.InstanceId },
+ Updated = new List()
+ },
+ CredentialChangeList = new SacChangeList(),
+ };
+
+ if (WaitForComplete.IsPresent)
+ {
+ WriteVerbose("About to run a task to remove your ACR!");
+ var taskStatus = StorSimpleClient.ConfigureService(serviceConfig);
+ HandleSyncTaskResponse(taskStatus, "delete");
+ }
+ else
+ {
+ WriteVerbose("About to create a task to remove your ACR!");
+ var taskResponse = StorSimpleClient.ConfigureServiceAsync(serviceConfig);
+ HandleAsyncTaskResponse(taskResponse, "delete");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ });
+ }
+ }
+}
+
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/RemoveAzureStorSimpleStorageAccountCredential.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/RemoveAzureStorSimpleStorageAccountCredential.cs
new file mode 100644
index 000000000000..91ff5233092e
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/RemoveAzureStorSimpleStorageAccountCredential.cs
@@ -0,0 +1,110 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// Removes the Storage Account Cred specified from the StorSimple Service Config
+ ///
+ [Cmdlet(VerbsCommon.Remove, "AzureStorSimpleStorageAccountCredential"), OutputType(typeof(TaskStatusInfo))]
+
+ public class RemoveAzureStorSimpleStorageAccountCredential : StorSimpleCmdletBase
+ {
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByName, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageStorageAccountName)]
+ [ValidateNotNullOrEmpty]
+ public string StorageAccountName { get; set; }
+
+ [Parameter(Position = 0, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageSACObject)]
+ [ValidateNotNullOrEmpty]
+ public StorageAccountCredentialResponse SAC { get; set; }
+
+ [Parameter(Position = 1, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageForce)]
+ public SwitchParameter Force { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ ConfirmAction(Force.IsPresent,
+ Resources.RemoveWarningACR,
+ Resources.RemoveConfirmationACR,
+ string.Empty,
+ () =>
+ {
+ try
+ {
+ StorageAccountCredentialResponse existingSac = null;
+ string sacName = null;
+
+ switch (ParameterSetName)
+ {
+ case StorSimpleCmdletParameterSet.IdentifyByName:
+ var allSACs = StorSimpleClient.GetAllStorageAccountCredentials();
+ existingSac = allSACs.Where(x => x.Name.Equals(StorageAccountName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+ sacName = StorageAccountName;
+ break;
+ case StorSimpleCmdletParameterSet.IdentifyByObject:
+ existingSac = SAC;
+ sacName = SAC.Name;
+ break;
+ }
+ if (existingSac == null)
+ {
+ WriteObject(null);
+ WriteVerbose(string.Format(Resources.SACNotFoundWithName, sacName));
+ return;
+ }
+
+ var serviceConfig = new ServiceConfiguration()
+ {
+ AcrChangeList = new AcrChangeList(),
+ CredentialChangeList = new SacChangeList()
+ {
+ Added = new List(),
+ Deleted = new[] { existingSac.InstanceId },
+ Updated = new List()
+ }
+ };
+
+ if (WaitForComplete.IsPresent)
+ {
+ WriteVerbose("About to run a task to remove your Storage Access Credential!");
+ var taskStatus = StorSimpleClient.ConfigureService(serviceConfig);
+ HandleSyncTaskResponse(taskStatus, "delete");
+ }
+ else
+ {
+ WriteVerbose("About to create a task to remove your Storage Access Credential!");
+ var taskResponse = StorSimpleClient.ConfigureServiceAsync(serviceConfig);
+ HandleAsyncTaskResponse(taskResponse, "delete");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ });
+ }
+ }
+}
+
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/SetAzureStorSimpleAccessControlRecord.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/SetAzureStorSimpleAccessControlRecord.cs
new file mode 100644
index 000000000000..ca792e3949da
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/SetAzureStorSimpleAccessControlRecord.cs
@@ -0,0 +1,104 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// Sets the Host IQN of the ACR in the StorSimple Manager Service Configuration
+ ///
+ [Cmdlet(VerbsCommon.Set, "AzureStorSimpleAccessControlRecord"), OutputType(typeof(TaskStatusInfo))]
+
+ public class SetAzureStorSimpleAccessControlRecord : StorSimpleCmdletBase
+ {
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageACRName)]
+ [ValidateNotNullOrEmpty]
+ public string ACRName { get; set; }
+
+ [Alias("IQN")]
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageIQNforACR)]
+ [ValidateNotNullOrEmpty]
+ public string IQNInitiatorName { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+
+ var allACRs = StorSimpleClient.GetAllAccessControlRecords();
+ var existingAcr = allACRs.Where(x => x.Name.Equals(ACRName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+ if (existingAcr == null)
+ {
+ WriteVerbose(string.Format(Resources.NotFoundMessageACR,ACRName));
+ return;
+ }
+
+ var serviceConfig = new ServiceConfiguration()
+ {
+ AcrChangeList = new AcrChangeList()
+ {
+ Added = new List(),
+ Deleted = new List(),
+ Updated = new []
+ {
+ new AccessControlRecord()
+ {
+ GlobalId = existingAcr.GlobalId,
+ InitiatorName = IQNInitiatorName,
+ InstanceId = existingAcr.InstanceId,
+ Name = existingAcr.Name,
+ VolumeCount = existingAcr.VolumeCount
+ },
+ }
+ },
+ CredentialChangeList = new SacChangeList(),
+ };
+
+ if (WaitForComplete.IsPresent)
+ {
+ WriteVerbose("About to run a task to update your Access Control Record!");
+ var taskStatus = StorSimpleClient.ConfigureService(serviceConfig);
+ HandleSyncTaskResponse(taskStatus, "update");
+ if (taskStatus.AsyncTaskAggregatedResult == AsyncTaskAggregatedResult.Succeeded)
+ {
+ var updatedAcr = StorSimpleClient.GetAllAccessControlRecords()
+ .Where(x => x.Name.Equals(ACRName, StringComparison.InvariantCultureIgnoreCase));
+ WriteObject(updatedAcr);
+ }
+ }
+ else
+ {
+ WriteVerbose("About to create a task to update your Access Control Record!");
+ var taskResponse = StorSimpleClient.ConfigureServiceAsync(serviceConfig);
+ HandleAsyncTaskResponse(taskResponse, "update");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
+
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/SetAzureStorSimpleStorageAccountCredential.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/SetAzureStorSimpleStorageAccountCredential.cs
new file mode 100644
index 000000000000..fc488ab2a805
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/SetAzureStorSimpleStorageAccountCredential.cs
@@ -0,0 +1,123 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Encryption;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ ///
+ /// Edit the Storage Account Cred
+ ///
+ [Cmdlet(VerbsCommon.Set, "AzureStorSimpleStorageAccountCredential"), OutputType(typeof(TaskStatusInfo))]
+
+ public class SetAzureStorSimpleStorageAccountCredential : StorSimpleCmdletBase
+ {
+ [Alias("Name")]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageStorageAccountName)]
+ [ValidateNotNullOrEmpty]
+ public string StorageAccountName { get; set; }
+
+ [Alias("Key")]
+ [Parameter(Position = 1, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageStorageAccountKey)]
+ [ValidateNotNullOrEmpty]
+ public string StorageAccountKey { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageUseSSL)]
+ [ValidateNotNullOrEmpty]
+ public bool? UseSSL { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+
+ var allSACs = StorSimpleClient.GetAllStorageAccountCredentials();
+ var existingSac = allSACs.Where(x => x.Name.Equals(StorageAccountName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+ if (existingSac == null)
+ {
+ WriteVerbose(string.Format(Resources.SACNotFoundWithName,StorageAccountName));
+ return;
+ }
+
+ string encryptedKey;
+ string thumbprint;
+ string endpoint = GetEndpointFromHostname(existingSac.Hostname);
+ if (!ValidateAndEncryptStorageCred(StorageAccountName, StorageAccountKey, endpoint, out encryptedKey, out thumbprint))
+ {
+ return;
+ }
+
+ var serviceConfig = new ServiceConfiguration()
+ {
+ AcrChangeList = new AcrChangeList(),
+ CredentialChangeList = new SacChangeList()
+ {
+ Added = new List(),
+ Deleted = new List(),
+ Updated = new[]
+ {
+ new StorageAccountCredential()
+ {
+ InstanceId = existingSac.InstanceId,
+ CloudType = existingSac.CloudType,
+ Hostname = existingSac.Hostname,
+ Login = existingSac.Login,
+ Password = encryptedKey ?? existingSac.Password,
+ UseSSL = UseSSL ?? existingSac.UseSSL,
+ VolumeCount = existingSac.VolumeCount,
+ Name = existingSac.Name,
+ IsDefault = existingSac.IsDefault,
+ PasswordEncryptionCertThumbprint = thumbprint,
+ Location = existingSac.Location
+ },
+ }
+ }
+ };
+
+ if (WaitForComplete.IsPresent)
+ {
+ WriteVerbose("About to run a task to update your Storage Access credential!");
+ var taskStatus = StorSimpleClient.ConfigureService(serviceConfig);
+ HandleSyncTaskResponse(taskStatus, "update");
+ if (taskStatus.AsyncTaskAggregatedResult == AsyncTaskAggregatedResult.Succeeded)
+ {
+ var updatedSac = StorSimpleClient.GetAllStorageAccountCredentials()
+ .Where(x => x.Name.Equals(StorageAccountName, StringComparison.InvariantCultureIgnoreCase));
+ WriteObject(updatedSac);
+ }
+ }
+ else
+ {
+ WriteVerbose("About to create a task to update your Storage Access credential!");
+ var taskResponse = StorSimpleClient.ConfigureServiceAsync(serviceConfig);
+ HandleAsyncTaskResponse(taskResponse, "update");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
+
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Task/GetAzureStorSimpleTask.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Task/GetAzureStorSimpleTask.cs
new file mode 100644
index 000000000000..eab466683d31
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Task/GetAzureStorSimpleTask.cs
@@ -0,0 +1,43 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleTask"), OutputType(typeof(TaskStatusInfo))]
+ public class GetAzureStorSimpleTask : StorSimpleCmdletBase
+ {
+ [Alias("TaskId")]
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageTaskId)]
+ [ValidateNotNullOrEmpty]
+ public string InstanceId { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ var taskStatus = StorSimpleClient.GetTaskStatus(InstanceId);
+ this.WriteObject(taskStatus);
+ }
+
+ catch(Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/GetAzureStorSimpleDeviceVolume .cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/GetAzureStorSimpleDeviceVolume .cs
new file mode 100644
index 000000000000..9568de5b9df5
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/GetAzureStorSimpleDeviceVolume .cs
@@ -0,0 +1,80 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System.Collections.Generic;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsCommon.Get, "AzureStorSimpleDeviceVolume"), OutputType(typeof(VirtualDisk), typeof(IList))]
+ public class GetAzureStorSimpleDeviceVolume : StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceName { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByParentObject, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDataContainerObject)]
+ [ValidateNotNullOrEmpty]
+ public DataContainer VolumeContainer { get; set; }
+
+ [Alias("Name")]
+ [Parameter(Position = 1, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByName, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeName)]
+ [ValidateNotNullOrEmpty]
+ public string VolumeName { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ var deviceId = StorSimpleClient.GetDeviceId(DeviceName);
+ if (deviceId == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return;
+ }
+
+ switch (ParameterSetName)
+ {
+ case StorSimpleCmdletParameterSet.IdentifyByParentObject:
+ var volumeInfoList = StorSimpleClient.GetAllVolumesFordataContainer(deviceId, VolumeContainer.InstanceId);
+ WriteObject(volumeInfoList.ListofVirtualDisks);
+ WriteVerbose(string.Format(Resources.ReturnedCountVolumeMessage, volumeInfoList.ListofVirtualDisks.Count, volumeInfoList.ListofVirtualDisks.Count > 1 ? "s" : string.Empty));
+ break;
+ case StorSimpleCmdletParameterSet.IdentifyByName:
+ var volumeInfo = StorSimpleClient.GetVolumeByName(deviceId, VolumeName);
+ if (volumeInfo != null
+ && volumeInfo.VirtualDiskInfo != null
+ && volumeInfo.VirtualDiskInfo.InstanceId != null)
+ {
+ WriteObject(volumeInfo.VirtualDiskInfo);
+ WriteVerbose(string.Format(Resources.FoundVolumeMessage, VolumeName));
+ }
+ else
+ {
+ WriteVerbose(string.Format(Resources.NotFoundVolumeMessage, VolumeName));
+ }
+ break;
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/NewAzureStorSimpleDeviceVolume.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/NewAzureStorSimpleDeviceVolume.cs
new file mode 100644
index 000000000000..007e181c3745
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/NewAzureStorSimpleDeviceVolume.cs
@@ -0,0 +1,123 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets.Volume
+{
+
+ [Cmdlet(VerbsCommon.New, "AzureStorSimpleDeviceVolume"), OutputType(typeof(TaskStatusInfo))]
+ public class NewAzureStorSimpleDeviceVolume : StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceName { get; set; }
+
+ [Alias("Container")]
+ [Parameter(Position = 1, Mandatory = true, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDataContainerObject)]
+ [ValidateNotNullOrEmpty]
+ public DataContainer VolumeContainer { get; set; }
+
+ [Alias("Name")]
+ [Parameter(Position = 2, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeName)]
+ [ValidateNotNullOrEmpty]
+ public string VolumeName { get; set; }
+
+ [Alias("SizeInBytes")]
+ [Parameter(Position = 3, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeSize)]
+ [ValidateNotNullOrEmpty]
+ public Int64 VolumeSizeInBytes { get; set; }
+
+ [Parameter(Position = 4, Mandatory = true, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeAcrList)]
+ [ValidateNotNull]
+ [AllowEmptyCollection]
+ public List AccessControlRecords { get; set; }
+
+ [Alias("AppType")]
+ [ValidateSet("PrimaryVolume","ArchiveVolume")]
+ [Parameter(Position = 5, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeAppType)]
+ [ValidateNotNullOrEmpty]
+ public AppType VolumeAppType { get; set; }
+
+ [Parameter(Position = 6, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeOnline)]
+ [ValidateNotNullOrEmpty]
+ public bool Online { get; set; }
+
+ [Parameter(Position = 7, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeDefaultBackup)]
+ [ValidateNotNullOrEmpty]
+ public bool EnableDefaultBackup { get; set; }
+
+ [Parameter(Position = 8, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeMonitoring)]
+ [ValidateNotNullOrEmpty]
+ public bool EnableMonitoring { get; set; }
+
+ [Parameter(Position = 9, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ string deviceid = null;
+ deviceid = StorSimpleClient.GetDeviceId(DeviceName);
+
+ if (deviceid == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return;
+ }
+
+ //Virtual disk create request object
+ var virtualDiskToCreate = new VirtualDiskRequest()
+ {
+ Name = VolumeName,
+ AccessType = AccessType.ReadWrite,
+ AcrList = AccessControlRecords,
+ AppType = VolumeAppType,
+ IsDefaultBackupEnabled = EnableDefaultBackup,
+ SizeInBytes = VolumeSizeInBytes,
+ DataContainer = VolumeContainer,
+ Online = Online,
+ IsMonitoringEnabled = EnableMonitoring
+ };
+
+ if (WaitForComplete.IsPresent)
+ {
+ var taskStatus = StorSimpleClient.CreateVolume(deviceid, virtualDiskToCreate); ;
+ HandleSyncTaskResponse(taskStatus, "create");
+ if (taskStatus.AsyncTaskAggregatedResult == AsyncTaskAggregatedResult.Succeeded)
+ {
+ var createdVolume = StorSimpleClient.GetVolumeByName(deviceid, VolumeName);
+ WriteObject(createdVolume.VirtualDiskInfo);
+ }
+ }
+
+ else
+ {
+ var taskstatus = StorSimpleClient.CreateVolumeAsync(deviceid, virtualDiskToCreate); ;
+ HandleAsyncTaskResponse(taskstatus, "create");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/RemoveAzureStorSimpleDeviceVolume .cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/RemoveAzureStorSimpleDeviceVolume .cs
new file mode 100644
index 000000000000..58b04059aa22
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/RemoveAzureStorSimpleDeviceVolume .cs
@@ -0,0 +1,101 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsCommon.Remove, "AzureStorSimpleDeviceVolume"), OutputType(typeof(TaskStatusInfo))]
+ public class RemoveAzureStorSimpleDeviceVolume : StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceName { get; set; }
+
+ [Alias("Name")]
+ [Parameter(Position = 1, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByName, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeName)]
+ [ValidateNotNullOrEmpty]
+ public string VolumeName { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyByObject, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeId)]
+ [ValidateNotNullOrEmpty]
+ public VirtualDisk Volume { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageForce)]
+ public SwitchParameter Force { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ ConfirmAction(Force.IsPresent,
+ Resources.RemoveWarningVolume,
+ Resources.RemoveConfirmationVolume,
+ string.Empty,
+ () =>
+ {
+ try
+ {
+ var deviceid = StorSimpleClient.GetDeviceId(DeviceName);
+
+ if (deviceid == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return;
+ }
+
+ string volumeId = string.Empty;
+ switch(ParameterSetName)
+ {
+ case StorSimpleCmdletParameterSet.IdentifyByObject:
+ volumeId = Volume.InstanceId;
+ break;
+ case StorSimpleCmdletParameterSet.IdentifyByName:
+ var volumeInfo = StorSimpleClient.GetVolumeByName(deviceid, VolumeName);
+ if (volumeInfo == null)
+ {
+ WriteVerbose(Resources.NotFoundMessageVirtualDisk);
+ return;
+ }
+ volumeId = volumeInfo.VirtualDiskInfo.InstanceId;
+ break;
+ }
+
+ if (WaitForComplete.IsPresent)
+ {
+ WriteVerbose("About to run a task to remove your volume!");
+ var taskstatus = StorSimpleClient.RemoveVolume(deviceid, volumeId);
+ HandleSyncTaskResponse(taskstatus, "delete");
+ }
+ else
+ {
+ WriteVerbose("About to run a task to remove your volume!");
+ var taskresponse = StorSimpleClient.RemoveVolumeAsync(deviceid, volumeId);
+ HandleAsyncTaskResponse(taskresponse, "delete");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ });
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/SetAzureStorSimpleDeviceVolume.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/SetAzureStorSimpleDeviceVolume.cs
new file mode 100644
index 000000000000..5f70193dacff
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/SetAzureStorSimpleDeviceVolume.cs
@@ -0,0 +1,115 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
+{
+ [Cmdlet(VerbsCommon.Set, "AzureStorSimpleDeviceVolume"), OutputType(typeof(TaskStatusInfo))]
+ public class SetAzureStorSimpleDeviceVolume : StorSimpleCmdletBase
+ {
+ [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageDeviceName)]
+ [ValidateNotNullOrEmpty]
+ public string DeviceName { get; set; }
+
+ [Alias("Name")]
+ [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeName)]
+ [ValidateNotNullOrEmpty]
+ public string VolumeName { get; set; }
+
+ [Parameter(Position = 2, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeOnline)]
+ [ValidateNotNullOrEmpty]
+ public bool? Online { get; set; }
+
+ [Alias("SizeInBytes")]
+ [Parameter(Position = 3, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeSize)]
+ [ValidateNotNullOrEmpty]
+ public Int64? VolumeSizeInBytes { get; set; }
+
+ [Alias("AppType")]
+ [ValidateSet("PrimaryVolume","ArchiveVolume")]
+ [Parameter(Position = 4, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeAppType)]
+ [ValidateNotNullOrEmpty]
+ public AppType? VolumeAppType { get; set; }
+
+ [Parameter(Position = 5, Mandatory = false, ValueFromPipeline = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageVolumeAcrList)]
+ [ValidateNotNullOrEmpty]
+ public List AccessControlRecords { get; set; }
+
+ [Parameter(Position = 6, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageWaitTillComplete)]
+ public SwitchParameter WaitForComplete { get; set; }
+
+ public override void ExecuteCmdlet()
+ {
+ try
+ {
+ var deviceId = StorSimpleClient.GetDeviceId(DeviceName);
+ if (deviceId == null)
+ {
+ WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
+ WriteObject(null);
+ return;
+ }
+
+ VirtualDisk diskDetails = StorSimpleClient.GetVolumeByName(deviceId, VolumeName).VirtualDiskInfo;
+ if (diskDetails == null)
+ {
+ WriteVerbose(Resources.NotFoundMessageVirtualDisk);
+ WriteObject(null);
+ return;
+ }
+
+ if (Online != null)
+ {
+ diskDetails.Online = Online.GetValueOrDefault();
+ }
+ if (VolumeSizeInBytes != null)
+ {
+ diskDetails.SizeInBytes = VolumeSizeInBytes.GetValueOrDefault();
+ }
+ if (VolumeAppType != null)
+ {
+ diskDetails.AppType = VolumeAppType.GetValueOrDefault();
+ }
+ if (AccessControlRecords != null)
+ {
+ diskDetails.AcrList = AccessControlRecords;
+ }
+
+ if (WaitForComplete.IsPresent)
+ {
+ var taskstatus = StorSimpleClient.UpdateVolume(deviceId, diskDetails.InstanceId, diskDetails);
+ HandleSyncTaskResponse(taskstatus, "update");
+ var updatedVolume = StorSimpleClient.GetVolumeByName(deviceId, VolumeName);
+ WriteObject(updatedVolume.VirtualDiskInfo);
+ }
+ else
+ {
+ var taskresult = StorSimpleClient.UpdateVolumeAsync(deviceId, diskDetails.InstanceId, diskDetails);
+
+ HandleAsyncTaskResponse(taskresult, "update");
+ }
+ }
+ catch (Exception exception)
+ {
+ this.HandleException(exception);
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Commands.StorSimple.csproj b/src/ServiceManagement/StorSimple/Commands.StorSimple/Commands.StorSimple.csproj
new file mode 100644
index 000000000000..d85826af8995
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Commands.StorSimple.csproj
@@ -0,0 +1,213 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}
+ Library
+ Properties
+ Microsoft.WindowsAzure.Commands.StorSimple
+ Microsoft.WindowsAzure.Commands.StorSimple
+ v4.5
+ 512
+
+ ..\..\..\
+ true
+
+
+ true
+ full
+ false
+ ..\..\..\Package\Debug\ServiceManagement\Azure\StorSimple\
+ DEBUG;TRACE
+ prompt
+ 4
+ false
+ false
+ true
+ true
+ MinimumRecommendedRules.ruleset
+
+
+ ..\..\..\Package\Release\ServiceManagement\Azure\StorSimple\
+ TRACE;SIGN
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+ MSSharedLibKey.snk
+ true
+ false
+
+
+
+ ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+
+
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+
+
+ ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+
+
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+
+
+ False
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+
+
+ False
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+
+
+ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll
+
+
+ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll
+
+
+ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll
+
+
+ ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll
+
+
+ ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll
+
+
+ ..\..\..\packages\Microsoft.WindowsAzure.Management.StorSimple.0.9.0-preview\lib\net40\Microsoft.WindowsAzure.Management.StorSimple.dll
+
+
+ ..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll
+
+
+
+
+
+
+
+ False
+ ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll
+
+
+ False
+ ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {5ee72c53-1720-4309-b54b-5fb79703195f}
+ Commands.Common
+
+
+
+
+
+ Designer
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+
+
+ Designer
+ PreserveNewest
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Encryption/EncryptionCmdLetHelper.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Encryption/EncryptionCmdLetHelper.cs
new file mode 100644
index 000000000000..13af214f5c66
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Encryption/EncryptionCmdLetHelper.cs
@@ -0,0 +1,100 @@
+// ----------------------------------------------------------------------------------
+//
+// 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 Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets.Library;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Encryption
+{
+ public class EncryptionCmdLetHelper
+ {
+ public static void PersistCIK(StorSimpleCmdletBase cmdlet, string resourceId, string cik)
+ {
+ if (string.IsNullOrEmpty(resourceId))
+ {
+ throw new ArgumentNullException("resourceId", Resources.ResourceIdMissing);
+ }
+
+ if (string.IsNullOrEmpty(cik))
+ {
+ throw new Exception(Resources.CIKInvalid);
+ }
+
+ StorSimpleKeyManager mgr = cmdlet.StorSimpleClient.GetResourceContext().StorSimpleKeyManager;
+ KeyStoreOperationStatus status = mgr.PersistCIK(cik);
+
+ if (status == KeyStoreOperationStatus.PERSIST_FILE_ALREADY_EXISTS)
+ {
+ cmdlet.WriteWarning("Key storage operation failed with error that file already exists. Deleting and retrying");
+ mgr.CleanupCIK();
+ status = mgr.PersistCIK(cik);
+ }
+
+ // other error codes are NOT expected - those validations have been done already
+ if (status != KeyStoreOperationStatus.PERSIST_SUCCESS)
+ {
+ throw new Exception(Resources.PersistSecretFailed);
+ }
+ }
+
+ public static string RetrieveCIK(StorSimpleCmdletBase cmdlet, string resourceId)
+ {
+ string cik = null;
+
+ StorSimpleKeyManager mgr = cmdlet.StorSimpleClient.GetResourceContext().StorSimpleKeyManager;
+ KeyStoreOperationStatus status = mgr.RetrieveCIK(out cik);
+
+ if (status == KeyStoreOperationStatus.RETRIEVE_FILESREAM_EMPTY ||
+ status == KeyStoreOperationStatus.RETRIEVE_FILESTREAM_INVALID)
+ {
+ // CIK was persisted, but has been corrupted
+ throw new Exception(Resources.PersistedCIKCorrupted);
+ }
+
+ if (status == KeyStoreOperationStatus.RETRIEVE_FILE_DOES_NOT_EXIST)
+ {
+ // CIK was never persisted
+ throw new Exception(Resources.CIKNotPersisted);
+ }
+
+ // other error codes are NOT expected - those validations have been done already
+ if (status != KeyStoreOperationStatus.RETRIEVE_SUCCESS)
+ {
+ throw new Exception(Resources.CIKFetchFailed);
+ }
+
+ if (string.IsNullOrEmpty(cik))
+ {
+ // CIK retrieved successfully, but is NULL :(
+ throw new Exception(Resources.PersistedCIKIsNull);
+ }
+
+ return cik;
+ }
+
+ public static void ValidatePersistedCIK(StorSimpleCmdletBase cmdlet, string resourceId)
+ {
+ string cik = RetrieveCIK(cmdlet, resourceId);
+
+ StorSimpleCryptoManager cryptMgr = new StorSimpleCryptoManager(cmdlet.StorSimpleClient);
+ string rakPub = cryptMgr.GetPlainTextRAKPub(cik);
+
+ if (string.IsNullOrEmpty(rakPub))
+ {
+ throw new Exception(Resources.PersistedCIKValidationFailed);
+ }
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Encryption/StorSimpleCryptoManager.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Encryption/StorSimpleCryptoManager.cs
new file mode 100644
index 000000000000..72c628f7e67c
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Encryption/StorSimpleCryptoManager.cs
@@ -0,0 +1,77 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.WindowsAzure.Commands.StorSimple.Cmdlets.Library;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Encryption
+{
+ public class StorSimpleCryptoManager
+ {
+ private StorSimpleClient StorSimpleClient;
+
+ public StorSimpleCryptoManager(StorSimpleClient storSimpleClient)
+ {
+ this.StorSimpleClient = storSimpleClient;
+ }
+
+ ///
+ /// Helper method that will return an encrypted secret using rakpub.
+ /// Fetches CIK from the keystore and uses it to get plaintext rakpub
+ ///
+ ///
+ ///
+ ///
+ public KeyStoreOperationStatus EncryptSecretWithRakPub(string secret, out string encryptedSecret)
+ {
+ StorSimpleKeyManager keyManager = StorSimpleClient.GetResourceContext().StorSimpleKeyManager;
+ encryptedSecret = null;
+
+ //reading from keystore
+ string cik = null;
+ KeyStoreOperationStatus status = keyManager.RetrieveCIK(out cik);
+ if (status != KeyStoreOperationStatus.RETRIEVE_SUCCESS)
+ {
+ return status;
+ }
+
+ string decryptedRAKPub = GetPlainTextRAKPub(cik);
+
+ //encrypt secret using RAKPub
+ encryptedSecret = CryptoHelper.EncryptSecretRSAPKCS(secret, decryptedRAKPub);
+
+ return KeyStoreOperationStatus.SUCCESS;
+ }
+
+ public string GetPlainTextRAKPub(string cik)
+ {
+ var encryptedRAKPub = GetEncryptedRAKPub();
+
+ //decrypt the public key using CIK
+ return CryptoHelper.DecryptCipherAES(encryptedRAKPub, cik);
+ }
+
+ public string GetSecretsEncryptionThumbprint()
+ {
+ var key = StorSimpleClient.GetResourceEncryptionKey();
+ return key.ResourceEncryptionKeys.Thumbprint;
+ }
+
+ private string GetEncryptedRAKPub()
+ {
+ //TODO: should use some other method OR is this fine?
+ return StorSimpleClient.GetResourceEncryptionKey().ResourceEncryptionKeys.EncodedEncryptedPublicKey;
+ }
+
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Encryption/StorSimpleKeyManager.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Encryption/StorSimpleKeyManager.cs
new file mode 100644
index 000000000000..853441df60bd
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Encryption/StorSimpleKeyManager.cs
@@ -0,0 +1,91 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.IO;
+using Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets.Library;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Encryption
+{
+ // This class decorates the IKeyManager infra for securely storing/retrieving secrets.
+ // Not prefering inheritence since this class can provide specific, meaningful functions to the user like "PersistCIK" instead of "PersistKey"
+ public class StorSimpleKeyManager
+ {
+ #region properties
+ private readonly string APP_DATA_FOLDER_PATH = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
+ private const string ONESDK_KEYSTORE_FILE_FOR_CIK = "StorSimplePSSDK_CIK.key";
+
+ private string ResourceId { get; set; }
+
+ #endregion
+
+ public StorSimpleKeyManager(string resourceId)
+ {
+ this.ResourceId = resourceId;
+ }
+
+ public KeyStoreOperationStatus RetrieveCIK(out string cik)
+ {
+ return RetrieveKey(out cik, GenerateKeyFilePathForCIK());
+ }
+
+ public KeyStoreOperationStatus PersistCIK(string cik)
+ {
+ return PersistKey(cik, GenerateKeyFilePathForCIK());
+ }
+
+ public KeyStoreOperationStatus CleanupCIK()
+ {
+ string path = GenerateKeyFilePathForCIK();
+ File.Delete(path);
+ return KeyStoreOperationStatus.SUCCESS;
+ }
+
+ #region privates
+ private KeyStoreOperationStatus PersistKey(string keyValue, string filepath)
+ {
+ string folderPath = Path.GetDirectoryName(filepath);
+ if (!Directory.Exists(folderPath))
+ {
+ Directory.CreateDirectory(folderPath);
+ }
+
+ IKeyManager keyManager = new LocalKeyStoreManager(filepath, true);
+ return keyManager.PersistKey(keyValue);
+ }
+
+ private KeyStoreOperationStatus RetrieveKey(out string keyValue, string filepath)
+ {
+ keyValue = null;
+ if (!File.Exists(filepath))
+ {
+ return KeyStoreOperationStatus.RETRIEVE_FILE_DOES_NOT_EXIST;
+ }
+
+ IKeyManager keyManager = new LocalKeyStoreManager(filepath, true);
+ return keyManager.RetrieveKey(out keyValue);
+ }
+
+ private string GenerateKeyFolderPathForResource()
+ {
+ return Path.Combine(APP_DATA_FOLDER_PATH, ResourceId);
+ }
+
+ private string GenerateKeyFilePathForCIK()
+ {
+ return Path.Combine(GenerateKeyFolderPathForResource(), ONESDK_KEYSTORE_FILE_FOR_CIK);
+ }
+ #endregion
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Library/CryptoHelper.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Library/CryptoHelper.cs
new file mode 100644
index 000000000000..b87a0f8c7860
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Library/CryptoHelper.cs
@@ -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.
+// ----------------------------------------------------------------------------------
+
+using System;
+using System.IO;
+using System.Security.Cryptography;
+using System.Security.Cryptography.X509Certificates;
+using System.Text;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets.Library
+{
+ public class CryptoHelper
+ {
+ #region public methods
+ // Salt for generating encryption keys
+ private static byte[] salt = Encoding.ASCII.GetBytes("o6806642kbM7c5");
+ ///
+ /// this algorithm uses the AES algorithm to decrypt the given cipherText
+ ///
+ ///
+ ///
+ ///
+ public static string DecryptCipherAES(string cipherText, string sharedSecret)
+ {
+ if (string.IsNullOrEmpty(cipherText))
+ {
+ return cipherText;
+ }
+
+ AesManaged aesAlg = null;
+ string plaintext = null;
+ // generate the key from the shared secret and the salt
+ Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(sharedSecret, salt);
+
+ // Create the streams used for decryption.
+ byte[] bytes = Convert.FromBase64String(cipherText);
+ using (MemoryStream memoryDecrypt = new MemoryStream(bytes))
+ {
+ aesAlg = new AesManaged();
+ aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
+ // Get the initialization vector from the encrypted stream
+ aesAlg.IV = ReadByteArray(memoryDecrypt);
+ // Create a decrytor to perform the stream transform.
+ ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
+ using (CryptoStream cryptoDecrypt =
+ new CryptoStream(memoryDecrypt, decryptor, CryptoStreamMode.Read))
+ {
+ using (StreamReader streamDecrypt = new StreamReader(cryptoDecrypt))
+ {
+ plaintext = streamDecrypt.ReadToEnd();
+ }
+ }
+ }
+ return plaintext;
+ }
+
+
+ ///
+ /// This method encrypts a given secret using the public cert
+ ///
+ ///
+ ///
+ ///
+ public static string EncryptSecretRSAPKCS(string plainText, string publicCertificate)
+ {
+ string encryptedSecret = null;
+ encryptedSecret = EncryptStringRsaPkcs1v15(plainText, publicCertificate);
+ return encryptedSecret;
+ }
+ #endregion public methods
+
+ #region private methods
+ private static string EncryptStringRsaPkcs1v15(string plaintext, string encodedCertificate)
+ {
+ X509Certificate2 cert = new X509Certificate2(Convert.FromBase64String(encodedCertificate));
+ if (string.IsNullOrEmpty(plaintext) || cert == null)
+ {
+ return null;
+ }
+
+ byte[] textBytes = Encoding.UTF8.GetBytes(plaintext);
+ byte[] encryptedTextBytes;
+
+ //// Create a new instance of RSACryptoServiceProvider.
+ RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)cert.PublicKey.Key;
+ //// Encrypt the passed byte array and specify OAEP padding false to use PKCS#1 V1.5 padding.
+ encryptedTextBytes = rsa.Encrypt(textBytes, false);
+
+ return Convert.ToBase64String(encryptedTextBytes);
+ }
+
+ ///
+ /// Helper method to read byte array from a stream
+ ///
+ /// the stream
+ /// byte array
+ private static byte[] ReadByteArray(Stream s)
+ {
+ byte[] rawLength = new byte[sizeof(int)];
+ if (s.Read(rawLength, 0, rawLength.Length) != rawLength.Length)
+ {
+ throw new SystemException("Stream did not contain properly formatted byte array");
+ }
+
+ byte[] buffer = new byte[BitConverter.ToInt32(rawLength, 0)];
+ if (s.Read(buffer, 0, buffer.Length) != buffer.Length)
+ {
+ throw new SystemException("Did not read byte array properly");
+ }
+
+ return buffer;
+ }
+ #endregion private methods
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Library/IKeyManager.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Library/IKeyManager.cs
new file mode 100644
index 000000000000..206ef59e8aca
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Library/IKeyManager.cs
@@ -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 System;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets.Library
+{
+ ///
+ /// interface to be used for persisting and retrieving keys
+ /// Currently we will be using DPAPI
+ /// in future this can extend to KeyVault service too
+ ///
+ public interface IKeyManager
+ {
+ KeyStoreOperationStatus PersistKey(string keyValue);
+ KeyStoreOperationStatus RetrieveKey(out string keyValue);
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Library/LocalKeyStoreManager.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Library/LocalKeyStoreManager.cs
new file mode 100644
index 000000000000..63717290e5c3
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Library/LocalKeyStoreManager.cs
@@ -0,0 +1,191 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Text;
+using System.IO;
+using System.Security.Cryptography;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets.Library
+{
+ ///
+ /// represents the different outcomes of a persist/retrieve key operation on a keystore
+ ///
+ public enum KeyStoreOperationStatus
+ {
+ PERSIST_EMPTY_KEY,
+ PERSIST_EMPTY_FILENAME,
+ PERSIST_FILE_ALREADY_EXISTS,
+ PERSIST_SUCCESS,
+
+ RETRIEVE_EMPTY_FILENAME,
+ RETRIEVE_FILE_DOES_NOT_EXIST,
+ RETRIEVE_FILESTREAM_INVALID,
+ RETRIEVE_FILESREAM_EMPTY,
+ RETRIEVE_EMPTY_KEY,
+ RETRIEVE_SUCCESS,
+
+ VALIDATE_FAILED,
+
+ FAILED,
+ SUCCESS
+ }
+ public class LocalKeyStoreManager : IKeyManager
+ {
+ #region properties
+ private string KeyStorefilePath { get; set; }
+ private bool OverwriteFileIfExists { get; set; }
+ #endregion
+
+ #region ctor
+ public LocalKeyStoreManager(string keyStorefilePath, bool overwriteFileIfExists = true)
+ {
+ if (string.IsNullOrEmpty(keyStorefilePath))
+ {
+ throw new ArgumentNullException("keyStorefilePath");
+ }
+
+ this.KeyStorefilePath = keyStorefilePath;
+ this.OverwriteFileIfExists = overwriteFileIfExists;
+ }
+ #endregion
+
+ #region interface implementation
+
+ ///
+ /// This method encrypts and saves the given string with the given filename in the appdata folder
+ ///
+ /// the string that needs to be encrypted
+ /// the filename that can be used
+ ///
+ public KeyStoreOperationStatus PersistKey(string keyValue)
+ {
+ if (string.IsNullOrEmpty(keyValue))
+ return KeyStoreOperationStatus.PERSIST_EMPTY_KEY;
+
+ if (File.Exists(KeyStorefilePath) && !OverwriteFileIfExists)
+ return KeyStoreOperationStatus.PERSIST_FILE_ALREADY_EXISTS;
+
+ var keyValueToEncrypt = UnicodeEncoding.ASCII.GetBytes(keyValue);
+ byte[] entropy = GenerateEntropy();
+
+ using (FileStream outputStream = new FileStream(KeyStorefilePath, FileMode.Create))
+ {
+ // Encrypt a copy of the data to the stream.
+ int bytesWritten = EncryptDataToStream(keyValueToEncrypt, entropy, DataProtectionScope.CurrentUser, outputStream);
+ }
+
+ return KeyStoreOperationStatus.PERSIST_SUCCESS;
+ }
+
+ ///
+ /// Method to retrieve a key from an existing key store
+ ///
+ ///
+ ///
+ public KeyStoreOperationStatus RetrieveKey(out string key)
+ {
+ key = null;
+ if (!File.Exists(KeyStorefilePath))
+ {
+ return KeyStoreOperationStatus.RETRIEVE_FILE_DOES_NOT_EXIST;
+ }
+
+ using(FileStream fStream = new FileStream(KeyStorefilePath, FileMode.Open))
+ {
+ if (Convert.ToInt32(fStream.Length) <= 0)
+ return KeyStoreOperationStatus.RETRIEVE_FILESREAM_EMPTY;
+
+ if (!fStream.CanRead)
+ {
+ return KeyStoreOperationStatus.RETRIEVE_FILESTREAM_INVALID;
+ }
+
+ byte[] decryptData = DecryptDataFromStream(fStream, GenerateEntropy(), DataProtectionScope.CurrentUser);
+ string decryptedData = UnicodeEncoding.ASCII.GetString(decryptData);
+
+ key = decryptedData;
+ }
+
+ return KeyStoreOperationStatus.RETRIEVE_SUCCESS;
+ }
+ #endregion interface implementation
+
+ #region private
+ ///
+ /// Generate secondary entropy using a Math constant
+ ///
+ ///
+ private byte[] GenerateEntropy()
+ {
+ byte[] entropy = BitConverter.GetBytes(Math.PI);
+ return entropy;
+ }
+
+ ///
+ /// Method that encrypts the key on the user's machine
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private int EncryptDataToStream(byte[] inputBytes, byte[] Entropy, DataProtectionScope Scope, Stream outputFileStream)
+ {
+ int length = 0;
+ // Encrypt the data in memory. The result is stored in the same same array as the original data.
+ byte[] encrptedData = ProtectedData.Protect(inputBytes, Entropy, Scope);
+ // Write the encrypted data to a stream.
+ if (outputFileStream.CanWrite && encrptedData != null)
+ {
+ outputFileStream.Write(encrptedData, 0, encrptedData.Length);
+ length = encrptedData.Length;
+ }
+ // Return the length that was written to the stream.
+ return length;
+
+ }
+
+
+ ///
+ /// This method reads data from an input stream and returns the decrypted format
+ ///
+ /// entropy bytes that were used for encryption. If no entropy was used, please pass null here. otherwise it will fail
+ /// User scope of local machine scope
+ /// the input stream
+ ///
+ private byte[] DecryptDataFromStream(Stream inputStream, byte[] Entropy, DataProtectionScope Scope = DataProtectionScope.CurrentUser)
+ {
+ int length = Convert.ToInt32(inputStream.Length);
+ byte[] inBuffer = new byte[length];
+ byte[] outBuffer;
+
+ // Read the encrypted data from a stream.
+ if (inputStream.CanRead)
+ {
+ inputStream.Read(inBuffer, 0, length);
+
+ outBuffer = ProtectedData.Unprotect(inBuffer, Entropy, Scope);
+ }
+ else
+ {
+ throw new IOException("Could not read the stream.");
+ }
+
+ return outBuffer;
+ }
+ #endregion private
+
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/MSSharedLibKey.snk b/src/ServiceManagement/StorSimple/Commands.StorSimple/MSSharedLibKey.snk
new file mode 100644
index 000000000000..695f1b38774e
Binary files /dev/null and b/src/ServiceManagement/StorSimple/Commands.StorSimple/MSSharedLibKey.snk differ
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Microsoft.WindowsAzure.Commands.StorSimple.dll-help.psd1 b/src/ServiceManagement/StorSimple/Commands.StorSimple/Microsoft.WindowsAzure.Commands.StorSimple.dll-help.psd1
new file mode 100644
index 000000000000..ead8aec13057
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Microsoft.WindowsAzure.Commands.StorSimple.dll-help.psd1
@@ -0,0 +1,88 @@
+#
+# Module manifest for module 'Microsoft.WindowsAzure.Commands.StorSimple'
+#
+# Generated by: Microsoft Corporation
+#
+# Generated on: 1/18/2015
+#
+
+@{
+
+# Version number of this module.
+ModuleVersion = '0.8.13'
+
+# ID used to uniquely identify this module
+GUID = 'd52ed268-64c7-46bd-9cf8-1814d07409f8'
+
+# 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 = ''
+
+# 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 the .NET Framework required by this module
+DotNetFrameworkVersion = '4.0'
+
+# Minimum version of the common language runtime (CLR) required by this module
+CLRVersion='4.0'
+
+# Processor architecture (None, X86, Amd64, IA64) required by this module
+ProcessorArchitecture = 'None'
+
+# Modules that must be imported into the global environment prior to importing this module
+RequiredModules = @()
+
+# 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 = @()
+
+# Format files (.ps1xml) to be loaded when importing this module
+FormatsToProcess = @()
+
+# Modules to import as nested modules of the module specified in ModuleToProcess
+NestedModules = @(
+ '..\..\..\Package\Debug\ServiceManagement\Azure\StorSimple\Microsoft.WindowsAzure.Commands.StorSimple.dll'
+)
+
+# Functions to export from this module
+FunctionsToExport = '*'
+
+# Cmdlets to export from this module
+CmdletsToExport = '*'
+
+# Variables to export from this module
+VariablesToExport = '*'
+
+# Aliases to export from this module
+AliasesToExport = @()
+
+# 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 ModuleToProcess
+PrivateData = ''
+
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Microsoft.WindowsAzure.Commands.StorSimple.dll-help.xml b/src/ServiceManagement/StorSimple/Commands.StorSimple/Microsoft.WindowsAzure.Commands.StorSimple.dll-help.xml
new file mode 100644
index 000000000000..5bb33304c8f7
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Microsoft.WindowsAzure.Commands.StorSimple.dll-help.xml
@@ -0,0 +1,1221 @@
+
+
+
+The following list contains links to the help topics for the Microsoft Azure StorSimple cmdlets.NameDescriptionGet-AzureStorSimpleAccessControlRecordGets access control records in a service configuration.Get-AzureStorSimpleDeviceGets devices attached to the resource.Get-AzureStorSimpleDeviceBackupGets backups from a device.Get-AzureStorSimpleDeviceBackupPolicyGets backup policies.Get-AzureStorSimpleDeviceConnectedInitiatorGets the iSCSI connections available for a StorSimple device.Get-AzureStorSimpleDeviceVolumeGets volumes on a device.Get-AzureStorSimpleDeviceVolumeContainerGets volume containers on a device.Get-AzureStorSimpleResourceGets all resources that you created.Get-AzureStorSimpleResourceContextGets the current resource context.Get-AzureStorSimpleStorageAccountCredentialGets credentials for storage accounts.Get-AzureStorSimpleTaskGets the status of a task on a StorSimple device.New-AzureStorSimpleAccessControlRecordCreates an access control record.New-AzureStorSimpleDeviceBackupPolicyCreates a backup policy.New-AzureStorSimpleDeviceBackupScheduleAddConfigCreates a backup schedule configuration object.New-AzureStorSimpleDeviceBackupScheduleUpdateConfigCreates a backup schedule update configuration object.New-AzureStorSimpleDeviceVolumeCreates a volume in a specified volume container.New-AzureStorSimpleDeviceVolumeContainerCreates a volume container.New-AzureStorSimpleInlineStorageAccountCredentialCreates a .NET storage account credential object.New-AzureStorSimpleStorageAccountCredentialAdds an Azure storage access credential.Remove-AzureStorSimpleAccessControlRecordDeletes an access control record from the service configuration.Remove-AzureStorSimpleDeviceBackupDeletes a backup object.Remove-AzureStorSimpleDeviceBackupPolicyRemoves an existing backup policy.Remove-AzureStorSimpleDeviceVolumeRemoves a volume from a StorSimple device.Remove-AzureStorSimpleDeviceVolumeContainerRemoves a volume container from a StorSimple device.Remove-AzureStorSimpleStorageAccountCredentialDeletes an existing storage account credential.Select-AzureStorSimpleResourceSets a resource as the current resource.Set-AzureStorSimpleAccessControlRecordUpdates the IQN of an access control record.Set-AzureStorSimpleDeviceBackupPolicyUpdates an existing backup policy.Set-AzureStorSimpleDeviceVolumeUpdates the properties of an existing volume.Set-AzureStorSimpleStorageAccountCredentialUpdates an Azure storage access credential.Start-AzureStorSimpleDeviceBackupJobStarts a new job that creates a backup from an existing backup policy.Start-AzureStorSimpleDeviceBackupRestoreJobStarts a job that restores a backup on a StorSimple device.Get-AzureStorSimpleAccessControlRecordGets access control records in a service configuration.GetAzureStorSimpleAccessControlRecordThe Get-AzureStorSimpleAccessControlRecord cmdlet gets access control records in the StorSimple Manager service configuration. This cmdlet gets all records or a named record.Access control records are containers of iSCSI initiator parameters. These parameters specify which initiators can access a volume. When an iSCSI initiator attempts to connect to a volume, your appliance checks the access control records assigned to that volume. If the iSCSI initiator parameters match one of the entries in an access control record mapped to that volume, the iSCSI initiator can connect.Get-AzureStorSimpleAccessControlRecordACRNameSpecifies the name of an access control record to get.StringACRNameSpecifies the name of an access control record to get.StringStringnoneNoneAccessControlRecord, IList<AccessControlRecord>This cmdlet returns an AccessControlRecord object or an IList<AccessControlRecord> object. An AccessControlRecord object contains the following fields:
+
+-- GlobalId (String)
+-- InitiatorName (String)
+-- InstanceId (String)
+-- Name (String)
+-- OperationInProgress (OperationInProgress)
+-- VolumeCount (int)Example 1: Get all access control recordsPS C:\>Get-AzureStorSimpleAccessControlRecord
+VERBOSE: ClientRequestId: 59839a80-e27c-46ee-8ad5-8390917db9c8_PS
+VERBOSE: ClientRequestId: 1b340751-ee10-4e35-8718-89fa2f1ef6bc_PS
+
+GlobalId :
+InitiatorName : iqn101updated
+InstanceId : 55f24643-ab3a-4098-ade2-aa2b1a3ab18c
+Name : Contoso-TSQA-ACR
+OperationInProgress : None
+VolumeCount : 6
+
+GlobalId :
+InitiatorName : iqn101updated
+InstanceId : 82c9f73c-9955-4c7b-814c-f314ebf16269
+Name : acr101
+OperationInProgress : None
+VolumeCount : 4
+
+GlobalId :
+InitiatorName : abc
+InstanceId : 966084b8-46e5-4812-b295-9ca91829b639
+Name : abc
+OperationInProgress : None
+VolumeCount : 14
+
+GlobalId :
+InitiatorName : iqn01updated
+InstanceId : baebff4d-ab06-40f4-9054-9728c106771f
+Name : acr01name
+OperationInProgress : None
+VolumeCount : 4
+
+VERBOSE: 9 Access Control Records found!
+This command gets all access control records.Example 2: Get a specific access control recordPS C:\>Get-AzureStorSimpleAccessControlRecord -ACRName "Acr11"
+VERBOSE: ClientRequestId: 61f261c7-acd3-4bcc-922a-ddfd85eb767b_PS
+VERBOSE: ClientRequestId: 49c6a4c7-d299-46fd-a553-034c52b47487_PS
+
+GlobalId :
+InitiatorName : iqn-contoso63
+InstanceId : 55f24643-ab3a-4098-ade2-aa2b1a3ab18c
+Name : Acr11
+OperationInProgress : None
+VolumeCount : 6
+
+VERBOSE: Access Control Record with given name Acr11 is found!
+This command gets the access control record named Acr11.New-AzureStorSimpleAccessControlRecordRemove-AzureStorSimpleAccessControlRecordSet-AzureStorSimpleAccessControlRecordGet-AzureStorSimpleDeviceGets devices attached to the resource.GetAzureStorSimpleDeviceThe Get-AzureStorSimpleDevice cmdlet gets a list of StorSimple devices attached to the resource. You can specify device ID, name, model ID, and type. Use the DeviceID property obtained by using this cmdlet to specify devices for other StorSimple cmdlets.Get-AzureStorSimpleDeviceTypeSpecifies the type of a StorSimple device. Valid values are: Appliance and VirtualAppliance.StringModelIdSpecifies a model ID. This cmdlet returns devices that match the value that this parameter specifies.StringDetailedIndicates that this cmdlet returns device details for the devices that it gets.Get-AzureStorSimpleDeviceDeviceIdSpecifies the instance ID of the device to get.StringTypeSpecifies the type of a StorSimple device. Valid values are: Appliance and VirtualAppliance.StringModelIdSpecifies a model ID. This cmdlet returns devices that match the value that this parameter specifies.StringDetailedIndicates that this cmdlet returns device details for the devices that it gets.Get-AzureStorSimpleDeviceDeviceNameSpecifies the name of the StorSimple device to get.StringTypeSpecifies the type of a StorSimple device. Valid values are: Appliance and VirtualAppliance.StringModelIdSpecifies a model ID. This cmdlet returns devices that match the value that this parameter specifies.StringDetailedIndicates that this cmdlet returns device details for the devices that it gets.DetailedIndicates that this cmdlet returns device details for the devices that it gets.SwitchParameterSwitchParameternoneDeviceIdSpecifies the instance ID of the device to get.StringStringnoneDeviceNameSpecifies the name of the StorSimple device to get.StringStringnoneModelIdSpecifies a model ID. This cmdlet returns devices that match the value that this parameter specifies.StringStringnoneTypeSpecifies the type of a StorSimple device. Valid values are: Appliance and VirtualAppliance.StringStringnoneNoneList<DeviceDetails>, IEnumerable<DeviceInfo>This cmdlet returns a List<DeviceDetails> object, if you specify the Detailed parameter. If you do not specify that parameter, it returns an IEnumerable<DeviceInfo> object.Example 1: Get available devices on a resourcePS C:\>Get-AzureStorSimpleDevice
+VERBOSE: ClientRequestId: 0092c884-4b8f-404d-937c-8ed5d7f3f59d_PS
+VERBOSE: ClientRequestId: a3ff92aa-8262-4c42-9c67-c79487cce46a_PS
+VERBOSE: ClientRequestId: 177b596a-2a0e-4e7c-9039-64fd9e63e682_PS
+
+
+ACRCount : 0
+ActivationTime : 11/28/2014 11:34:49 AM
+ActiveController : Unknown
+AvailableStorageInBytes : 1087700467712
+CloudCredCount : 0
+Culture : en-US
+CurrentController : Unknown
+DataContainerCount : 0
+Description :
+DeviceId : 29f9be68-04f7-437d-a466-b90a1ed324b5
+DeviceSoftwareVersion : 6.3.9600.17215
+FriendlyName : Contoso72App03
+IsConfigUpdated : True
+IsVirtualApplianceInterimEntry : False
+Location :
+ModelDescription : 100
+NNicCards : 6
+ProvisionedStorageInBytes : 11811160064
+SerialNumber : 123456789
+Status : Online
+TargetIQN : iqn.1991-05.com.contoso:storsimple100-123456789-target
+TimeZone : Pacific Standard Time
+TotalStorageInBytes : 1099511627776
+Type : Appliance
+UsingStorageInBytes : 0
+VolumeCount : 0
+
+VERBOSE: 1 StorSimple device found!
+This command gets all available devices on a resource. In this example, only one device is available.Example 2: Get specific available devices on a resourcePS C:\>Get-AzureStorSimpleDevice -DeviceName "Contoso74App03" -Type Appliance -ModelId "100"
+VERBOSE: ClientRequestId: a6e71da6-d02a-44e8-b42d-4a2992df087e_PS
+VERBOSE: ClientRequestId: 7260e3db-3dec-4d60-84a7-c207e087ce7d_PS
+VERBOSE: ClientRequestId: b76273b7-0c07-469e-bca3-e9e9cf7b1f40_PS
+
+
+ACRCount : 0
+ActivationTime : 11/28/2014 11:34:49 AM
+ActiveController : Unknown
+AvailableStorageInBytes : 1087700467712
+CloudCredCount : 0
+Culture : en-US
+CurrentController : Unknown
+DataContainerCount : 0
+Description :
+DeviceId : 29f9be68-04f7-437d-a466-b90a1ed324b5
+DeviceSoftwareVersion : 6.3.9600.17215
+FriendlyName : Contoso74App03
+IsConfigUpdated : True
+IsVirtualApplianceInterimEntry : False
+Location :
+ModelDescription : 100
+NNicCards : 6
+ProvisionedStorageInBytes : 11811160064
+SerialNumber : 123456789
+Status : Online
+TargetIQN : iqn.1991-05.com.contoso:storsimple100-123456789-target
+TimeZone : Pacific Standard Time
+TotalStorageInBytes : 1099511627776
+Type : Appliance
+UsingStorageInBytes : 0
+VolumeCount : 0
+
+VERBOSE: 1 StorSimple device found!
+This command gets all available devices on a resource that have the specified name, type, and model ID. Example 3: Get details for a devicePS C:\>Get-AzureStorSimpleDevice -Name "Contoso63App03" -Type Appliance -Detailed
+VERBOSE: ClientRequestId: ceee366d-e414-4db8-9cc4-0e9e52717812_PS
+VERBOSE: ClientRequestId: ddbf7e41-743a-4c93-b5e6-dd72bfa76e3a_PS
+VERBOSE: ClientRequestId: 9820367e-d2a0-4889-b2a1-76d4d0d1787d_PS
+VERBOSE: ClientRequestId: 1a3b1a41-d3b9-4360-910f-a799d6a3d0fe_PS
+
+
+AlertNotification : Microsoft.WindowsAzure.Management.StorSimple.Models.AlertNotificationSettings
+Chap : Microsoft.WindowsAzure.Management.StorSimple.Models.ChapSettings
+DeviceProperties : Microsoft.WindowsAzure.Management.StorSimple.Models.DeviceInfo
+DnsServer : Microsoft.WindowsAzure.Management.StorSimple.Models.DnsServerSettings
+InstanceId : 29f9be68-04f7-437d-a466-b90a1ed324b5
+Name :
+NetInterfaceList : {Data0}
+OperationInProgress : None
+RemoteMgmtSettingsInfo : Microsoft.WindowsAzure.Management.StorSimple.Models.RemoteManagementSettings
+RemoteMinishellSecretInfo : Microsoft.WindowsAzure.Management.StorSimple.Models.RemoteMinishellSettings
+SecretEncryptionCertThumbprint :
+Snapshot : Microsoft.WindowsAzure.Management.StorSimple.Models.SnapshotSettings
+TimeServer : Microsoft.WindowsAzure.Management.StorSimple.Models.TimeSettings
+Type : Invalid
+VirtualApplianceProperties : Microsoft.WindowsAzure.Management.StorSimple.Models.VirtualApplianceInfo
+WebProxy : Microsoft.WindowsAzure.Management.StorSimple.Models.WebProxySettings
+
+VERBOSE: 1 StorSimple device found!
+This command gets all available devices on a resource that have the specified name and type. This command specifies the Detailed parameter. The command provides additional details about the devices it returns.Get-AzureStorSimpleResourceContextSelect-AzureStorSimpleResourceGet-AzureStorSimpleDeviceBackupGets backups from a device.GetAzureStorSimpleDeviceBackupThe Get-AzureStorSimpleDeviceBackup cmdlet gets backups from a device. You can specify the backup policy, volume, and creation time for backups. This cmdlet can return a maximum of 100 backups in the first page. If more than 100 backups exist, retrieve subsequent pages by using the First and Skip parameters. If you specify a value of 100 for Skip and 50 for First, this cmdlet does not return the first 100 results. It returns the next 50 results after the 100 that it skips. Get-AzureStorSimpleDeviceBackupDeviceNameSpecifies the name of the StorSimple device for which to get backups. StringBackupPolicySpecifies a BackupPolicyDetails object. This cmdlet uses the InstanceId of this object to determine which backups to get. To obtain a BackupPolicyDetails object, use the Get-AzureStorSimpleDeviceBackupPolicy cmdlet.BackupPolicyDetailsFromSpecifies the start date and time for the backups that this cmdlet gets.StringToSpecifies the end date and time for the backups that this cmdlet gets.StringGet-AzureStorSimpleDeviceBackupDeviceNameSpecifies the name of the StorSimple device for which to get backups. StringBackupPolicyIdSpecifies an instance ID of a backup policy. This cmdlet gets device backups for policy that this parameter specifies.StringFromSpecifies the start date and time for the backups that this cmdlet gets.StringToSpecifies the end date and time for the backups that this cmdlet gets.StringGet-AzureStorSimpleDeviceBackupDeviceNameSpecifies the name of the StorSimple device for which to get backups. StringFromSpecifies the start date and time for the backups that this cmdlet gets.StringToSpecifies the end date and time for the backups that this cmdlet gets.StringGet-AzureStorSimpleDeviceBackupDeviceNameSpecifies the name of the StorSimple device for which to get backups. StringVolumeIdSpecifies the instance ID of the volume in which backups exist.StringFromSpecifies the start date and time for the backups that this cmdlet gets.StringToSpecifies the end date and time for the backups that this cmdlet gets.StringGet-AzureStorSimpleDeviceBackupDeviceNameSpecifies the name of the StorSimple device for which to get backups. StringVolumeSpecifies a VirtualDisk object. This cmdlet uses the InstanceId of this object to determine the volume in which backups exist. To obtain a VirtualDisk object, use the Get-AzureStorSimpleDeviceVolume parameter.VirtualDiskFromSpecifies the start date and time for the backups that this cmdlet gets.StringToSpecifies the end date and time for the backups that this cmdlet gets.StringBackupPolicySpecifies a BackupPolicyDetails object. This cmdlet uses the InstanceId of this object to determine which backups to get. To obtain a BackupPolicyDetails object, use the Get-AzureStorSimpleDeviceBackupPolicy cmdlet.BackupPolicyDetailsBackupPolicyDetailsnoneBackupPolicyIdSpecifies an instance ID of a backup policy. This cmdlet gets device backups for policy that this parameter specifies.StringStringnoneDeviceNameSpecifies the name of the StorSimple device for which to get backups. StringStringnoneFromSpecifies the start date and time for the backups that this cmdlet gets.StringStringnoneToSpecifies the end date and time for the backups that this cmdlet gets.StringStringnoneVolumeSpecifies a VirtualDisk object. This cmdlet uses the InstanceId of this object to determine the volume in which backups exist. To obtain a VirtualDisk object, use the Get-AzureStorSimpleDeviceVolume parameter.VirtualDiskVirtualDisknoneVolumeIdSpecifies the instance ID of the volume in which backups exist.StringStringnoneBackupPolicyDetails, VirtualDiskThis cmdlet accepts BackupPolicyDetails and VirtualDisk objects. IList<Backup>This cmdlet returns a list of Backup objects.Example 1: Get all backups on a devicePS C:\>Get-AzureStorSimpleDeviceBackup -DeviceName "Contoso63-AppVm"
+BackupJobCreationType : BySchedule
+CreatedOn : 9/23/2014 11:00:14 AM
+SizeInBytes : 10737418240
+Snapshots : {ContosoTSQA}
+SSMHostName :
+Type : CloudSnapshot
+InstanceId : db987f59-487b-45b7-8024-fb50772d7118
+Name : ContosoTSQA_Default
+OperationInProgress : None
+
+...
+
+BackupJobCreationType : BySchedule
+CreatedOn : 9/22/2014 11:00:14 AM
+SizeInBytes : 10737418240
+Snapshots : {ContosoTSQA}
+SSMHostName :
+Type : CloudSnapshot
+InstanceId : f27f16d3-d52c-49cd-8045-34d62899f735
+Name : ContosoTSQA_Default
+OperationInProgress : None
+
+VERBOSE: # of backups returned : 17
+VERBOSE: No more backup sets are present for your query!
+This command gets all backups that exist on the device named Contoso63-AppVm. If there are more than the maximum of 100 backups allowed for the first page, use the First and Skip parameters to view additional results. Example 2: Get backups created between two datesPS C:\>Get-AzureStorSimpleDeviceBackup -DeviceName "Contoso63-AppVm" -From "9/7/2014" -To "10/7/2014" -First 2 -Skip 1
+BackupJobCreationType : BySchedule
+CreatedOn : 10/5/2014 11:00:04 AM
+SizeInBytes : 10737418240
+Snapshots : {ContosoTSQA}
+SSMHostName :
+Type : CloudSnapshot
+InstanceId : ec2fdf5c-c807-4f7b-a942-d4c4a9b68c44
+Name : ContosoTSQA_Default
+OperationInProgress : None
+
+BackupJobCreationType : BySchedule
+CreatedOn : 10/4/2014 11:00:06 AM
+SizeInBytes : 10737418240
+Snapshots : {ContosoTSQA}
+SSMHostName :
+Type : CloudSnapshot
+InstanceId : 5ac4f947-f4c6-4770-9000-2242e72fc6d3
+Name : ContosoTSQA_Default
+OperationInProgress : None
+
+VERBOSE: # of backups returned : 2
+VERBOSE: More backups are available for your query. To access the next page of your result use \"-First 2 -Skip 3\" in
+your commandlet
+This command gets backups on the device named Contoso63-AppVm that were created on or after 10/7/2014 and on or before 10/8/2014. This cmdlet skips the first result and returns the first two results after that first result. Modify values for First and Skip to view other results.Example 3: Get backups for a backup policy IDPS C:\>Get-AzureStorSimpleDeviceBackup -DeviceName "Contoso63-AppVm" -BackupPolicyId "de088eac-b283-4d92-b501-a759845fdf3f" -First 10 -From "9/7/2014"
+BackupJobCreationType : BySchedule
+CreatedOn : 10/1/2014 11:00:12 AM
+SizeInBytes : 10737418240
+Snapshots : {ContosoTSQA}
+SSMHostName :
+Type : CloudSnapshot
+InstanceId : e1aec9f1-a321-443f-a058-ba78c749c2c2
+Name : ContosoTSQA_Default
+OperationInProgress : None
+
+.......
+
+BackupJobCreationType : BySchedule
+CreatedOn : 9/29/2014 11:00:12 AM
+SizeInBytes : 10737418240
+Snapshots : {ContosoTSQA}
+SSMHostName :
+Type : CloudSnapshot
+InstanceId : f8041928-37b9-4048-a99c-2d3078943874
+Name : ContosoTSQA_Default
+OperationInProgress : None
+
+VERBOSE: # of backups returned : 10
+VERBOSE: More backups are available for your query. To access the next page of your result use \"-First 10 -Skip 10\"
+in your commandlet
+This command gets backups on the device named Contoso63-AppVm created on or before the specified date. The command gets backups that were created by using the backup policy that has the specified ID. This command specifies the First parameter, so it returns only the first 10 results.Example 4: Get backups for a backup policy objectPS C:\>Get-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -BackupPolicyName "TSQATest_Default" | Get-AzureStorSimpleDeviceBackup -DeviceName "Contoso63-AppVm" -First 10 -From "9/7/2014"
+BackupJobCreationType : BySchedule
+CreatedOn : 10/1/2014 11:00:12 AM
+SizeInBytes : 10737418240
+Snapshots : {ContosoTSQA}
+SSMHostName :
+Type : CloudSnapshot
+InstanceId : e1aec9f1-a321-443f-a058-ba78c749c2c2
+Name : ContosoTSQA_Default
+OperationInProgress : None
+
+.......
+
+BackupJobCreationType : BySchedule
+CreatedOn : 9/29/2014 11:00:12 AM
+SizeInBytes : 10737418240
+Snapshots : {ContosoTSQA}
+SSMHostName :
+Type : CloudSnapshot
+InstanceId : f8041928-37b9-4048-a99c-2d3078943874
+Name : ContosoTSQA_Default
+OperationInProgress : None
+
+VERBOSE: # of backups returned : 10
+VERBOSE: More backups are available for your query. To access the next page of your result use \"-First 10 -Skip 10\"
+in your commandlet
+This command gets a BackupPolicyDetails object by using the Get-AzureStorSimpleDeviceBackupPolicy cmdlet, and then passes that object to the current cmdlet by using the pipeline operator. That cmdlet gets backups for the device named Contoso63-AppVm created by using the backup policy from the first part of the command. The command gets backups created on or before the specified date, just as in the previous example. This command returns only the first 10 results. Example 5: Get a backup for a volume IDPS C:\>Get-AzureStorSimpleDeviceBackup -DeviceName "Contoso63-AppVm" -VolumeId "SS-VOL-246b9df1-11bb-4071-8043-f955cc406446" -First 1
+BackupJobCreationType : BySchedule
+CreatedOn : 10/9/2014 11:00:10 AM
+SizeInBytes : 10737418240
+Snapshots : {ContosoTSQA}
+SSMHostName :
+Type : CloudSnapshot
+InstanceId : 4fef4178-0145-404b-8257-7d958a380b8b
+Name : ContosoTSQA_Default
+OperationInProgress : None
+
+VERBOSE: # of backups returned : 1
+VERBOSE: No more backup sets are present for your query!
+This command gets a backup on the device that is created on the volume that has the specified instance ID. This command specifies the First parameter, so it returns only the first one result. Example 6: Get a backup for a volume namePS C:\>Get-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeName "TSQATest03" | Get-AzureStorSimpleDeviceBackup -DeviceName "Contoso63-AppVm" -First 1
+BackupJobCreationType : BySchedule
+CreatedOn : 10/9/2014 11:00:10 AM
+SizeInBytes : 10737418240
+Snapshots : {ContosoTSQA}
+SSMHostName :
+Type : CloudSnapshot
+InstanceId : 4fef4178-0145-404b-8257-7d958a380b8b
+Name : ContosoTSQA_Default
+OperationInProgress : None
+
+VERBOSE: # of backups returned : 1
+VERBOSE: No more backup sets are present for your query!
+This command gets a VirtualDisk object by using the Get-AzureStorSimpleDeviceVolume cmdlet, and then passes that object to the current cmdlet by using the pipeline operator. That cmdlet gets backups for the device named Contoso63-AppVm created on the volume from the first part of the command. This command returns only the first result. Remove-AzureStorSimpleDeviceBackupGet-AzureStorSimpleDeviceBackupPolicyGet-AzureStorSimpleDeviceVolumeGet-AzureStorSimpleDeviceBackupPolicyGets backup policies.GetAzureStorSimpleDeviceBackupPolicyThe Get-AzureStorSimpleDeviceBackupPolicy cmdlet gets backup policies. This cmdlet returns a BackupPolicy object or a list of all the BackupPolicy objects that belong to a device. The backup policy objects contain the following properties:
+
+-- Name
+-- InstanceId
+-- BackupPolicyCreationType
+-- LastBackup
+-- NextBackup
+-- SchedulesCount
+-- SSMHostName
+-- VolumesCountGet-AzureStorSimpleDeviceBackupPolicyDeviceNameSpecifies the name of the StorSimple device on which to create the backup policy.StringBackupPolicyNameSpecifies the name of the backup policy to get. If you do not specify this parameter, this cmdlet gets all policies.StringBackupPolicyNameSpecifies the name of the backup policy to get. If you do not specify this parameter, this cmdlet gets all policies.StringStringnoneDeviceNameSpecifies the name of the StorSimple device on which to create the backup policy.StringStringnoneNoneIList<BackupPolicy>, BackupPolicyDetailsThis cmdlet returns a BackupPolicyDetails object, if you specify the BackupPolicyName parameter. If you do not specify that parameter, it returns an IList<BackupPolicy> object. Example 1: Get details for a policyPS C:\>Get-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -BackupPolicyName "GeneralBackupPolicy07"
+VERBOSE: ClientRequestId: 2a878cd6-8432-4646-8be8-a0cb0750958e_PS
+VERBOSE: ClientRequestId: 00ea5a6d-8c27-4e22-b182-5969cdbb8033_PS
+VERBOSE: ClientRequestId: 39dac9ff-4455-45ae-ae3d-7de1445b9520_PS
+
+
+BackupSchedules : {8658e3a2-8a59-4d43-8725-ab0c95665301}
+Volumes : {testvolume03, testvolume05}
+BackupPolicyCreationType : BySaaS
+LastBackup :
+NextBackup : 16-12-2014 00:30:00
+SchedulesCount : 1
+SSMHostName :
+VolumesCount : 2
+InstanceId : 84140a6a-9254-4fff-8d09-ae40e9f1bc7d
+Name : GeneralBackupPolicy07
+OperationInProgress : None
+
+VERBOSE: BackupPolicy with id 84140a6a-9254-4fff-8d09-ae40e9f1bc7d found!
+This command gets a BackupPolicyDetails object named GeneralBackupPolicy07 on the device named Contoso63-AppVm. Example 2: Get a list of backup policiesPS C:\>Get-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm"
+VERBOSE: ClientRequestId: 09d46116-ebc6-4cf8-a010-f8bbce39a932_PS
+VERBOSE: ClientRequestId: 1bcbbfa8-7add-42c9-b8f8-73d89955b4f5_PS
+VERBOSE: ClientRequestId: 0f5d0a1a-951c-4cf3-a1e6-ad4e20af9652_PS
+
+
+BackupPolicyCreationType : BySaaS
+LastBackup :
+NextBackup : 16-12-2014 00:30:00
+SchedulesCount : 1
+SSMHostName :
+VolumesCount : 2
+InstanceId : 03509359-3d7b-4b96-9165-28472e159563
+Name : GeneralBackupPolicy07
+OperationInProgress : None
+
+BackupPolicyCreationType : BySaaS
+LastBackup :
+NextBackup : 16-12-2014 00:30:00
+SchedulesCount : 1
+SSMHostName :
+VolumesCount : 2
+InstanceId : 84140a6a-9254-4fff-8d09-ae40e9f1bc7d
+Name : GeneralBackupPolicy16
+OperationInProgress : None
+
+VERBOSE: 2 backup policies found!
+This command lists the BackupPolicy objects on the device named Contoso63-AppVm. New-AzureStorSimpleDeviceBackupPolicyRemove-AzureStorSimpleDeviceBackupPolicySet-AzureStorSimpleDeviceBackupPolicyGet-AzureStorSimpleDeviceConnectedInitiatorGets the iSCSI connections available for a StorSimple device.GetAzureStorSimpleDeviceConnectedInitiatorThe Get-AzureStorSimpleDeviceConnectedInitiator cmdlet gets a list of the iSCSI connections available for a StorSimple device. The iSCSI connection objects that this cmdlet returns contain the following properties:
+
+-- AcrInstanceId
+-- AcrName
+-- AllowedVolumeNames
+-- InitiatorAddress
+-- Interfaces
+-- Iqn
+-- IscsiConnectionIdThis cmdlet gets connection object only if iSCSI connections are turned on for the device. By default, connections are turned off. Get-AzureStorSimpleDeviceConnectedInitiatorDeviceIdSpecifies the instance ID of the StorSimple device from which to get iSCSI initiators.StringGet-AzureStorSimpleDeviceConnectedInitiatorDeviceNameSpecifies the name of the StorSimple device from which to get iSCSI initiators.StringDeviceIdSpecifies the instance ID of the StorSimple device from which to get iSCSI initiators.StringStringnoneDeviceNameSpecifies the name of the StorSimple device from which to get iSCSI initiators.StringStringnoneNoneList<IscsiConnection>This cmdlet returns an iSCSI connection object that contains the following properties:
+
+-- AcrInstanceId
+-- AcrName
+-- AllowedVolumeNames
+-- InitiatorAddress
+-- Interfaces
+-- Iqn
+-- IscsiConnectionIdExample 1: Get all connections for a devicePS C:\>Get-AzureStorSimpleDeviceConnectedInitiator -DeviceName "Contoso63-AppVm"
+VERBOSE: ClientRequestId: bec615b9-79ab-4671-88b0-287adeb6bf68_PS
+VERBOSE: ClientRequestId: ef976c58-2660-41c8-aa15-c84e70c9d01c_PS
+VERBOSE: ClientRequestId: 9b306b96-8e76-47ed-beda-d3bd2fb2bb82_PS
+VERBOSE: ClientRequestId: 0f4fc743-0b60-45da-a45a-27f4b0f32bd2_PS
+
+AcrInstanceId : 55f24643-ab3a-4098-ade2-aa2b1a3ab18c
+AcrName : Contoso63-AppVm
+AllowedVolumeNames : {Policyvolume1_Default}
+InitiatorAddress :
+Interfaces : {Data0}
+Iqn : iqn10
+IscsiConnectionId : cfc144cb-00f1-44b1-9655-80b431f2161b
+
+VERBOSE: 1 Iscsi Connection found!
+This command gets all iSCSI connections for the device named Contoso63-AppVm. This command returns connections only if connections are turned on for the device.Get-AzureStorSimpleAccessControlRecordGet-AzureStorSimpleDeviceVolumeGets volumes on a device.GetAzureStorSimpleDeviceVolumeThe Get-AzureStorSimpleDeviceVolume cmdlet gets a list of volumes for a specified volume container, or volume that has the specified name. The returned object contains the following properties:
+
+-- AccessType
+-- AcrList
+-- AppType
+-- DataContainer
+-- DataContainerId
+-- InstanceId
+-- IsBackupEnabled
+-- IsDefaultBackupEnabled
+-- IsMonitoringEnabled
+-- Name
+-- Online
+-- OperationInProgress
+-- SizeInBytes
+-- VSNGet-AzureStorSimpleDeviceVolumeDeviceNameSpecifies the name of the StorSimple device from which to get volumes.StringVolumeContainerSpecifies the volume container, as a DataContainer object, that includes the volumes to get. To obtain a DataContainer, use the Get-AzureStorSimpleDeviceVolumeContainer cmdlet.DataContainerGet-AzureStorSimpleDeviceVolumeDeviceNameSpecifies the name of the StorSimple device from which to get volumes.StringVolumeNameSpecifies the name of the volume to get. StringDeviceNameSpecifies the name of the StorSimple device from which to get volumes.StringStringnoneVolumeContainerSpecifies the volume container, as a DataContainer object, that includes the volumes to get. To obtain a DataContainer, use the Get-AzureStorSimpleDeviceVolumeContainer cmdlet.DataContainerDataContainernoneVolumeNameSpecifies the name of the volume to get. StringStringnoneDataContainerThis cmdlet accepts a DataContainer object that contains the volume to get.VirtualDisk, IList<VirtualDisk>This cmdlet returns a VirtualDisk object if you specify the VolumeName parameter. If you specify the VolumeContainer, this cmdlet returns an IList<VirtualDisk> object.Example 1: Get volumes in a specified containerPS C:\>Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm" -VolumeContainerName "Container03" | Get-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm"
+VERBOSE: ClientRequestId: d3202cf7-2cb5-45ce-838d-6fa812dc670a_PS
+VERBOSE: ClientRequestId: 53c4f0ed-881a-47ae-8383-7469724ffc4a_PS
+VERBOSE: ClientRequestId: f0754861-682c-406f-8aed-90f853dc030c_PS
+VERBOSE: ClientRequestId: 16d9ab47-179a-4297-93a7-1ba56f9f5ac8_PS
+VERBOSE: ClientRequestId: e3a6cec0-ef9c-4c31-8477-3f430dc1ae2d_PS
+VERBOSE: ClientRequestId: 1aab1c85-9039-452c-91cd-30b3eb0e30bd_PS
+VERBOSE: 2 volumes found for your volume container!
+VERBOSE: Volume container with name: Container03 is found.
+
+AccessType : ReadWrite
+AcrIdList : {}
+AcrList : {acr101, acr104}
+AppType : PrimaryVolume
+DataContainer : Microsoft.WindowsAzure.Management.StorSimple.Models.DataContainer
+DataContainerId : e8860763-7e04-4fca-9506-e5023251deb8
+InstanceId : SS-VOL-dfd27819-b445-41f8-a6c0-f44e98a26a9a
+InternalInstanceId :
+IsBackupEnabled : False
+IsDefaultBackupEnabled : False
+IsMonitoringEnabled : False
+Name : Volume01
+Online : True
+OperationInProgress : None
+SizeInBytes : 2000000000
+VSN : SS-VOL-dfd27819-b445-41f8-a6c0-f44e98a26a9a
+
+AccessType : ReadWrite
+AcrIdList : {}
+AcrList : {acr101, acr104}
+AppType : PrimaryVolume
+DataContainer : Microsoft.WindowsAzure.Management.StorSimple.Models.DataContainer
+DataContainerId : e8860763-7e04-4fca-9506-e5023251deb8
+InstanceId : SS-VOL-e993efaa-7689-494b-ae55-1873e6875a47
+InternalInstanceId :
+IsBackupEnabled : False
+IsDefaultBackupEnabled : False
+IsMonitoringEnabled : False
+Name : Volume02
+Online : True
+OperationInProgress : None
+SizeInBytes : 2000000000
+VSN : SS-VOL-e993efaa-7689-494b-ae55-1873e6875a47
+This command gets the volume container named Container03 on the device named Contoso63-AppVm by using the Get-AzureStorSimpleDeviceVolumeContainer cmdlet. The command uses the pipeline operator to pass that container to the current cmdlet. That cmdlet gets all the volumes in that container for the device named Contoso63-AppVm.Example 2: Get a volume by using its namePS C:\>Get-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeName "Volume18"
+VERBOSE: ClientRequestId: 4f2f4716-6315-456a-966b-7020c1d7503f_PS
+VERBOSE: ClientRequestId: a53fcae1-a459-4b8b-b690-58d39bb82fb7_PS
+VERBOSE: ClientRequestId: 1f053107-e781-4a70-ac6d-74ca9ef3b4d2_PS
+
+
+AccessType : ReadWrite
+AcrIdList : {}
+AcrList : { EvanNarvaez, DavidChew, ElisaDaugherty PattiFuller }
+AppType : PrimaryVolume
+DataContainer : Microsoft.WindowsAzure.Management.StorSimple.Models.DataContainer
+DataContainerId : 04ea9aad-7a56-4a50-b195-86061b0a810a
+InstanceId : SS-VOL-e84e0105-7510-4eda-9829-069a2a02d118
+InternalInstanceId :
+IsBackupEnabled : False
+IsDefaultBackupEnabled : False
+IsMonitoringEnabled : False
+Name : Volume18
+Online : True
+OperationInProgress : None
+SizeInBytes : 2000000000
+VSN : SS-VOL-e84e0105-7510-4eda-9829-069a2a02d118
+
+VERBOSE: Volume with name: Volume18 is found.
+This command gets the volume named Volume18 on the device named Contoso63-AppVm.New-AzureStorSimpleDeviceVolumeRemove-AzureStorSimpleDeviceVolumeSet-AzureStorSimpleDeviceVolumeGet-AzureStorSimpleDeviceVolumeContainerGet-AzureStorSimpleDeviceVolumeContainerGets volume containers on a device.GetAzureStorSimpleDeviceVolumeContainerThe Get-AzureStorSimpleDeviceVolumeContainer cmdlet gets a list of volume containers on a device, or volume container that has the specified name. The returned object contains the following properties:
+
+-- BandwidthRate
+-- EncryptionKey
+-- InstanceId
+-- IsDefault
+-- IsEncryptionEnabled
+-- Name
+-- OperationInProgress
+-- Owned
+-- PrimaryStorageAccountCredential
+-- SecretsEncryptionThumbprint
+-- VolumeCountGet-AzureStorSimpleDeviceVolumeContainerDeviceNameSpecifies the name of a StorSimple device. This cmdlet gets volume containers from the device that this parameter specifies.StringVolumeContainerNameSpecifies the name of the volume container to get.StringDeviceNameSpecifies the name of a StorSimple device. This cmdlet gets volume containers from the device that this parameter specifies.StringStringnoneVolumeContainerNameSpecifies the name of the volume container to get.StringStringnoneNoneDataContainer, IList<DataContainer>This cmdlet returns a DataContainer object, if you specify the VolumeContainerName parameter. If you do not specify that parameter, this cmdlet returns an IList<DataContainer> object.Example 1: Get all the containers on a devicePS C:\>Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm"
+VERBOSE: ClientRequestId: 8d1f3b9a-e0e6-4dae-984c-a034d1366987_PS
+VERBOSE: ClientRequestId: 63a11e29-1721-42e7-9fa3-d222308c0b10_PS
+VERBOSE: ClientRequestId: b48eca6a-12b4-444d-845b-0953c234b512_PS
+
+
+BandwidthRate : 256
+EncryptionKey :
+InstanceId : 04ea9aad-7a56-4a50-b195-86061b0a810a
+IsDefault : False
+IsEncryptionEnabled : False
+Name : Containter03
+OperationInProgress : None
+Owned : True
+PrimaryStorageAccountCredential : Microsoft.WindowsAzure.Management.StorSimple.Models.StorageAccountCredentialResponse
+SecretsEncryptionThumbprint :
+VolumeCount : 5
+
+VERBOSE: 1 volume container found!
+This command gets a list of the volume containers on the device named Contoso63-AppVm.Example 2: Get a container by using its namePS C:\>Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm" -VolumeContainerName "Container08"
+VERBOSE: ClientRequestId: 8027c66a-869b-4ea3-97a2-e17d98ec751c_PS
+VERBOSE: ClientRequestId: 344f9be5-0887-4d37-98ef-e45c557774f1_PS
+VERBOSE: ClientRequestId: 14919be5-d6f5-4f81-b7f1-d7fafff2238c_PS
+
+
+BandwidthRate : 256
+EncryptionKey :
+InstanceId : 04ea9aad-7a56-4a50-b195-86061b0a810a
+IsDefault : False
+IsEncryptionEnabled : False
+Name : Container03
+OperationInProgress : None
+Owned : True
+PrimaryStorageAccountCredential : Microsoft.WindowsAzure.Management.StorSimple.Models.StorageAccountCredentialResponse
+SecretsEncryptionThumbprint :
+VolumeCount : 5
+
+VERBOSE: Volume container with name: Container03 is found.
+This command gets the volume container named Container08 on the device named Contoso63-AppVm.New-AzureStorSimpleDeviceVolumeContainerRemove-AzureStorSimpleDeviceVolumeContainerGet-AzureStorSimpleResourceGets all resources that you created.GetAzureStorSimpleResourceThe Get-AzureStorSimpleResource cmdlet gets all resources that you created by using Azure Portal. The cmdlet gets details you can use to connect to the resources.Get-AzureStorSimpleResourceNoneIEnumerable<ResourceCredentials>, ResourceCredentialsThis cmdlet returns ResourceCredentials objects that contain the following properties:
+
+-- ResourceName
+-- CloudServiceName
+-- ResourceNameSpace
+-- ResourceType
+-- StampId
+-- ResouceId
+-- BackendStampId
+-- ResourceStateExample 1: Get all resourcesPS C:\>Get-AzureStorSimpleResource
+ResourceName : Contoso63-Tsqa
+CloudServiceName : CisService-3KMVAKGQRUBVUOQOYRNHMDI4U3DASWARAQQAEE5XOFJ6WBYVPNBA-west-us
+ResourceNameSpace : CISBVT2
+ResourceType : CisVault
+StampId : abeb635b-e186-4605-b464-c7c9e55b226a
+ResourceId : 129568832932543915
+BackendStampId : daadc46b-4f56-4e24-8fd8-30d827983ef3
+ResourceState : Started
+
+ResourceName : oldAgentTest2
+CloudServiceName : CisService-3KMVAKGQRUBVUOQOYRNHMDI4U3DASWARAQQAEE5XOFJ6WBYVPNBA-west-us
+ResourceNameSpace : CisBVT2
+ResourceType : CisVault
+StampId : abeb635b-e186-4605-b464-c7c9e55b226a
+ResourceId : 1166111113599012360
+BackendStampId : daadc46b-4f56-4e24-8fd8-30d827983ef3
+ResourceState : Started
+
+ResourceName : LqjdAx
+CloudServiceName : CisService-3KMVAKGQRUBVUOQOYRNHMDI4U3DASWARAQQAEE5XOFJ6WBYVPNBA-west-us
+ResourceNameSpace : CISBVT2
+ResourceType : CisVault
+StampId : abeb635b-e186-4605-b464-c7c9e55b226a
+ResourceId : 8143420525957257522
+BackendStampId : daadc46b-4f56-4e24-8fd8-30d827983ef3
+ResourceState : Started
+This command gets all the resources you created. In this example, there are three resources. Example 2: Get a resource by using its namePS C:\>Get-AzureStorSimpleResource -ResourceName "Contoso63-Tsqa"
+VERBOSE: ClientRequestId: 79782ab6-7368-4024-bae5-0ea15bc49067_PS
+
+
+ResourceName : Contoso63-Tsqa
+CloudServiceName : CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-us
+ResourceNameSpace : Contoso
+ResourceType : CisVault
+StampId : e7b9e848-2f14-47a9-9bad-d77ce5f0ed9a
+ResourceId : 1975530557201809476
+BackendStampId : 7ef900f6-ad91-497d-a9c5-2742b7ed4a75
+ResourceState : Started
+
+VERBOSE: 1 StorSimple resource found!
+This command gets the resource named Contoso63-Tsqa.Example 3: Attempt to get a nonexistent resourcePS C:\>Get-AzureStorSimpleResource -ResourceName "Contoso64-Tsqa"
+VERBOSE: ClientRequestId: a3f6c207-df66-40b3-9ae5-26d2631df20c_PS
+VERBOSE: No resource found in your subscription with name : Contoso64-Tsqa!
+This command attempts to get the resource named Contoso64-Tsqa. There is no resource that has this name. This example does not return any resource.Get-AzureStorSimpleResourceContextSelect-AzureStorSimpleResourceGet-AzureStorSimpleResourceContextGets the current resource context.GetAzureStorSimpleResourceContextThe Get-AzureStorSimpleResourceContext cmdlet gets the current resource context.Get-AzureStorSimpleResourceContextNoneStorSimpleResourceContextThis cmdlet returns a ResourceContext object.Example 1: Get the current contextPS C:\>Select-AzureStorSimpleResource -ResourceName "Contoso63-Tsqa"
+PS C:\> Get-AzureStorSimpleResourceContext
+VERBOSE: ClientRequestId: b05f27e2-4298-4913-b026-cd33803809ef_PS
+
+
+ResourceId : 1975530557201809476
+StampId : 7ef900f6-ad91-497d-a9c5-2742b7ed4a75
+CloudServiceName : CisService-DTYHC5NYB4BUTV3ZHFNSE5EKIZZGLGYR44OJUL5OQGG4I2EMYOZA-west-us
+ResourceProviderNameSpace : Contoso
+ResourceType : CisVault
+ResourceName : Contoso63-Tsqa
+StorSimpleKeyManager : Microsoft.WindowsAzure.Commands.StorSimple.Encryption.StorSimpleKeyManager
+
+VERBOSE: You have a resource selected. Resource Name: Contoso63-Tsqa Id: Contoso63-Tsqa
+The first command sets the current context to be the resource named Contoso63-Tsqa by using the Select-AzureStorSimpleResource cmdlet. The second command gets the current resource context. Example 2: Attempt to get the current contextPS C:\>Get-AzureStorSimpleResourceContext
+VERBOSE: ClientRequestId: 4441afe2-9735-4f1a-aa1f-d16a97443f51_PS
+Get-AzureStorSimpleResourceContext : Resource Context is not set for your subscription. Please use
+Select-AzureStorSimpleResource -ResourceName <<name>> to set
+This command gets the current context. In this example, no context has been set. The command returns a message that explains the problem. Get-AzureStorSimpleResourceSelect-AzureStorSimpleResourceGet-AzureStorSimpleStorageAccountCredentialGets credentials for storage accounts.GetAzureStorSimpleStorageAccountCredentialThe Get-AzureStorSimpleStorageAccountCredential cmdlet gets credentials for storage accounts. This cmdlet gets all StorageAccountCredential objects configured in the service or a named StorageAccountCredential.Get-AzureStorSimpleStorageAccountCredentialStorageAccountNameSpecifies the name of the storage account for which to get credentials.StringStorageAccountNameSpecifies the name of the storage account for which to get credentials.StringStringnoneNoneStorageAccountCredential, IList<StorageAccountCredential>This cmdlet returns a StorageAccountCredential object, if you specify the StorageAccountName parameter, or if you do not specify that parameter, it returns an IList<StorageAccountCredential> object.Example 1: Get all credentials for a resourcePS C:\>Get-AzureStorSimpleStorageAccountCredential
+VERBOSE: ClientRequestId: e40014fe-3188-45a0-8acd-f0c5578120e0_PS
+VERBOSE: ClientRequestId: 7f71b3ad-4130-48e3-9f36-3edde7f4b55c_PS
+
+
+CloudType : Azure
+Hostname : blob.core.windows.net
+InstanceId : 2df01182-207e-4476-b6e4-3276fde325e8
+IsDefault : False
+Location : West US
+Login : ContosoCloudStorage
+Name : ContosoCloudStorage
+OperationInProgress : None
+Password :
+PasswordEncryptionCertThumbprint :
+UseSSL : False
+VolumeCount : 0
+
+VERBOSE: 1 Storage Access Credential found!
+This command gets all available credentials for storage accounts for the current resource.Example 2: Get the credential for a specific storage accountPS C:\>Get-AzureStorSimpleStorageAccountCredential -StorageAccountName "ContosoCloudStorage"
+VERBOSE: ClientRequestId: 16551af6-3398-4d30-a389-1b8eb01ce92c_PS
+VERBOSE: ClientRequestId: 5041277d-4044-4b6c-ae19-4ea9e7ae135a_PS
+VERBOSE: Storage Access Credential with name ContosoCloudStorage found!
+
+
+CloudType : Azure
+Hostname : blob.core.windows.net
+InstanceId : 8b3cb7bb-963b-4173-9598-52fe230b0350
+IsDefault : False
+Location : West US
+Login : ContosoCloudStorage
+Name : ContosoCloudStorage
+OperationInProgress : None
+Password :
+PasswordEncryptionCertThumbprint :
+UseSSL : True
+VolumeCount : 0
+This command gets the storage account credential for the storage account named ContosoCloudStorage. New-AzureStorSimpleStorageAccountCredentialRemove-AzureStorSimpleStorageAccountCredentialSet-AzureStorSimpleStorageAccountCredentialNew-AzureStorSimpleAccessControlRecordCreates an access control record.NewAzureStorSimpleAccessControlRecordThe New-AzureStorSimpleAccessControlRecord cmdlet creates an access control record. You can use an AccessControlRecord object to configure volumes.New-AzureStorSimpleAccessControlRecordACRNameSpecifies a name for the access control record.StringIQNInitiatorNameSpecifies the iSCSI qualified name (IQN) of the iSCSI initiator to which this cmdlet provides access for the volume.StringWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ACRNameSpecifies a name for the access control record.StringStringnoneIQNInitiatorNameSpecifies the iSCSI qualified name (IQN) of the iSCSI initiator to which this cmdlet provides access for the volume.StringStringnoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneNoneTaskStatusInfo, TaskResponseThis cmdlet returns a TaskStatusInfo object if you specify the WaitForComplete parameter. If you do not specify that parameter, it returns a TaskResponse object.Example 1: Create an access control record and wait for the resultPS C:\>New-AzureStorSimpleAccessControlRecord -ACRName "Acr10" -IQNInitiatorName "Iqn10" -WaitForComplete
+Error : Microsoft.WindowsAzure.Management.StorSimple.Models.ErrorDetails
+JobId : 08719243-3a76-43a5-a88b-e5f2b63ed3d9
+JobSteps : {}
+Result : Succeeded
+Status : Completed
+TaskResult : Succeeded
+StatusCode : OK
+RequestId : e12362c2c06615108ba8436cf85fcd40
+This command creates an access control record named Acr10 for the iSCSI initiator named Iqn10. This command specifies the WaitForComplete parameter, and, therefore, the command waits until the operation is complete, and then returns a TaskStatusInfo object.Example 2: Create an access control recordPS C:\>New-AzureStorSimpleAccessControlRecord -ACRName "Acr11" -IQNInitiatorName "Iqn11"
+VERBOSE: The create job is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+2bd56fbb-4b95-4f2c-b99f-6321231a018d for tracking the job status
+This command creates an access control record named Acr11 for the iSCSI initiator named Iqn11. This command does not specify the WaitForComplete parameter, and, therefore, the command starts the task, and then returns a TaskResponse object. To see the status of the task, use the Get-AzureStorSimpleTask cmdlet. Get-AzureStorSimpleAccessControlRecordRemove-AzureStorSimpleAccessControlRecordSet-AzureStorSimpleAccessControlRecordNew-AzureStorSimpleDeviceBackupPolicyCreates a backup policy.NewAzureStorSimpleDeviceBackupPolicyThe New-AzureStorSimpleDeviceBackupPolicy cmdlet creates a backup policy. A backup policy contains one or more backup schedules that can run on one or more volumes. To create a backup schedule, use the New-AzureStorSimpleDeviceBackupScheduleAddConfig cmdlet.New-AzureStorSimpleDeviceBackupPolicyDeviceNameSpecifies the name of the StorSimple device on which to create the backup policy.StringBackupPolicyNameSpecifies the name of the backup policy.StringBackupSchedulesToAddSpecifies an array of BackupScheduleBase objects to add to the policy. Each object represents a schedule. A backup policy contains one or more schedules. To obtain a BackupScheduleBase object, use the New-AzureStorSimpleDeviceBackupScheduleAddConfig cmdlet.PSObject[]VolumeIdsToAddSpecifies an array of the IDs of volumes to add to the backup policy.PSObject[]WaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.BackupPolicyNameSpecifies the name of the backup policy.StringStringnoneBackupSchedulesToAddSpecifies an array of BackupScheduleBase objects to add to the policy. Each object represents a schedule. A backup policy contains one or more schedules. To obtain a BackupScheduleBase object, use the New-AzureStorSimpleDeviceBackupScheduleAddConfig cmdlet.PSObject[]PSObject[]noneDeviceNameSpecifies the name of the StorSimple device on which to create the backup policy.StringStringnoneVolumeIdsToAddSpecifies an array of the IDs of volumes to add to the backup policy.PSObject[]PSObject[]noneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneNoneBackupPolicyThis cmdlet returns a BackupPolicy object that contains the new schedules and volumes.Example 1: Create a backup policyPS C:\>$Schedule01 = New-AzureStorSimpleDeviceBackupScheduleAddConfig -BackupType LocalSnapshot -RecurrenceType Daily -RecurrenceValue 10 -RetentionCount 5 -Enabled $True
+PS C:\> $Schedule02 = New-AzureStorSimpleDeviceBackupScheduleAddConfig -BackupType CloudSnapshot -RecurrenceType Hourly -RecurrenceValue 1 -RetentionCount 5 -Enabled $True
+PS C:\> $ScheduleArray = @()
+PS C:\> $ScheduleArray += $Schedule01
+PS C:\> $ScheduleArray += $Schedule02
+PS C:\> $DeviceContainer = Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm"
+PS C:\> $Volume = $(Get-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeContainer $DeviceContainer[0])
+PS C:\> $VolumeArray = @()
+PS C:\> $VolumeArray += $Volume[0].InstanceId
+PS C:\> New-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -BackupPolicyName "GeneralPolicy07" -BackupSchedulesToAdd $ScheduleArray -VolumeIdsToAdd $VolumeArray
+VERBOSE: ClientRequestId: e9d6771e-c323-47b9-b424-cb98f8ed0273_PS
+VERBOSE: ClientRequestId: db0e7c86-d0d2-4a5a-b1cb-182494cba027_PS
+VERBOSE: ClientRequestId: 77708dfd-a386-4999-b7ed-5d53e288ae83_PS
+
+
+JobId : d4ce5340-d5d1-4471-9cc8-013193f021b3
+JobResult : Succeeded
+JobStatus : Completed
+ErrorCode :
+ErrorMessage :
+JobSteps : {Microsoft.WindowsAzure.Management.StorSimple.Models.TaskStep,
+ Microsoft.WindowsAzure.Management.StorSimple.Models.TaskStep,
+ Microsoft.WindowsAzure.Management.StorSimple.Models.TaskStep}
+
+VERBOSE: The job created for your add operation has completed successfully.
+VERBOSE: ClientRequestId: bbf7e9b9-b493-40b3-8348-f15bcfc4da8a_PS
+BackupSchedules : {36d21096-bbd1-47b7-91b5-40ad1792d992, 505fc91f-deb5-4dca-bfcb-98c20b75ebcc}
+Volumes : {volume03}
+BackupPolicyCreationType : BySaaS
+LastBackup : 01-01-2010 05:30:00
+NextBackup : 16-12-2014 01:13:43
+SchedulesCount : 2
+SSMHostName :
+VolumesCount : 1
+InstanceId : 8799c2f0-8850-4e91-aa23-ee18c67da8bd
+Name : GeneralPolicy07
+OperationInProgress : None
+
+The first command creates a backup schedule configuration object by using the New-AzureStorSimpleDeviceBackupScheduleAddConfig cmdlet, and then stores that object in the $Schedule01 variable. The second command creates another backup configuration object by using New-AzureStorSimpleDeviceBackupScheduleAddConfig, and then stores that object in the $Schedule02 variable.The third command creates an empty array variable, named $ScheduleArray. The next two commands add the objects created in the first two commands to $ScheduleArray.The sixth command gets a volume container for the device named Contoso63-AppVm by using the Get-AzureStorSimpleDeviceVolumeContainer cmdlet, and then stores that container object in the $DeviceContainer variable. The seventh command gets a volume for the volume container stored in the first member of $DeviceContainer by using the Get-AzureStorSimpleDeviceVolume cmdlet, and then stores that volume in the $Volume variable.The eighth command creates an empty array variable, named $VolumeArray. The next command adds a volume ID to $VolumeArray. This value identifies the volume, stored in $Volume, on which the backup policy runs. You can add additional volume IDs to $VolumeArray.The final command creates the backup policy named GeneralPolicy07 for the device named Contoso63-AppVm. The command specifies the schedule configuration objects stored in $ScheduleArray. The command specifies the volume or volumes to which to apply the policy in $VolumeArray. You can verify the backup policy by using the Get-AzureStorSimpleDeviceBackupPolicy cmdlet.Get-AzureStorSimpleDeviceBackupPolicyGet-AzureStorSimpleDeviceVolumeGet-AzureStorSimpleDeviceVolumeContainerRemove-AzureStorSimpleDeviceBackupPolicySet-AzureStorSimpleDeviceBackupPolicyNew-AzureStorSimpleDeviceBackupScheduleAddConfigNew-AzureStorSimpleDeviceBackupScheduleAddConfigCreates a backup schedule configuration object.NewAzureStorSimpleDeviceBackupScheduleAddConfigThe New-AzureStorSimpleDeviceBackupScheduleAddConfig cmdlet creates a BackupScheduleBase configuration object. Use this configuration object to create new backup policy by using the New-AzureStorSimpleDeviceBackupPolicy cmdlet.New-AzureStorSimpleDeviceBackupScheduleAddConfigBackupTypeSpecifies the backup type. Valid values are: LocalSnapshot and CloudSnapshot.LocalSnapshotCloudSnapshotRecurrenceTypeSpecifies the type of recurrence for this backup schedule. Valid values are:
+
+-- Minutes
+-- Hourly
+-- Daily
+-- WeeklyMinutesHourlyDailyWeeklyRecurrenceValueSpecifies how often to make a backup. This parameter uses the unit specified by the RecurrenceType parameter.Int32RetentionCountSpecifies the number of days to keep a backup.Int64StartFromDateTimeSpecifies the date from which to start making backups. The default value is the current time.StringEnabledIndicates whether to enable the backup schedule.BooleanBackupTypeSpecifies the backup type. Valid values are: LocalSnapshot and CloudSnapshot.StringStringnoneEnabledIndicates whether to enable the backup schedule.BooleanBooleannoneRecurrenceTypeSpecifies the type of recurrence for this backup schedule. Valid values are:
+
+-- Minutes
+-- Hourly
+-- Daily
+-- WeeklyStringStringnoneRecurrenceValueSpecifies how often to make a backup. This parameter uses the unit specified by the RecurrenceType parameter.Int32Int32noneRetentionCountSpecifies the number of days to keep a backup.Int64Int64noneStartFromDateTimeSpecifies the date from which to start making backups. The default value is the current time.StringStringnoneNoneBackupScheduleBaseThis cmdlet returns a BackupScheduleBase object. Use a BackupScheduleBase to construct new backup policy.Example 1: Create a backup configuration objectPS C:\>New-AzureStorSimpleDeviceBackupScheduleAddConfig -BackupType CloudSnapshot -RecurrenceType Daily -RecurrenceValue 1 -RetentionCount 100 -Enabled $True
+VERBOSE: ClientRequestId: 426a79ee-fed3-4d3d-9123-e371f83222b3_PS
+
+
+BackupType : CloudSnapshot
+Recurrence : Microsoft.WindowsAzure.Management.StorSimple.Models.ScheduleRecurrence
+RetentionCount : 100
+StartTime : 2014-12-16T00:37:19+05:30
+Status : Enabled
+This command creates a backup schedule base object for cloud snapshot backups. The backup occurs every day, and the backups are kept for 100 days. This schedule is enabled from the default time, which is the current time. New-AzureStorSimpleDeviceBackupScheduleUpdateConfigNew-AzureStorSimpleDeviceBackupPolicyNew-AzureStorSimpleDeviceBackupScheduleUpdateConfigCreates a backup schedule update configuration object.NewAzureStorSimpleDeviceBackupScheduleUpdateConfigThe New-AzureStorSimpleDeviceBackupScheduleUpdateConfig cmdlet creates a BackupScheduleUpdateRequest configuration object. Use this configuration object to update a backup policy by using the Set-AzureStorSimpleDeviceBackupPolicy cmdlet. New-AzureStorSimpleDeviceBackupScheduleUpdateConfigIdSpecifies the instance ID of the backup schedule to update.StringBackupTypeSpecifies the backup type. Valid values are: LocalSnapshot and CloudSnapshot.LocalSnapshotCloudSnapshotRecurrenceTypeSpecifies the type of recurrence for this backup schedule. Valid values are:
+
+-- Minutes
+-- Hourly
+-- Daily
+-- WeeklyMinutesHourlyDailyWeeklyRecurrenceValueSpecifies how often to make a backup. This parameter uses the unit specified by the RecurrenceType parameter.Int32RetentionCountSpecifies the number of days to keep a backup.Int64StartFromDateTimeSpecifies the date from which to start making backups. The default value is the current time.StringEnabledIndicates whether to enable the backup schedule.BooleanBackupTypeSpecifies the backup type. Valid values are: LocalSnapshot and CloudSnapshot.StringStringnoneEnabledIndicates whether to enable the backup schedule.BooleanBooleannoneIdSpecifies the instance ID of the backup schedule to update.StringStringnoneRecurrenceTypeSpecifies the type of recurrence for this backup schedule. Valid values are:
+
+-- Minutes
+-- Hourly
+-- Daily
+-- WeeklyStringStringnoneRecurrenceValueSpecifies how often to make a backup. This parameter uses the unit specified by the RecurrenceType parameter.Int32Int32noneRetentionCountSpecifies the number of days to keep a backup.Int64Int64noneStartFromDateTimeSpecifies the date from which to start making backups. The default value is the current time.StringStringnoneNoneBackupScheduleUpdateRequestThis cmdlet returns a BackupScheduleUpdateRequest object that contains information about updated backup schedules.Example 1: Create a schedule update requestPS C:\>New-AzureStorSimpleDeviceBackupScheduleUpdateConfig -Id "147f734d-a31a-4473-8501-6ba38be2cb30" -BackupType CloudSnapshot -RecurrenceType Hourly -RecurrenceValue 1 -RetentionCount 50 -Enabled $True
+VERBOSE: ClientRequestId: ef346641-54b4-4273-8898-7f863e7c5b7e_PS
+
+
+BackupType : CloudSnapshot
+Id : 147f734d-a31a-4473-8501-6ba38be2cb30
+Recurrence : Microsoft.WindowsAzure.Management.StorSimple.Models.ScheduleRecurrence
+RetentionCount : 50
+StartTime : 2014-12-16T00:39:32+05:30
+Status : Enabled
+This command creates a backup schedule update request for the schedule that has the specified ID. The request is to make the schedule a cloud snapshot backup that recurs every hour. The backups are kept for 50 days. This schedule is enabled from the default time, which is the current time.New-AzureStorSimpleDeviceBackupScheduleAddConfigSet-AzureStorSimpleDeviceBackupPolicyNew-AzureStorSimpleDeviceVolumeCreates a volume in a specified volume container.NewAzureStorSimpleDeviceVolumeThe New-AzureStorSimpleDeviceVolume cmdlet creates a volume in a specified volume container. This cmdlet associates each volume with one or more access control records. To obtain AccessControlRecord objects, use the Get-AzureStorSimpleAccessControlRecord cmdlet. Specify a name, size, and AppType for the volume. Also, specify whether to create the volume online, whether to enable default backup, and whether to enable monitoring.New-AzureStorSimpleDeviceVolumeDeviceNameSpecifies the name of the StorSimple device on which to create the volume.StringWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.VolumeContainerSpecifies the container, as a DataContainer object, in which to create the volume. To obtain a VirtualDisk object, use the Get-AzureStorSimpleDeviceVolumeContainer cmdlet.DataContainerVolumeNameSpecifies a name for the new volume.StringVolumeSizeSystem.Int64AccessControlRecordsSpecifies a list of access control records to associate with the volume.0, Culture=neutral, PublicKeyToken=nullVolumeAppTypeSpecifies whether to create a primary or archive volume. Valid values are: PrimaryVolume and ArchiveVolume.InvalidPrimaryVolumeArchiveVolumeOnlineSpecifies whether to create the volume online.BooleanEnableDefaultBackupSpecifies whether to enable default backup for the volume.BooleanEnableMonitoringSpecifies whether to enable monitoring for the volume. BooleanAccessControlRecordsSpecifies a list of access control records to associate with the volume.0, Culture=neutral, PublicKeyToken=null0, Culture=neutral, PublicKeyToken=nullnoneDeviceNameSpecifies the name of the StorSimple device on which to create the volume.StringStringnoneEnableDefaultBackupSpecifies whether to enable default backup for the volume.BooleanBooleannoneEnableMonitoringSpecifies whether to enable monitoring for the volume. BooleanBooleannoneOnlineSpecifies whether to create the volume online.BooleanBooleannoneVolumeAppTypeSpecifies whether to create a primary or archive volume. Valid values are: PrimaryVolume and ArchiveVolume.AppTypeAppTypenoneVolumeContainerSpecifies the container, as a DataContainer object, in which to create the volume. To obtain a VirtualDisk object, use the Get-AzureStorSimpleDeviceVolumeContainer cmdlet.DataContainerDataContainernoneVolumeNameSpecifies a name for the new volume.StringStringnoneVolumeSizeSystem.Int64System.Int64noneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneDataContainer, List<AccessControlRecord>This cmdlet accepts a DataContainer object and a list of AccessControlRecord objects for the new volume.TaskStatusInfoThis cmdlet returns a TaskStatusInfo object, if you specify the WaitForComplete parameter. Example 1: Create a volumePS C:\>$AcrList = Get-AzureStorSimpleAccessControlRecord
+PS C:\> Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm" -VolumeContainerName "VolumeContainer07" | New-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeName "Volume18" -Size 2000000000 -AccessControlRecords $AcrList -VolumeAppType PrimaryVolume -Online $True -EnableDefaultBackup $False -EnableMonitoring $False
+
+VERBOSE: ClientRequestId: a29d1a84-1f81-4f20-9130-7adfe45e41fb_PS
+VERBOSE: ClientRequestId: 8fa63df1-3f81-4029-a536-b536a70068ad_PS
+VERBOSE: ClientRequestId: 964c5744-8bb1-4f70-beda-95ca4c7f3eb6_PS
+VERBOSE: ClientRequestId: f09fff3a-54fa-4a0e-93db-b079260ed2dd_PS
+VERBOSE: ClientRequestId: 59aa29e3-8044-411a-adae-b64a2681ffed_PS
+VERBOSE: ClientRequestId: 0ffd0297-19be-40fe-a64e-6a2947d831b4_PS
+c3b1ad53-7a51-49d7-ae83-94ff1ff3ab90
+VERBOSE: The create task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+c3b1ad53-7a51-49d7-ae83-94ff1ff3ab90 for tracking the task's status
+VERBOSE: Volume container with name: VolumeContainer07 is found.
+The first command gets the access control records in the StorSimple Manager service configuration by using the Get-AzureStorSimpleAccessControlRecord cmdlet, and then stores them in the $AcrList variable.The second command gets the volume container named VolumeContainer07 for the device named Contoso63-AppVm by using the Get-AzureStorSimpleDeviceVolumeContainer cmdlet. The command passes that container to the current cmdlet by using the pipeline operator. This cmdlet creates the volume. The command specifies the name for the volume, the size, and the access control records stored in $AcrList. This command starts the job, and then returns a TaskResponse object. To see the status of the job, use the Get-AzureStorSimpleTask cmdlet. Example 2: Create a volume without Access Controlaccess control records access controlPS C:\>Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm" -VolumeContainerName "VolumeContainer01" | New-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeName "Volume22" -Size 2000000000 -AccessControlRecords @() -VolumeAppType PrimaryVolume -Online $True -EnableDefaultBackup $False -EnableMonitoring $False -WaitForComplete
+VERBOSE: ClientRequestId: 3f359790-7e1f-48e7-acf8-ecabba850966_PS
+VERBOSE: ClientRequestId: 2723ebcf-cd72-47bb-99b5-0c099d45641b_PS
+VERBOSE: ClientRequestId: e605091f-dd63-42a7-bda2-24753cbc1f9a_PS
+VERBOSE: ClientRequestId: b3fd08c3-67c5-4309-9591-15d92c360469_PS
+VERBOSE: ClientRequestId: 15a024a3-b0c9-4f83-9c34-0ed8b95d024b_PS
+VERBOSE: ClientRequestId: c13f92f9-aea1-40dd-af80-3affe273adbe_PS
+
+
+TaskId : ceef657e-390e-4f7a-aab7-669a29c29e7f
+TaskResult : Succeeded
+TaskStatus : Completed
+ErrorCode :
+ErrorMessage :
+TaskSteps : {Microsoft.WindowsAzure.Management.StorSimple.Models.TaskStep}
+
+VERBOSE: The task created for your create operation has completed successfully.
+VERBOSE: ClientRequestId: 1d79febf-f752-4255-af2d-230d40773bc6_PS
+AccessType : NoAccess
+AcrIdList : {}
+AcrList : {}
+AppType : PrimaryVolume
+DataContainer : Microsoft.WindowsAzure.Management.StorSimple.Models.DataContainer
+DataContainerId : 68b63d15-6aa5-4e69-9f9d-4a0bc607d6e9
+InstanceId : SS-VOL-d73b7eec-76fc-4310-b347-69b160de8cdd
+InternalInstanceId :
+IsBackupEnabled : False
+IsDefaultBackupEnabled : False
+IsMonitoringEnabled : False
+Name : Volume22
+Online : True
+OperationInProgress : None
+SizeInBytes : 2000000000
+VSN : SS-VOL-d73b7eec-76fc-4310-b347-69b160de8cdd
+
+VERBOSE: Volume container with name: VolumeContainer01 is found.
+This command gets the volume container named VolumeContainer01 for the device named Contoso63-AppVm by using the Get-AzureStorSimpleDeviceVolumeContainer cmdlet. The command passes that container to the current cmdlet by using the pipeline operator. This cmdlet creates the volume. The command specifies the name for the volume, the size, and an empty value for access control records. This command specifies the WaitForComplete parameter, so it returns a TaskStatusInfo after it creates the volume. Because the command specifies no access control records, this volume cannot be accessed. You can add access, later, by using Set-AzureStorSimpleDeviceVolume cmdlet.Get-AzureStorSimpleDeviceVolumeRemove-AzureStorSimpleDeviceVolumeSet-AzureStorSimpleDeviceVolumeGet-AzureStorSimpleAccessControlRecordGet-AzureStorSimpleDeviceVolumeContainerNew-AzureStorSimpleDeviceVolumeContainerCreates a volume container.NewAzureStorSimpleDeviceVolumeContainerThe New-AzureStorSimpleDeviceVolumeContainer cmdlet creates a volume container. You must associate a storage account credential with the new volume container. To obtain a storage account credential, use the Get-AzureStorSimpleStorageAccountCredential cmdlet. New-AzureStorSimpleDeviceVolumeContainerDeviceNameSpecifies the name of the StorSimple device on which to create the volume container.StringVolumeContainerNameSpecifies the name of the volume container to create.StringPrimaryStorageAccountCredentialSpecifies the credential, as a StorageAccountCredential object, to associate with the new volume container. To obtain a StorageAccountCredential object, use the Get-AzureStorSimpleStorageAccountCredential cmdlet.StorageAccountCredentialResponseBandWidthRateSystem.Int32EncryptionEnabledIndicates whether to enable encryption.BooleanEncryptionKeySpecifies the encryption key.StringWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.BandWidthRateSystem.Int32System.Int32noneDeviceNameSpecifies the name of the StorSimple device on which to create the volume container.StringStringnoneEncryptionEnabledIndicates whether to enable encryption.BooleanBooleannoneEncryptionKeySpecifies the encryption key.StringStringnonePrimaryStorageAccountCredentialSpecifies the credential, as a StorageAccountCredential object, to associate with the new volume container. To obtain a StorageAccountCredential object, use the Get-AzureStorSimpleStorageAccountCredential cmdlet.StorageAccountCredentialResponseStorageAccountCredentialResponsenoneVolumeContainerNameSpecifies the name of the volume container to create.StringStringnoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneStorageAccountCredentialThis cmdlet accepts a PrimaryStorageAccountCredential object to associate with the volume container.TaskStatusInfoThis cmdlet returns a TaskStatusInfo object, if you specify the WaitForComplete parameter. Example 1: Create a containerPS C:\>Get-AzureStorSimpleStorageAccountCredential -StorageAccountName "ContosoAccount" | New-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm" -VolumeContainerName "Container08" -BandWidthRateInMbps 256
+VERBOSE: ClientRequestId: 96a4ccd4-f2a9-4820-8bc8-e6b7b56dce0d_PS
+VERBOSE: ClientRequestId: 90be20db-098a-4f2b-a6da-9da6f533a846_PS
+VERBOSE: ClientRequestId: 410fd33a-8fa3-4ae5-a1bf-1b6da9b34ffc_PS
+VERBOSE: Storage Access Credential with name ContosoAccount found!
+VERBOSE: ClientRequestId: 0a6d1008-ba1f-43b2-a424-9c86be2fb83b_PS
+VERBOSE: ClientRequestId: 08f0d657-a130-4a25-8090-270c58b479dc_PS
+VERBOSE: ClientRequestId: 0f3e894a-b031-467c-a258-41b74c89cf18_PS
+5b192120-9df0-40ed-b75e-b4e728bd37ef
+VERBOSE: The create task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+5b192120-9df0-40ed-b75e-b4e728bd37ef for tracking the task's status
+This command gets the storage account credential for the account named ContosoAccount by using the Get-AzureStorSimpleStorageAccountCredential cmdlet. The command passes the credential to the current cmdlet by using the pipeline operator. This cmdlet uses the credential from that cmdlet to create the container named Container08 on the device named Contoso63-AppVm. This command starts the job, and then returns a TaskResponse object. To see the status of the job, use the Get-AzureStorSimpleTask cmdlet. Get-AzureStorSimpleDeviceVolumeContainerRemove-AzureStorSimpleDeviceVolumeContainerGet-AzureStorSimpleStorageAccountCredentialNew-AzureStorSimpleStorageAccountCredentialAdds an Azure storage access credential.NewAzureStorSimpleStorageAccountCredentialThe New-AzureStorSimpleStorageAccountCredential cmdlet adds an Azure storage access credential to StorSimple manager for use by StorSimple OneSDK cmdlets. Most of the StorSimple OneSDK cmdlets deal with entities that are eventually tied to a specific storage account, such as volumes, volume containers, backups, and backup policies. For some cmdlets, you must provide the credentials of the storage account in use. A storage account credential is an access object created in OneSDK that points to an existing Azure storage account. You provide the name and access key of an existing storage account to create a storage account credential. You can then use that credential object with other cmdlets. This cmdlet uses the registration key that you provide when you select the resource by using the Select-AzureStorSimpleResource cmdlet. Be sure that value is correct to avoid encryption failure. To modify the registration key to a correct value, use Select-AzureStorSimpleResource. New-AzureStorSimpleStorageAccountCredentialStorageAccountNameSpecifies the name of an existing storage account. StringStorageAccountKeySpecifies the access key of the storage account in plain text. StringUseSSLIndicates whether to use SSL for the connection when using the new storage account credential. BooleanWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.StorageAccountKeySpecifies the access key of the storage account in plain text. StringStringnoneStorageAccountNameSpecifies the name of an existing storage account. StringStringnoneUseSSLIndicates whether to use SSL for the connection when using the new storage account credential. BooleanBooleannoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneNoneIEnumerable<StorageAccountCredentialResponse>, TaskResponseThis cmdlet returns a list of StorageAccountCredentialResponse objects, if you specify the WaitForComplete parameter. If you do not specify that parameter, the cmdlet returns a TaskResponse object. A StorageAccountCredentialResponse contains the following properties:
+
+-- CloudType (CloudType)
+-- Hostname (String)
+-- InstanceId (String)
+-- IsDefault (Boolean)
+-- Location (String)
+-- Login (String)
+-- Name (String)
+-- OperationInProgress (OperationInProgress)
+-- Password (String)
+-- PasswordEncryptionCertThumbprint (String)
+-- UseSSL (Boolean)
+-- VolumeCount (int)Example 1: Create a credentialPS C:\>New-AzureStorSimpleStorageAccountCredential -StorageAccountName "ContosoAccount07" -StorageAccountKey "L/eVcHtvqKjPWm5SaAJXtDlc0d69yVs0ICoZ2XIV1x0r9TqUyQyLUNS8lHvTvRmzdvQhJelav3fYyX7wyAu/SA==" -UseSSL $False -WaitForComplete
+VERBOSE: ClientRequestId: f363cda4-54aa-4ee8-a3fa-00651ac86ffb_PS
+VERBOSE: Found storage account with name : ContosoAccount07
+VERBOSE: Storage credential verification succeeded.
+VERBOSE: ClientRequestId: 716ce6df-62b3-4d48-8e0e-b0c94eec6934_PS
+VERBOSE: Encryption in progress...
+VERBOSE: ClientRequestId: 19aa4ef7-2789-4817-980c-19e33d257650_PS
+
+JobId : 84f74c25-b742-452c-973c-43c7446e9f49
+JobResult : Succeeded
+JobStatus : Completed
+ErrorCode :
+ErrorMessage :
+JobSteps : {}
+
+VERBOSE: The job created for your create operation has completed successfully.
+VERBOSE: ClientRequestId: 72bcdf37-bf06-4dac-adc9-31bb8d06475a_PS
+CloudType : Azure
+Hostname : blob.core.windows.net
+InstanceId : b9986714-cef4-4c3f-a719-7acfc9559320
+IsDefault : False
+Location : West Europe
+Login : ContosoAccount07
+Name : ContosoAccount07
+OperationInProgress : None
+
+Password : G1sBQ6/qAN1gyRGRZVarpi7o6ToJl61sGugfeJ75yx7cwyaGLQHjrSEEwhxThbDJkxso2emAOarTe920Uufy
+ 0AmJ9NpBI5hNyIFfwS4Ff+z2WmfKOzApyeofW5Zy7GPufehe/2ondq0XG4pGt3qxHFXNVUuiaPSU6TVWEKSh
+ hWDaksSXYMGij3DJdZDW1MA49e6Q7OY+rFujbYvi9P2OjVj8T+FbiMtMB5NnQEqE+t3k74RqPIDKU+d3h9x4
+ rYbAksGPfMvSa0fUipwYJ+Y5/NABA6j/MfB2pNDJbvqDoa1JCX6SKiwL81wmTh78/KnDY5ST3Said5DzKEbR
+ iYMQZg==
+PasswordEncryptionCertThumbprint :
+UseSSL : False
+VolumeCount : 0
+This command creates a storage access credential for the specified storage account. This command specifies the WaitForComplete parameter, and, so, the cmdlet waits until the task finishes to return control to the console. Example 2: Create a credential and query that status of the taskPS C:\>New-AzureStorSimpleStorageAccountCredential -Name "ContosoAccount08" -Key "6BlMpSVrCQVQy3iOpkxiyY8uk/e3PiHIhadxV4qpPlKInr/eRFrGcWKDrfNC1IHj6oh0If/h3rALdZ0zuaf9cQ==" -UseSSL $True
+PS C:\> Get-AzureStorSimpleTask -InstanceId "53816d8d-a8b5-4c1d-a177-e59007608d6d"
+VERBOSE: ClientRequestId: 6104a834-ea57-4687-8e0b-1d97dc1c038b_PS
+VERBOSE: Found storage account with name : ContosoAccount08
+VERBOSE: Storage credential verification succeeded.
+VERBOSE: ClientRequestId: 1f686fa4-5afc-43c3-87b6-f2da7bf9e65f_PS
+VERBOSE: Encryption in progress...
+VERBOSE: ClientRequestId: 8acb3770-bd72-43e6-9622-481002ad40b0_PS
+53816d8d-a8b5-4c1d-a177-e59007608d6d
+VERBOSE: The create task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+53816d8d-a8b5-4c1d-a177-e59007608d6d for tracking the task's status
+The first command creates a storage access credential for the specified storage account. The command returns a task ID.The second command queries the status of the task by using the Get-AzureStorSimpleTask cmdlet. The command specifies the task ID from the first command. Example 3: Create a credential to use with another cmdletPS C:\>Get-AzureStorSimpleStorageAccountCredential -Name "ContosoAccount09" | New-AzureStorSimpleDeviceVolumeContainer -Name "VC03" -DeviceName "Contoso63-AppVm" -BandWidthRate 256 -EncryptionEnabled $True -EncryptionKey "<your encryption key>" -WaitForComplete
+VERBOSE: ClientRequestId: b1d1e637-cd72-4a1e-95a8-4db1d0b921a7_PS
+VERBOSE: ClientRequestId: 71f56ca0-1f0b-4655-9331-4849e096345a_PS
+VERBOSE: ClientRequestId: fbdd5a96-c95f-4547-9bcd-376d05543348_PS
+VERBOSE: Storage Access Credential with name ContosoAccount09 found!
+VERBOSE: ClientRequestId: b44e0363-9979-4e97-aeb1-d9eb4073a337_PS
+VERBOSE: ClientRequestId: a6047943-b01e-44e4-a91d-5103aa80ce57_PS
+VERBOSE: Encryption in progress...
+VERBOSE: ClientRequestId: ac2dfd8b-922f-4e4d-8c8d-df1e2f87806c_PS
+
+
+JobId : 1cf2db5d-624f-46c4-97b9-c36451ba144e
+JobResult : Succeeded
+JobStatus : Completed
+ErrorCode :
+ErrorMessage :
+JobSteps : {Microsoft.WindowsAzure.Management.StorSimple.Models.TaskStep}
+
+VERBOSE: The job created for your create operation has completed successfully.
+VERBOSE: ClientRequestId: 9558414b-0883-4cf6-8a02-40efc7edd80d_PS
+BandwidthRate : 256
+EncryptionKey : g53NTgCF3SBVZzzk+9yUz5nZopvZpNr3th92ol7WRO7ZUKhodPm7WNjjHEKB0/V+JY6P68tdaF4JxF5jH58e/
+ mCtTvnPNpOxykYFdY9GKGd9gnf+36sUPqiLFP+ONO5nN/N/zFmOeyuySsaa3gJsZG8eIiFc821yfe9m5QPbF
+ bx/Qyu8qLl1R1LrKU7k+46IXfwQYSyclztydyuzvFUUic9kaJuR3944VLvrjvxJIbnLrYy7hsn+Gfq7ds9NFq
+ AUILBH0+bk2uWgUlofAcE8fJ/rzDAHr8nFGWxOTJSrqAo0J3st8BN39+BcrY+zOWsMc/vKfc+Ss5PsGVGDT1r
+ eQ==
+InstanceId : 60c34706-ef0c-4c6f-ad90-7249f42648f7
+IsDefault : False
+IsEncryptionEnabled : True
+Name : VC03
+OperationInProgress : None
+Owned : True
+PrimaryStorageAccountCredential : Microsoft.WindowsAzure.Management.StorSimple.Models.StorageAccountCredentialResponse
+SecretsEncryptionThumbprint :
+VolumeCount : 0
+
+This command creates a storage account credential. The command then passes that credential to the New-AzureStorSimpleDeviceVolumeContainer cmdlet by using the pipeline operator. That cmdlet creates a new volume container by using the credential. Get-AzureStorSimpleStorageAccountCredentialRemove-AzureStorSimpleStorageAccountCredentialSet-AzureStorSimpleStorageAccountCredentialNew-AzureStorSimpleDeviceVolumeContainerRemove-AzureStorSimpleAccessControlRecordDeletes an access control record from the service configuration.RemoveAzureStorSimpleAccessControlRecordThe Remove-AzureStorSimpleAccessControlRecord cmdlet deletes an access control record from the service configuration.Remove-AzureStorSimpleAccessControlRecordACRSpecifies an AccessControlRecord object to delete. To obtain an AccessControlRecord object, use the Get-AzureStorSimpleAccessControlRecord cmdlet.AccessControlRecordWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ForceIndicates that this cmdlet does not prompt you for confirmation.Remove-AzureStorSimpleAccessControlRecordACRNameSpecifies a name of the access control record to delete.StringWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ForceIndicates that this cmdlet does not prompt you for confirmation.ACRSpecifies an AccessControlRecord object to delete. To obtain an AccessControlRecord object, use the Get-AzureStorSimpleAccessControlRecord cmdlet.AccessControlRecordAccessControlRecordnoneACRNameSpecifies a name of the access control record to delete.StringStringnoneForceIndicates that this cmdlet does not prompt you for confirmation.SwitchParameterSwitchParameternoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneAccessControlRecordThis cmdlet accepts an AccessControlRecord object. An AccessControlRecord object contains the following fields:
+
+-- GlobalId (String)
+-- InitiatorName (String)
+-- InstanceId (String)
+-- Name (String)
+-- OperationInProgress (OperationInProgress)
+-- VolumeCount (int)TaskStatusInfo, TaskResponseThis cmdlet returns a TaskStatusInfo object if you specify the WaitForComplete parameter. If you do not specify that parameter, it returns a TaskResponse object.Example 1: Remove an access control recordPS C:\>Remove-AzureStorSimpleAccessControlRecord -ACRName "Acr10" -WaitForComplete -Force
+VERBOSE: ClientRequestId: 574aeb7f-fbc9-46d5-bc68-1bfe4487bd8b_PS
+VERBOSE: ClientRequestId: 985afe84-ef95-47cb-8c8f-df094530334b_PS
+VERBOSE: About to run a job to remove your ACR!
+VERBOSE: ClientRequestId: 7eb7e1a0-2288-44da-b64c-5bf86a6b9aaf_PS
+
+
+JobId : f7934db5-8363-4152-b38e-b9a5d91f97b9
+JobResult : Succeeded
+JobStatus : Completed
+ErrorCode :
+ErrorMessage :
+JobSteps : {}
+
+VERBOSE: The job created for your delete operation has completed successfully.
+This command deletes the access control record named Acr10. This command specifies the WaitForComplete parameter, and, therefore, the command waits until the operation is complete, and then returns a TaskStatusInfo object.Example 2: Remove an access control record by using the pipelinePS C:\>Get-AzureStorSimpleAccessControlRecord -ACRName "Acr10" | Remove-AzureStorSimpleAccessControlRecord -Force
+VERBOSE: ClientRequestId: ff8d8bd6-4c92-4ab6-8fde-e9344a253da3_PS
+VERBOSE: ClientRequestId: f71c74f3-33b9-40d1-b8d5-12363e98412f_PS
+VERBOSE: ClientRequestId: d5d809d0-ec22-4e45-97ee-a56edc41e503_PS
+VERBOSE: About to create a job to remove your ACR!
+VERBOSE: ClientRequestId: 6ffa6bc8-37b3-49ff-bafc-721b360f09cb_PS
+294a0208-a43f-4d80-b824-2319cd77c5e6
+VERBOSE: The delete task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+294a0208-a43f-4d80-b824-2319cd77c5e6 for tracking the task's status
+This command uses the Get-AzureStorSimpleAccessControlRecord to get the AccessControlRecord named Acr10, and then passes that object to the current cmdlet by using the pipeline operator. The command starts the operation that removes the AccessControlRecord object, and then returns a TaskResponse object. To see the status of the task, use the Get-AzureStorSimpleTask cmdlet.Get-AzureStorSimpleAccessControlRecordNew-AzureStorSimpleAccessControlRecordSet-AzureStorSimpleAccessControlRecordRemove-AzureStorSimpleDeviceBackupDeletes a backup object.RemoveAzureStorSimpleDeviceBackupThe Remove-AzureStorSimpleDeviceBackup cmdlet deletes a single backup object. If you attempt to delete a backup that has already been deleted, this cmdlet returns an error.Remove-AzureStorSimpleDeviceBackupDeviceNameSpecifies the name of the StorSimple device on which to delete a backup.StringBackupSpecifies the Backup object to delete. To obtain a Backup object, use the Get-AzureStorSimpleDeviceBackup cmdlet.BackupForceIndicates that this cmdlet does not prompt you for confirmation.WaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.Remove-AzureStorSimpleDeviceBackupDeviceNameSpecifies the name of the StorSimple device on which to delete a backup.StringBackupIdSpecifies the instance ID of a backup to delete.StringForceIndicates that this cmdlet does not prompt you for confirmation.WaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.BackupSpecifies the Backup object to delete. To obtain a Backup object, use the Get-AzureStorSimpleDeviceBackup cmdlet.BackupBackupnoneBackupIdSpecifies the instance ID of a backup to delete.StringStringnoneDeviceNameSpecifies the name of the StorSimple device on which to delete a backup.StringStringnoneForceIndicates that this cmdlet does not prompt you for confirmation.SwitchParameterSwitchParameternoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneBackupTaskStatusInfo, TaskResponseThis cmdlet returns a TaskStatusInfo object if you specify the WaitForComplete parameter If you do not specify that parameter, it returns a TaskResponse object.Example 1: Remove a backup for a devicePS C:\>Remove-AzureStorSimpleDeviceBackup -DeviceName "Contoso63-AppVm" -BackupId "dcb5c991-0485-400f-8d0a-03a1341ee989" -Force
+The remove job is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId 6c73aff2-f5a1-4b5e-
+9a4e-857e128dc216 for tracking the job status
+This command removes the backup that has the specified ID for the device named Contoso63-AppVm. The command starts the operation that removes the Backup object, and then returns a TaskResponse object. To see the status of the task, use the Get-AzureStorSimpleTask cmdlet. Example 2: Remove the first backup for a device by using its IDPS C:\>$Backup = Get-AzureStorSimpleDeviceBackup -DeviceName "Contoso63-AppVm"
+PS C:\> Remove-AzureStorSimpleDeviceBackup -DeviceName "Contoso63-AppVm" -BackupId $Backup[0].InstanceId -WaitForComplete
+Error : Microsoft.WindowsAzure.Management.StorSimple.Models.ErrorDetails
+JobId : 53a656c3-c082-4e1f-afb7-bff3db45c791
+JobSteps : {}
+Result : Succeeded
+Status : Completed
+TaskResult : Succeeded
+StatusCode : OK
+RequestId : f4411f38d07f68b88095682dbeedd9e9
+The first command gets the backups for the device named Contoso63-AppVm, and then stores them in the $Backup variable. The second command deletes a backup from the device named Contoso63-AppVm. The command uses standard dot notation to refer to the InstanceId property of the first element of the $Backup array. This command specifies the WaitForComplete parameter, and, therefore, the command waits until the operation is complete, and then returns a TaskStatusInfo object.Example 3: Remove the first backup for a device by using the pipelinePS C:\>$Backup = Get-AzureStorSimpleDeviceBackup -DeviceName "Contoso-AppVm" -WaitForComplete
+PS C:\> $Backup[0] | Remove-AzureStorSimpleDeviceBackup -DeviceName "Contoso-AppVm" -Force -WaitForComplete
+Error : Microsoft.WindowsAzure.Management.StorSimple.Models.ErrorDetails
+JobId : 48059fd8-e355-4b91-9385-630d24f31df6
+JobSteps : {}
+Result : Succeeded
+Status : Completed
+TaskResult : Succeeded
+StatusCode : OK
+RequestId : e1753f3bf68e6e44ab719436b5111e41
+The first command gets the backups for the device named Contoso63-AppVm, and then stores them in the $Backup variable. The second command passes the first object stored in the $Backup array to the current cmdlet. That cmdlet deletes that backup from the device named Contoso63-AppVm. This command specifies the WaitForComplete parameter, and, therefore, the command waits until the operation is complete, and then returns a TaskStatusInfo object.Get-AzureStorSimpleDeviceBackupRemove-AzureStorSimpleDeviceBackupPolicyRemoves an existing backup policy.RemoveAzureStorSimpleDeviceBackupPolicyThe Remove-AzureStorSimpleDeviceBackupPolicy cmdlet removes an existing BackupPolicy object. After you remove a backup policy, no further backups take place based on that policy. This cmdlet also deletes all schedules associated with the deleted policy.Remove-AzureStorSimpleDeviceBackupPolicyDeviceNameSpecifies the name of the StorSimple device on which to delete the backup policy.StringBackupPolicySpecifies the BackupPolicyDetails object to delete. To obtain a BackupPolicyDetails object, use the Get-AzureStorSimpleDeviceBackupPolicy cmdlet.BackupPolicyDetailsForceIndicates that this cmdlet does not prompt you for confirmation.WaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.Remove-AzureStorSimpleDeviceBackupPolicyDeviceNameSpecifies the name of the StorSimple device on which to delete the backup policy.StringBackupPolicyIdSpecifies the instance ID of the BackupPolicy object to delete.StringForceIndicates that this cmdlet does not prompt you for confirmation.WaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.BackupPolicySpecifies the BackupPolicyDetails object to delete. To obtain a BackupPolicyDetails object, use the Get-AzureStorSimpleDeviceBackupPolicy cmdlet.BackupPolicyDetailsBackupPolicyDetailsnoneBackupPolicyIdSpecifies the instance ID of the BackupPolicy object to delete.StringStringnoneDeviceNameSpecifies the name of the StorSimple device on which to delete the backup policy.StringStringnoneForceIndicates that this cmdlet does not prompt you for confirmation.SwitchParameterSwitchParameternoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneBackupPolicyDetailsThis cmdlet accepts a BackupPolicyDetails object to delete. TaskStatusInfo, TaskResponseThis cmdlet returns a TaskStatusInfo object if you specify the WaitForComplete parameter. If you do not specify that parameter, it returns a TaskResponse object.Example 1: Remove a backup policyPS C:\>Remove-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -BackupPolicyId "03710b4c-82c1-40ca-be5c-40289dc49642" -Force
+VERBOSE: ClientRequestId: b3e4d485-eae4-4cf4-a43b-815f3abcd2dd_PS
+VERBOSE: ClientRequestId: a260ee98-46aa-49e0-91ac-31d4155f4cae_PS
+VERBOSE: About to create a job to remove your backuppolicy!
+VERBOSE: ClientRequestId: 92a9c264-90df-4345-a495-92767dd266f2_PS
+695be190-ac81-4cf2-b1c5-03ef6b08d005
+VERBOSE: The remove task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+695be190-ac81-4cf2-b1c5-03ef6b08d005 for tracking the task's status
+This command removes the BackupPolicy that has the instance ID 03710b4c-82c1-40ca-be5c-40289dc49642, so that no more backups are made based on this policy. The command also deletes all schedules associated with this policy. The command starts the operation that removes the BackupPolicy object, and then returns a TaskResponse object. To see the status of the task, use the Get-AzureStorSimpleTask cmdlet.Example 2: Remove the first of the backup policies for a devicePS C:\>$Policies = Get-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm"
+PS C:\> Remove-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -BackupPolicyId $Policies[0].InstanceId -Force -WaitForComplete
+VERBOSE: ClientRequestId: db3b49fa-cffa-446d-ba52-daa6802e00f7_PS
+VERBOSE: ClientRequestId: 70e2b56f-c2df-40d0-a1e5-d7a4d7e25962_PS
+VERBOSE: About to run a job to remove your backuppolicy!
+VERBOSE: ClientRequestId: f8eb3d4d-2c57-4fc9-9f40-79d0f2ea1b6a_PS
+
+
+JobId : 820a246e-54b6-41a9-bdd5-15d5daea9b0a
+JobResult : Succeeded
+JobStatus : Completed
+ErrorCode :
+ErrorMessage :
+JobSteps : {Microsoft.WindowsAzure.Management.StorSimple.Models.TaskStep,
+ Microsoft.WindowsAzure.Management.StorSimple.Models.TaskStep}
+
+VERBOSE: The job created for your remove operation has completed successfully.
+The first command gets the backup policies for the device named Contoso63-AppVm, and then stores them in the $Policies variable. The second command removes the first backup policy from Contoso63-AppVm. The command uses standard dot syntax to identify the InstanceId property of the first item in $Policies. This command specifies the WaitForComplete parameter, so the command completes the task, and then returns a TaskStatusInfo object for the task.Example 3: Remove a backup policy by using the pipelinePS C:\>Get-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -BackupPolicyName "TSQAVolume01_Default" | Remove-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -Force -WaitForComplete
+VERBOSE: ClientRequestId: 60080fb1-2f88-4c17-bfd7-21aa73440a9c_PS
+VERBOSE: ClientRequestId: 04c91121-50d7-4796-9af6-fc6a7d6b6a0e_PS
+VERBOSE: ClientRequestId: 47ceb37c-672f-42e8-bd19-1190925c46cd_PS
+VERBOSE: ClientRequestId: cbc39757-f2cc-4cc5-93ea-4ec0fbfb0ca8_PS
+VERBOSE: ClientRequestId: 3614d47a-51fc-4500-a5f1-5401301ca4e3_PS
+VERBOSE: About to create a job to remove your backuppolicy!
+VERBOSE: ClientRequestId: dbd7166e-1888-4b11-9af9-8d49712a8c8b_PS
+702ad240-5730-4015-b051-56055bd2c2d3
+VERBOSE: The remove task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+702ad240-5730-4015-b051-56055bd2c2d3 for tracking the task's status
+VERBOSE: BackupPolicy with id bfe0bf8a-2d09-4690-93da-38a4f24e9f4f found!
+This command gets a BackupPolicyDetails object by using Get-AzureStorSimpleDeviceBackupPolicy, and then passes it to the current cmdlet by using the pipeline operator. The current cmdlet removes the backup policy named TSQAVolume01_Default.Get-AzureStorSimpleDeviceBackupPolicyNew-AzureStorSimpleDeviceBackupPolicySet-AzureStorSimpleDeviceBackupPolicyRemove-AzureStorSimpleDeviceVolumeRemoves a volume from a StorSimple device.RemoveAzureStorSimpleDeviceVolumeThe Remove-AzureStorSimpleDeviceVolume cmdlet removes a volume from a StorSimple device. This cmdlet prompts you for confirmation unless you specify the Force parameter.Remove-AzureStorSimpleDeviceVolumeDeviceNameSpecifies the name of the StorSimple device on which to the volume to remove exists.StringVolumeNameSpecifies the name of the volume to remove.StringWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ForceIndicates that this cmdlet does not prompt you for confirmation.Remove-AzureStorSimpleDeviceVolumeDeviceNameSpecifies the name of the StorSimple device on which to the volume to remove exists.StringVolumeSpecifies the volume to remove, as a VirtualDisk object. To obtain a VirtualDisk object, use the Get-AzureStorSimpleDeviceVolume cmdlet.VirtualDiskWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ForceIndicates that this cmdlet does not prompt you for confirmation.DeviceNameSpecifies the name of the StorSimple device on which to the volume to remove exists.StringStringnoneForceIndicates that this cmdlet does not prompt you for confirmation.SwitchParameterSwitchParameternoneVolumeSpecifies the volume to remove, as a VirtualDisk object. To obtain a VirtualDisk object, use the Get-AzureStorSimpleDeviceVolume cmdlet.VirtualDiskVirtualDisknoneVolumeNameSpecifies the name of the volume to remove.StringStringnoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneVirtualDiskThis cmdlet accepts either the VirtualDisk object to delete or the volume name of the VirtualDisk to delete.TaskStatusInfoThis cmdlet returns a TaskStatusInfo object, if you specify the WaitForComplete parameter.Example 1: Remove a volume by using the pipelinePS C:\>Get-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeName "Volume18" | Remove-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm"
+VERBOSE: ClientRequestId: 2933e24d-9564-42b5-9053-5f0bc4f59ea8_PS
+VERBOSE: ClientRequestId: 7c2d854b-537a-4253-bb0c-c15bc8aa2b49_PS
+VERBOSE: ClientRequestId: 4bf749ac-517c-49e7-8027-a8f62e272014_PS
+VERBOSE: ClientRequestId: 7d9ec87a-616d-4ca9-bfb8-158859174d59_PS
+
+Confirm
+Are you sure you want to remove the volume?
+[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
+VERBOSE: ClientRequestId: 67a38e28-a015-44b1-8159-c1a6604f4d81_PS
+VERBOSE: About to run a job to remove your volume!
+VERBOSE: ClientRequestId: 56101c10-07ca-40f4-8f19-c6fdd895e3a5_PS
+32925451-4451-4478-89f7-d8930505d3fb
+VERBOSE: The delete task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+32925451-4451-4478-89f7-d8930505d3fb for tracking the task's status
+VERBOSE: Volume with name: Volume18 is found.
+This command gets the volume named Volume18 on the device named Contoso63-AppVm, and then passes that volume to the current cmdlet by using the pipeline operator. The current cmdlet starts the task that removes the volume, and then returns a TaskResponse object. To see the status of the task, use the Get-AzureStorSimpleTask cmdlet. The command does not specify the Force parameter, so the cmdlet prompts you for confirmation.Example 2: Remove a volume without confirmationPS C:\>Remove-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeName "Volume18" -Force
+VERBOSE: ClientRequestId: 72f13290-41eb-4ac4-9535-da1a42d0fa0b_PS
+VERBOSE: ClientRequestId: ae0c1d99-1a66-4a69-9260-f2c8c12546bd_PS
+VERBOSE: ClientRequestId: 9610744f-d031-488f-87e6-3ecddb305e13_PS
+VERBOSE: About to run a job to remove your volume!
+VERBOSE: ClientRequestId: d33525d8-7276-4d2a-942d-d10f8078f1f7_PS
+483f8cb4-ebc3-46a9-a9e6-0989e25738a0
+VERBOSE: The delete task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+483f8cb4-ebc3-46a9-a9e6-0989e25738a0 for tracking the task's status
+This command removes the volume named Volume18 from the device named Contoso63-AppVm. The command specifies the Force parameter, so the cmdlet does not prompt you for confirmation.Get-AzureStorSimpleDeviceVolumeNew-AzureStorSimpleDeviceVolumeSet-AzureStorSimpleDeviceVolumeRemove-AzureStorSimpleDeviceVolumeContainerRemoves a volume container from a StorSimple device.RemoveAzureStorSimpleDeviceVolumeContainerThe Remove-AzureStorSimpleDeviceVolumeContainer cmdlet removes a volume container object from a StorSimple device. This cmdlet prompts you for confirmation unless you specify the Force parameter.Remove-AzureStorSimpleDeviceVolumeContainerDeviceNameSpecifies the name of the StorSimple device on which to the volume container to remove exists.StringVolumeContainerSpecifies the volume container to remove, as a DataContainer object. To obtain a DataContainer object, use the Get-AzureStorSimpleDeviceVolumeContainer cmdlet.DataContainerWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ForceIndicates that this cmdlet does not prompt you for confirmation.DeviceNameSpecifies the name of the StorSimple device on which to the volume container to remove exists.StringStringnoneForceIndicates that this cmdlet does not prompt you for confirmation.SwitchParameterSwitchParameternoneVolumeContainerSpecifies the volume container to remove, as a DataContainer object. To obtain a DataContainer object, use the Get-AzureStorSimpleDeviceVolumeContainer cmdlet.DataContainerDataContainernoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneDataContainerThis cmdlet accepts a DataContainer object to remove.TaskStatusInfoThis cmdlet returns a TaskStatusInfo object, if you specify the WaitForComplete parameter.Example 1: Remove a container by using the pipelinePS C:\>Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm" -VolumeContainerName "Container08" | Remove-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm" -Force
+VERBOSE: ClientRequestId: 0efbb4fc-ceb0-4311-bc49-0e08161d0a37_PS
+VERBOSE: ClientRequestId: bf5b615f-47e3-4868-91b6-f2d12217a302_PS
+VERBOSE: ClientRequestId: 5590c87e-0602-4197-b6c3-cf58b0e7a7b3_PS
+VERBOSE: ClientRequestId: b33c71ac-c345-44ff-8213-d7fdf9f8480a_PS
+VERBOSE: ClientRequestId: 903d42ef-58f4-4e89-ba7f-5f234262356d_PS
+VERBOSE: About to create a job to remove your Volume container!
+VERBOSE: ClientRequestId: 2279575f-5115-4344-9c6f-9ef599bd203e_PS
+e9ddec89-67ac-4e2e-a2ed-820de3547bb0
+VERBOSE: The delete task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+e9ddec89-67ac-4e2e-a2ed-820de3547bb0 for tracking the task's status
+VERBOSE: Volume container with name: Container08 is found.
+This command gets the volume container named Container08 on the device named Contoso63-AppVm by using the Get-AzureStorSimpleDeviceVolumeContainer cmdlet. The command passes the volume container to the current cmdlet by using the pipeline operator. This command starts the task to remove the container, and then returns a TaskResponse object. To see the status of the task, use the Get-AzureStorSimpleTask cmdlet. This command specifies the Force parameter, so it does not prompt you for confirmation.Get-AzureStorSimpleDeviceVolumeContainerNew-AzureStorSimpleDeviceVolumeContainerRemove-AzureStorSimpleStorageAccountCredentialDeletes an existing storage account credential.RemoveAzureStorSimpleStorageAccountCredentialThe Remove-AzureStorSimpleStorageAccountCredential cmdlet deletes an existing storage account credential. Specify an account by name or use the Get-AzureStorSimpleStorageAccountCredential cmdlet to obtain a StorageAccountCredential object to delete.Remove-AzureStorSimpleStorageAccountCredentialStorageAccountNameSpecifies the name of the storage account credential to delete.StringWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ForceIndicates that this cmdlet does not prompt you for confirmation.Remove-AzureStorSimpleStorageAccountCredentialSACSpecifies credential, as a StorageAccountCredential object, to remove. To obtain a StorageAccountCredential object, use the Get-AzureStorSimpleStorageAccountCredential cmdlet.StorageAccountCredentialResponseWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ForceIndicates that this cmdlet does not prompt you for confirmation.ForceIndicates that this cmdlet does not prompt you for confirmation.SwitchParameterSwitchParameternoneSACSpecifies credential, as a StorageAccountCredential object, to remove. To obtain a StorageAccountCredential object, use the Get-AzureStorSimpleStorageAccountCredential cmdlet.StorageAccountCredentialResponseStorageAccountCredentialResponsenoneStorageAccountNameSpecifies the name of the storage account credential to delete.StringStringnoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneStorageAccountCredentialThis cmdlet accepts a StorageAccountCredential object by using the pipeline.TaskStatusInfoThis cmdlet returns a TaskStatusInfo object, if you specify the WaitForComplete parameter.Example 1: Remove a storage account credentialPS C:\>Remove-AzureStorSimpleStorageAccountCredential -StorageAccountName "ContosoStorage07" -Force
+VERBOSE: ClientRequestId: 8e10d56b-ddb1-459b-b26e-a185f5a303de_PS
+VERBOSE: About to create a job to remove your Storage Access Credential!
+VERBOSE: ClientRequestId: 55cb6296-0156-4266-8591-d9e9bf8cc584_PS
+982f4b19-ccb0-4ad3-9b02-f8ad25bf2e72
+VERBOSE: The delete task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+982f4b19-ccb0-4ad3-9b02-f8ad25bf2e72 for tracking the task's status
+This command removes the account credential for the storage account named ContosoStorage07. This command specifies the Force parameter. The cmdlet removes the credential without prompting your for confirmation.Example 2: Remove a storage account credential by using the pipeline operatorPS C:\>Get-AzureStorSimpleStorageAccountCredential -StorageAccountName "ContosoStorage07" | Remove-AzureStorSimpleStorageAccountCredential -Force -WaitForComplete
+VERBOSE: ClientRequestId: f1b46216-bf4c-4c19-8e92-1dfe3894e258_PS
+VERBOSE: ClientRequestId: 0d946f8f-c771-4ade-8a83-7c08dad86c52_PS
+VERBOSE: ClientRequestId: 2000bab6-8311-4192-ad12-c67e35fc2697_PS
+VERBOSE: Storage Access Credential with name ContosoStorage07 found!
+VERBOSE: About to run a job to remove your Storage Access Credential!
+VERBOSE: ClientRequestId: b803b165-bef8-4a8f-9509-4b515ea8bdec_PS
+VERBOSE: Your delete operation completed successfully!
+This command gets the storage account named ContosoStorage07 by using the Get-AzureStorSimpleStorageAccountCredential cmdlet, and then passes that object to the current cmdlet. The current cmdlet removes the credential for that storage account. This command specifies the WaitForComplete parameter. The cmdlet does not return control to the console until it completes the remove operation.Get-AzureStorSimpleStorageAccountCredentialNew-AzureStorSimpleStorageAccountCredentialSet-AzureStorSimpleStorageAccountCredentialSelect-AzureStorSimpleResourceSets a resource as the current resource.SelectAzureStorSimpleResourceThe Select-AzureStorSimpleResource cmdlet sets a resource as the current resource. After you select a resource, other cmdlets apply within that resource context.Select-AzureStorSimpleResourceResourceNameSpecifies the name of the resource to select as the current resource.StringRegistrationKeySpecifies a registration key. Specify a key the first time that you select a resource. After this cmdlet selects the current resource, cmdlets use this key, as required. For more information, see Get the service registration key (http://msdn.microsoft.com/en-us/library/azure/dn772346.aspx) on the Microsoft Developer Network. StringRegistrationKeySpecifies a registration key. Specify a key the first time that you select a resource. After this cmdlet selects the current resource, cmdlets use this key, as required. For more information, see Get the service registration key (http://msdn.microsoft.com/en-us/library/azure/dn772346.aspx) on the Microsoft Developer Network. StringStringnoneResourceNameSpecifies the name of the resource to select as the current resource.StringStringnoneNoneStorSimpleResourceContextThis cmdlet returns a StorSimpleResourceContext object that contains details for the resource context. Example 1: Select a resource for the first timePS C:\>Select-AzureStorSimpleResource -ResourceName "Contoso64-Tsqa" -RegistrationKey "<your registration key>"
+VERBOSE: Initializing resource context
+VERBOSE: ClientRequestId: a9ed56d3-daf2-4b80-93d4-767af08d36e4_PS
+VERBOSE: ClientRequestId: 97ceae7b-189c-4664-93a1-a0e814304bc8_PS
+VERBOSE: ClientRequestId: 9d9cd6bc-3553-479a-9f41-dfef4c5c597d_PS
+VERBOSE: Registration key passed - initializing secrets
+VERBOSE: RegistrationKey #parts:3
+VERBOSE: ClientRequestId: 3e28c01b-f433-47d3-8052-7389c30bdd47_PS
+VERBOSE: ClientRequestId: 52314a54-bd43-4c7e-b36d-a2fd9d89f819_PS
+VERBOSE: ClientRequestId: d460582a-39e7-484f-9936-8eeff8d9d41b_PS
+VERBOSE: Secrets validation complete
+VERBOSE: Context set successfully for the given resource name.
+VERBOSE: ClientRequestId: 386952c7-1042-4234-b41a-5211a381ee9a_PS
+
+
+ResourceId : 1975530557201809476
+StampId : 7ef900f6-ad91-497d-a9c5-2742b7ed4a75
+CloudServiceName : CisService-DTYHC5NYB4BUTV3ZHFNSEZIKE5ZGLGYR44OJUL5OQGG4I2EMYOZA-west-us
+ResourceProviderNameSpace : WACis
+ResourceType : CisVault
+ResourceName : Contoso64-Tsqa
+StorSimpleKeyManager : Microsoft.WindowsAzure.Commands.StorSimple.Encryption.StorSimpleKeyManager
+This command selects the resource named Contoso64-Tsqa as the current context. In this example, the computer has not had this context initialized previously, and, therefore, you must specify a value for the RegistrationKey parameter. Example 2: Attempt to select a resourceThis command gets the current context for this computer by using the Get-AzureStorSimpleResourceContext cmdlet. The current selected resource is Contoso64-Tsqa. This is consistent with the previous example.
+PS C:\>Get-AzureStorSimpleResourceContext
+VERBOSE: ClientRequestId: 643be116-245f-474a-bb15-e7941b0b9cc7_PS
+
+
+ResourceId : 1975530557201809476
+StampId : 7ef900f6-ad91-497d-a9c5-2742b7ed4a75
+CloudServiceName : ASDService-DTYHC5NYB4BUTV3ZHFNSEZIKE5ZGLGYR44OJUL5OQGG4I2EMYOZA-west-us
+ResourceProviderNameSpace : WACis
+ResourceType : CisVault
+ResourceName : Contoso64-Tsqa
+StorSimpleKeyManager : Microsoft.WindowsAzure.Commands.StorSimple.Encryption.StorSimpleKeyManager
+
+VERBOSE: You have a resource selected. Resource Name: Contoso64-Tsqa Id: Contoso64-Tsqa
+
+This command attempts to reset the resource to be Contoso02-Resource. For this example, this resource has not been previously selected. The registration key is not saved or included in the command. The command cannot select the resource.
+PS C:\>Select-AzureStorSimpleResource -ResourceName "Contoso02-Resource"
+VERBOSE: Initializing resource context
+VERBOSE: ClientRequestId: 3a9aac2a-606a-47a7-8a67-394676f9f0cf_PS
+VERBOSE: ClientRequestId: 6599fb6c-3def-4c2f-83d7-3f77729f06ec_PS
+VERBOSE: ClientRequestId: 9e6f108d-fc0a-4a92-8925-560f4265c083_PS
+VERBOSE: Registrtion key not passed - validating that the secrets are already initialized
+VERBOSE: ClientRequestId: 64e7b058-050c-4573-8eed-932d728ba360_PS
+Select-AzureStorSimpleResource : Could not find the persisted secret. Please use Select-AzureStorSimpleResource and
+provide the Registration key once again.
+Example 3: Select a previously selected resource PS C:\>Select-AzureStorSimpleResource -ResourceName "Contoso64-Tsqa"
+VERBOSE: Initializing resource context
+VERBOSE: ClientRequestId: fb9f7fd0-7807-4b8f-b5eb-8312e06046c6_PS
+VERBOSE: ClientRequestId: dc87be70-1dd5-4952-94b6-6703dd61ed55_PS
+VERBOSE: ClientRequestId: a30e0bb5-0520-411d-8b21-e07048be7ba1_PS
+VERBOSE: Registration key not passed - validating that the secrets are already initialized
+VERBOSE: ClientRequestId: a7860dbe-eadc-483b-b528-947ff6211c2d_PS
+VERBOSE: ClientRequestId: c4ff967f-f601-4093-909f-9985d81967cd_PS
+VERBOSE: Secrets validation complete
+VERBOSE: Context set successfully for the given resource name.
+VERBOSE: ClientRequestId: 431877b1-275b-41d5-832f-64775a1896a9_PS
+
+
+ResourceId : 1975530557201809476
+StampId : 7ef900f6-ad91-497d-a9c5-2742b7ed4a75
+CloudServiceName : CisService-DTYHC5NYB4BUTV3ZHFNSEZIKE5ZGLGYR44OJUL5OQGG4I2EMYOZA-west-us
+ResourceProviderNameSpace : WACis
+ResourceType : CisVault
+ResourceName : Contoso64-Tsqa
+StorSimpleKeyManager : Microsoft.WindowsAzure.Commands.StorSimple.Encryption.StorSimpleKeyManager
+This command selects the resource named Contoso64-Tsqa as the current context. In this example, that context has previously been selected, and, therefore, you do not need to specify a value for the RegistrationKey parameter.Get-AzureStorSimpleResourceGet-AzureStorSimpleResourceContextSet-AzureStorSimpleAccessControlRecordUpdates the IQN of an access control record.SetAzureStorSimpleAccessControlRecordThe Set-AzureStorSimpleAccessControlRecord cmdlet updates the iSCSI qualified name (IQN) of an existing access control record.Set-AzureStorSimpleAccessControlRecordACRNameSpecifies a name of the access control record to modify.StringIQNInitiatorNameSpecifies the IQN of the iSCSI initiator to which this cmdlet provides access for the volume.StringWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ACRNameSpecifies a name of the access control record to modify.StringStringnoneIQNInitiatorNameSpecifies the IQN of the iSCSI initiator to which this cmdlet provides access for the volume.StringStringnoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneNoneTaskStatusInfo, TaskResponseThis cmdlet returns a TaskStatusInfo object if you specify the WaitForComplete parameter. If you do not specify that parameter, it returns a TaskResponse object. Example 1: Update an access control recordPS C:\>Set-AzureStorSimpleAccessControlRecord -ACRName "Acr10" -IQNInitiatorName "IqnUpdated" -WaitForComplete
+VERBOSE: ClientRequestId: e4766335-f302-40e0-93bf-fad7aa488ae6_PS
+VERBOSE: ClientRequestId: cfdbbd67-6ba5-4238-b743-b88f604079b9_PS
+VERBOSE: About to run a task to update your Access Control Record!
+VERBOSE: ClientRequestId: d5cf2793-0ab5-40ff-ab6f-43e21bc4c0a4_PS
+
+
+JobId : 89502523-52fc-4ce2-b2d4-cb8c6692fb60
+JobResult : Succeeded
+JobStatus : Completed
+ErrorCode :
+ErrorMessage :
+JobSteps : {}
+
+VERBOSE: The job created for your update operation has completed successfully.
+VERBOSE: ClientRequestId: cbd47519-3a3c-4365-b097-0fb7551c48ee_PS
+GlobalId :
+InitiatorName : IqnUpdated
+InstanceId : 9bcfbc83-e196-4688-9016-827f51515c24
+Name : Acr10
+OperationInProgress : None
+VolumeCount : 0
+
+This command updates the access control record named Acr10 for the iSCSI initiator named IqnUpdated. This command specifies the WaitForComplete parameter, and, therefore, the command waits until the operation is complete, and then returns a TaskStatusInfo object.Get-AzureStorSimpleAccessControlRecordNew-AzureStorSimpleAccessControlRecordRemove-AzureStorSimpleAccessControlRecordSet-AzureStorSimpleDeviceBackupPolicyUpdates an existing backup policy.SetAzureStorSimpleDeviceBackupPolicyThe Set-AzureStorSimpleDeviceBackupPolicy cmdlet updates an existing backup policy. You can rename the policy, add, update or delete schedules, and update the volumes associated with the policy.Set-AzureStorSimpleDeviceBackupPolicyDeviceNameSpecifies the name of the StorSimple device for which to update the backup policy.StringBackupPolicyIdSpecifies the instance ID of the BackupPolicy object to update.StringBackupPolicyNameSpecifies a new name for the backup policy.StringBackupSchedulesToAddSpecifies an array of BackupScheduleBase objects to add to the policy. To obtain a BackupScheduleBase object, use the New-AzureStorSimpleDeviceBackupScheduleAddConfig cmdlet.PSObject[]BackupSchedulesToUpdateSpecifies an array of BackupScheduleUpdateRequest objects to update. To obtain a BackupScheduleUpdateRequest object, use the New-AzureStorSimpleDeviceBackupScheduleUpdateConfig cmdlet.PSObject[]BackupScheduleIdsToDeleteSpecifies an array of instance IDs of BackupSchedule objects to delete.PSObject[]VolumeIdsToUpdateSpecifies an array of IDs of volumes for which to update backup policies.PSObject[]WaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.BackupPolicyIdSpecifies the instance ID of the BackupPolicy object to update.StringStringnoneBackupPolicyNameSpecifies a new name for the backup policy.StringStringnoneBackupScheduleIdsToDeleteSpecifies an array of instance IDs of BackupSchedule objects to delete.PSObject[]PSObject[]noneBackupSchedulesToAddSpecifies an array of BackupScheduleBase objects to add to the policy. To obtain a BackupScheduleBase object, use the New-AzureStorSimpleDeviceBackupScheduleAddConfig cmdlet.PSObject[]PSObject[]noneBackupSchedulesToUpdateSpecifies an array of BackupScheduleUpdateRequest objects to update. To obtain a BackupScheduleUpdateRequest object, use the New-AzureStorSimpleDeviceBackupScheduleUpdateConfig cmdlet.PSObject[]PSObject[]noneDeviceNameSpecifies the name of the StorSimple device for which to update the backup policy.StringStringnoneVolumeIdsToUpdateSpecifies an array of IDs of volumes for which to update backup policies.PSObject[]PSObject[]noneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneNoneTaskStatusInfo, TaskResponseThis cmdlet returns a TaskStatusInfo object if you specify the WaitForComplete parameter. If you do not specify that parameter, it returns a TaskResponse object.Example 1: Change the name of a backup policyPS C:\>Set-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -BackupPolicyId "e6d9f1b3-a250-4d57-966a-039c8eaef9e9" -BackupPolicyName "UpdatedGeneralPolicy07" -WaitForComplete
+VERBOSE: ClientRequestId: f4465b46-26cc-40ff-88da-7a28df88c35c_PS
+VERBOSE: ClientRequestId: 5e33a35c-e089-47c1-b760-474635b1ead8_PS
+VERBOSE: About to run a task to update your backuppolicy!
+VERBOSE: ClientRequestId: e379ebdb-667f-45a9-aafa-a6cd61e5f6f6_PS
+
+
+JobId : 9d621bfd-3faa-4d1c-b28b-45c5f4a96975
+JobResult : Succeeded
+JobStatus : Completed
+ErrorCode :
+ErrorMessage :
+JobSteps : {Microsoft.WindowsAzure.Management.StorSimple.Models.TaskStep}
+
+VERBOSE: The job created for your update operation has completed successfully.
+VERBOSE: ClientRequestId: 4fe965ea-4e12-4869-9d67-e42a24b6c5d8_PS
+BackupSchedules : {58e9cd7c-4c6a-4e33-9109-5ec0b8fcb2cc, b10e1bf4-ef0a-4ad3-8fde-eecfc9971dd2}
+Volumes : {testvolume03}
+BackupPolicyCreationType : BySaaS
+LastBackup : 12/16/2014 2:13:28 PM
+NextBackup : 12/16/2014 3:13:43 PM
+SchedulesCount : 2
+SSMHostName :
+VolumesCount : 1
+InstanceId : e6d9f1b3-a250-4d57-966a-039c8eaef9e9
+Name : UpdatedGeneralPolicy07
+OperationInProgress : None
+This command changes the name of the backup policy that has the specified ID to UpdatedGeneralPolicy07. This command specifies the WaitForComplete parameter, so the command completes the task, and then returns a TaskStatusInfo object for the task.Example 2: Update the schedule for a backup policyPS C:\>$UpdateConfig = New-AzureStorSimpleDeviceBackupScheduleUpdateConfig -Id "3a6c6247-6b4d-42e2-aa87-16f4f21476ea" -BackupType CloudSnapshot -RecurrenceType Daily -RecurrenceValue 3 -RetentionCount 2 -Enabled $True
+PS C:\> $UpdateArray = @()
+PS C:\> $UpdateArray += $UpdateConfig
+PS C:\> Set-AzureStorSimpleDeviceBackupPolicy -DeviceName "Contoso63-AppVm" -BackupPolicyId "712605f6-eb03-4db8-8f79-e0ce64b2cce1" -BackupSchedulesToUpdate $UpdateArray
+
+Error : Microsoft.WindowsAzure.Management.StorSimple.Models.ErrorDetails
+JobId : 7b265417-a5f1-45ad-8fbc-33bad4f63ec9
+JobSteps : {Microsoft.WindowsAzure.Management.StorSimple.Models.JobStep,
+ Microsoft.WindowsAzure.Management.StorSimple.Models.JobStep,
+ Microsoft.WindowsAzure.Management.StorSimple.Models.JobStep,
+ Microsoft.WindowsAzure.Management.StorSimple.Models.JobStep...}
+Result : Succeeded
+Status : Completed
+TaskResult : Succeeded
+StatusCode : OK
+RequestId : d2e10d44e699b371a84db44d19daf1c3
+The first command creates an update configuration object by using the New-AzureStorSimpleDeviceBackupScheduleUpdateConfig cmdlet, and then stores it in the $UpdateConfig variable. The second command creates a new array variable, named $UpdateArray. The next command adds the update stored in $UpdateConfig to that array. You can add more than one update to the array. The final command updates the backup policy that has the specified ID on the device named Contoso63-AppVm. The policy now has the updated schedule stored in $UpdateArray.Get-AzureStorSimpleDeviceBackupPolicyNew-AzureStorSimpleDeviceBackupPolicyRemove-AzureStorSimpleDeviceBackupPolicyNew-AzureStorSimpleDeviceBackupScheduleUpdateConfigSet-AzureStorSimpleDeviceVolumeUpdates the properties of an existing volume.SetAzureStorSimpleDeviceVolumeThe Set-AzureStorSimpleDeviceVolume cmdlet updates the properties of an existing volume. This cmdlet associates a volume with one or more access control records. To obtain AccessControlRecord objects, use the Get-AzureStorSimpleAccessControlRecord cmdlet. Update the size or type for the volume. Also, update whether to create the volume online.Set-AzureStorSimpleDeviceVolumeDeviceNameSpecifies the name of the StorSimple device on which to update the volume exists.StringVolumeNameSpecifies the name of the volume to update.StringOnlineSpecifies whether the volume is online.BooleanVolumeSizeNullable [System.Int64]VolumeAppTypeSpecifies whether to update the volume to be a primary or archive volume. Valid values are: PrimaryVolume and ArchiveVolume. AppTypeAccessControlRecordsSpecifies a list of access control records to associate with the volume.0, Culture=neutral, PublicKeyToken=nullWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.AccessControlRecordsSpecifies a list of access control records to associate with the volume.0, Culture=neutral, PublicKeyToken=null0, Culture=neutral, PublicKeyToken=nullnoneDeviceNameSpecifies the name of the StorSimple device on which to update the volume exists.StringStringnoneOnlineSpecifies whether the volume is online.BooleanBooleannoneVolumeAppTypeSpecifies whether to update the volume to be a primary or archive volume. Valid values are: PrimaryVolume and ArchiveVolume. AppTypeAppTypenoneVolumeNameSpecifies the name of the volume to update.StringStringnoneVolumeSizeNullable [System.Int64]Nullable [System.Int64]noneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneList<AccessControlRecord>This cmdlet accepts a list of AccessControlRecord objects to associate to a volume.TaskStatusInfoThis cmdlet returns a TaskStatusInfo object, if you specify the WaitForComplete parameter. Example 1: Update online value for a volumePS C:\>Set-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeName "Volume18" -Online $False
+VERBOSE: ClientRequestId: f2869570-ea47-4be7-801e-9c0f22f2600d_PS
+VERBOSE: ClientRequestId: c70bb86a-51d3-4390-be17-4d0847641dc3_PS
+VERBOSE: ClientRequestId: d20cb5b2-6b3c-4e06-af99-cada28c5e50a_PS
+VERBOSE: ClientRequestId: ab6d533e-b55b-4cfb-9c58-9153295e0547_PS
+de7000f1-29c7-4102-a375-b52432f9e67e
+VERBOSE: The update task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+de7000f1-29c7-4102-a375-b52432f9e67e for tracking the task's status
+This command updates the volume named Volume18 to have an online value of $False. This command starts the task, and then returns a TaskResponse object. To see the status of the task, use the Get-AzureStorSimpleTask cmdlet.Example 2: Modify online value and typePS C:\>Set-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeName "Volume18" -Online $True -VolumeAppType ArchiveVolume
+VERBOSE: ClientRequestId: af42b02a-645e-4801-a2d7-4197511c68cf_PS
+VERBOSE: ClientRequestId: 7cb4f3b4-548e-42dc-a38c-0df0911c5206_PS
+VERBOSE: ClientRequestId: 7cc706ad-a58f-4939-8e78-cabae8379a51_PS
+VERBOSE: ClientRequestId: 6bed21d5-12fc-4a12-a89c-120bdb5636b1_PS
+aa977225-af78-4c93-b754-72704afc928f
+VERBOSE: The update task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
+aa977225-af78-4c93-b754-72704afc928f for tracking the task's status
+This command updates the volume named Volume18. It modifies the type and changes the value of the Online parameter to $True. Get-AzureStorSimpleDeviceVolumeNew-AzureStorSimpleDeviceVolumeRemove-AzureStorSimpleDeviceVolumeGet-AzureStorSimpleAccessControlRecordSet-AzureStorSimpleStorageAccountCredentialUpdates an Azure storage access credential. SetAzureStorSimpleStorageAccountCredentialThe Set-AzureStorSimpleStorageAccountCredential cmdlet update an existing Azure storage access credential for use by StorSimple OneSDK cmdlets. For more information about how StorSimple cmdlets work with storage accounts, see the help topic for the New-AzureStorSimpleStorageAccountCredential cmdlet. Set-AzureStorSimpleStorageAccountCredentialStorageAccountNameSpecifies the name of an existing storage account. StringStorageAccountKeySpecifies the access key of the storage account in plain text. StringUseSSLIndicates whether to use SSL for the connection when using the new storage account credential.BooleanWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.StorageAccountKeySpecifies the access key of the storage account in plain text. StringStringnoneStorageAccountNameSpecifies the name of an existing storage account. StringStringnoneUseSSLIndicates whether to use SSL for the connection when using the new storage account credential.BooleanBooleannoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneNoneStorageAccountCredentialResponse, TaskResponseThis cmdlet returns a StorageAccountCredentialResponse object, if you specify the WaitForComplete parameter. If you do not specify that parameter, the cmdlet returns a TaskResponse object. A StorageAccountCredentialResponse contains the following properties:
+
+-- CloudType (CloudType)
+-- Hostname (String)
+-- InstanceId (String)
+-- IsDefault (Boolean)
+-- Location (String)
+-- Login (String)
+-- Name (String)
+-- OperationInProgress (OperationInProgress)
+-- Password (String)
+-- PasswordEncryptionCertThumbprint (String)
+-- UseSSL (Boolean)
+-- VolumeCount (int)Example 1: Modify a credentialPS C:\>Set-AzureStorSimpleStorageAccountCredential -StorageAccountName "ContosoStorage01" -UseSSL $False -StorageAccountKey "h9ldH4LlHJB3GujcNwgdxJACy1DaQ1Hak1bfoUBzrDqZ5DPK8+0XGbsgD+jrKfQy5PBepKpYobMViLaOC2XMdg==" -Force -WaitForComplete
+VERBOSE: ClientRequestId: 20cd2b17-9cff-4ab4-a034-96d60d946295_PS
+VERBOSE: ClientRequestId: a75ed193-1da5-491f-96f5-572b5461d466_PS
+VERBOSE: ClientRequestId: db612c9e-e89a-404f-8406-e66e7f697cd5_PS
+VERBOSE: Storage credential verification succeeded.
+VERBOSE: Encryption in progress...
+VERBOSE: About to run a task to update your Storage Access credential!
+VERBOSE: ClientRequestId: a0995bb7-8223-4fcf-83c9-0a4f81e6a85c_PS
+
+
+JobId : 74a6172e-d47a-4824-a7fa-3eb207a76e0b
+JobResult : Succeeded
+JobStatus : Completed
+ErrorCode :
+ErrorMessage :
+JobSteps : {}
+
+VERBOSE: The job created for your update operation has completed successfully.
+VERBOSE: ClientRequestId: de04c77b-4846-45e0-9257-df501af9d4e9_PS
+CloudType : Azure
+Hostname : blob.core.windows.net
+InstanceId : 8b3cb7bb-963b-4173-9598-52fe230b0350
+IsDefault : False
+Location : West US
+Login : ContosoStorage01
+Name : ContosoStorage01
+OperationInProgress : None
+Password : UUejow8u6ZynMm18g59883FBVtlIX6PWh6x+v15cnnkHKEAb5queTGnGOiGa/KkOqths7F/umDz+wUUB8zzq
+ 4YCi0Dm0rqPGDC4unhxvbncf+WeCEvV7qsf3pmUFdk8o96Cgl8oXgmmvYL9K6Z6ajHUdZFFlq9WqUpz2vBbz
+ 3ROxq8SRORt2DQVQP6LWojTiow1kNI/v2cs3eNvzoSgGftqzjSmhaTYu+q0o8X07eE4KwkWhQrRX24seH2Lg
+ N9aYCQUrSxVKOAFJjdLOIBUlM48pnE7xyyZNwqngnPLt8z+mlS6JCKfo5SBKUfwmkhgDFfbVwB3jqC/sV/G6
+ omwQ/A==
+PasswordEncryptionCertThumbprint :
+UseSSL : False
+VolumeCount : 0
+This command changes the storage account credential named ContosoStorage01 to no longer require SSL. Get-AzureStorSimpleStorageAccountCredentialNew-AzureStorSimpleStorageAccountCredentialRemove-AzureStorSimpleStorageAccountCredentialStart-AzureStorSimpleDeviceBackupJobStarts a new job that creates a backup from an existing backup policy.StartAzureStorSimpleDeviceBackupJobThe Start-AzureStorSimpleDeviceBackupJob cmdlet starts a new job that creates a backup from an existing backup policy on a StorSimple device. By default, this cmdlet creates a local snapshot backup. To create a cloud backup, specify a value of CloudSnapshot for the BackupType parameter.Start-AzureStorSimpleDeviceBackupJobDeviceNameSpecifies the name of the StorSimple device on which to start the backup job. StringBackupPolicyIdSpecifies the ID of the backup policy to use to create the backup.StringWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.Start-AzureStorSimpleDeviceBackupJobDeviceNameSpecifies the name of the StorSimple device on which to start the backup job. StringBackupPolicyIdSpecifies the ID of the backup policy to use to create the backup.StringBackupTypeSpecifies the backup type. Valid values are: LocalSnapshot and CloudSnapshot.LocalSnapshotCloudSnapshotWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.BackupPolicyIdSpecifies the ID of the backup policy to use to create the backup.StringStringnoneBackupTypeSpecifies the backup type. Valid values are: LocalSnapshot and CloudSnapshot.StringStringnoneDeviceNameSpecifies the name of the StorSimple device on which to start the backup job. StringStringnoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneNoneTaskStatusInfo, TaskResponseThis cmdlet returns a TaskStatusInfo object if you specify the WaitForComplete parameter. If you do not specify that parameter, it returns a TaskResponse object.Example 1: Create a local snapshot backupPS C:\>Start-AzureStorSimpleDeviceBackupJob -DeviceName "Contoso63-AppVm" -BackupPolicyId "de088eac-b283-4d92-b501-a759845fdf3f"
+JobId StatusCode RequestId
+----- ---------- ---------
+fb9acdca-ed6f-4b69-93f2-5c0bce0a1e08 Accepted 456cf6bafd427103b71c07145e26d35c
+
+VERBOSE: Your backup operation has been submitted for processing. Use commandlet "Get-AzureStorSimpleJob -JobId
+fb9acdca-ed6f-4b69-93f2-5c0bce0a1e08" to track status.
+
+This command creates a local snapshot backup for the specified policy ID. This command starts the job, and then returns a TaskResponse object. To see the status of the job, use the Get-AzureStorSimpleTask cmdlet.Example 2: Create a cloud snapshot backup and wait to finishPS C:\>Start-AzureStorSimpleDeviceBackupJob -DeviceName "Contoso63-AppVm" -BackupPolicyId "de088eac-b283-4d92-b501-a759845fdf3f" -BackupType CloudSnapshot -WaitForComplete
+Error : Microsoft.WindowsAzure.Management.StorSimple.Models.ErrorDetails
+JobId : fb9acdca-ed6f-4b69-93f2-5c0bce0a1e08
+JobSteps : {}
+Result : Succeeded
+Status : Completed
+TaskResult : Succeeded
+StatusCode : OK
+RequestId : f28ecf6cf75a7f128ca18e6ae14f9003
+This command creates a cloud snapshot backup for the specified policy ID. This command specifies the WaitForComplete parameter, so the command completes the task, and then returns a TaskStatusInfo object for the job.Start-AzureStorSimpleDeviceBackupRestoreJobStart-AzureStorSimpleDeviceBackupRestoreJobStarts a job that restores a backup on a StorSimple device.StartAzureStorSimpleDeviceBackupRestoreJobThe Start-AzureStorSimpleDeviceBackupRestoreJob cmdlet starts a job that restores a backup on a StorSimple device. Specify a backup ID and an optional snapshot ID.Start-AzureStorSimpleDeviceBackupRestoreJobDeviceNameSpecifies the name of the StorSimple device on which the backup exists.StringBackupIdSpecifies the instance ID of the backup to restore.StringWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ForceIndicates that this cmdlet does not prompt you for confirmation.Start-AzureStorSimpleDeviceBackupRestoreJobDeviceNameSpecifies the name of the StorSimple device on which the backup exists.StringBackupIdSpecifies the instance ID of the backup to restore.StringSnapshotIdSpecifies the instance ID of the snapshot to restore. StringWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.ForceIndicates that this cmdlet does not prompt you for confirmation.BackupIdSpecifies the instance ID of the backup to restore.StringStringnoneDeviceNameSpecifies the name of the StorSimple device on which the backup exists.StringStringnoneForceIndicates that this cmdlet does not prompt you for confirmation.SwitchParameterSwitchParameternoneSnapshotIdSpecifies the instance ID of the snapshot to restore. StringStringnoneWaitForCompleteIndicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell® console.SwitchParameterSwitchParameternoneNoneTaskStatusInfo, TaskResponseThis cmdlet returns a TaskStatusInfo object if you specify the WaitForComplete parameter. If you do not specify that parameter, it returns a TaskResponse object.Example 1: Start a job to restore a backupPS C:\>Start-AzureStorSimpleDeviceBackupRestoreJob -DeviceName "Contoso63-AppVm" -BackupId "b3b50534-763c-4b05-9724-5ecf62bde721" -WaitForComplete
+Confirm
+Are you sure you want to restore the backup with backupId b3b50534-763c-4b05-9724-5ecf62bde721?
+[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
+
+
+Error : Microsoft.WindowsAzure.Management.StorSimple.Models.ErrorDetails
+JobId : 217d0647-c001-4f43-9833-f8155a458e95
+JobSteps : {}
+Result : Succeeded
+Status : Completed
+TaskResult : Succeeded
+StatusCode : OK
+RequestId : e0aa2dcd2f197a8588c40a067fe0e519
+
+This command starts a job that restores the backup object that has the specified ID, and its associated snapshots, on the device named Contoso63-AppVm. The command specifies the WaitForComplete parameter, so the job finishes before the cmdlet returns control to the console.Example 2: Start a job to restore a specific snapshot PS C:\>Start-AzureStorSimpleDeviceBackupRestoreJob -DeviceName "Contoso63-AppVm" -BackupId "b3b50534-763c-4b05-9724-5ecf62bde721" -SnapshotId "2d0cfad7-46bf-4266-8859-96549646e947_0000000000000000" -Force
+
+The start job is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId 9102ed9a-078f-4648-a
+721-3cffbba31336 for tracking the job status
+This command starts a job that restores the backup snapshot that has the specified ID. The command specifies the backup object by ID on the device named Contoso63-AppVm. The command specifies the Force parameter, so it starts the job without prompting you to confirm. Start-AzureStorSimpleDeviceBackupJob
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Models/PSContracts.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Models/PSContracts.cs
new file mode 100644
index 000000000000..989beae8a377
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Models/PSContracts.cs
@@ -0,0 +1,53 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Diagnostics.CodeAnalysis;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ ///
+ /// Represents resource / vault credentials.
+ ///
+ [SuppressMessage(
+ "Microsoft.StyleCop.CSharp.MaintainabilityRules",
+ "SA1402:FileMayOnlyContainASingleClass",
+ Justification = "Keeping all contracts together.")]
+ public class ResourceCredentials
+ {
+ ///
+ /// Gets or sets the name of the resource name.
+ ///
+ public string ResourceName { get; set; }
+
+ ///
+ /// Gets or sets the name of the cloud service name.
+ ///
+ public string CloudServiceName { get; set; }
+
+ ///
+ ///
+ ///
+ public string ResourceNameSpace { get; set; }
+
+ public string ResourceType { get; set; }
+
+ public string StampId { get; set; }
+
+ public string ResourceId { get; set; }
+
+ public string BackendStampId { get; set; }
+
+ public string ResourceState { get; set; }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Models/TaskReport.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Models/TaskReport.cs
new file mode 100644
index 000000000000..e6cf7b6cd9a3
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Models/TaskReport.cs
@@ -0,0 +1,39 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.WindowsAzure.Management.StorSimple.Models;
+using System.Collections.Generic;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Models
+{
+ public class TaskReport
+ {
+ public string TaskId { get; set; }
+ public AsyncTaskResult TaskResult { get; set; }
+ public AsyncTaskStatus TaskStatus { get; set; }
+ public string ErrorCode { get; set; }
+ public string ErrorMessage { get; set; }
+ public IList TaskSteps { get; set; }
+
+ public TaskReport(TaskStatusInfo taskStatusInfo)
+ {
+ this.TaskId = taskStatusInfo.TaskId;
+ this.TaskResult = taskStatusInfo.Result;
+ this.TaskStatus = taskStatusInfo.Status;
+ this.ErrorCode = taskStatusInfo.Error.Code;
+ this.ErrorMessage = taskStatusInfo.Error.Message;
+ this.TaskSteps = taskStatusInfo.TaskSteps;
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/AssemblyInfo.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000000..7491e09ccf7e
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/AssemblyInfo.cs
@@ -0,0 +1,53 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Microsoft Azure Powershell")]
+[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
+[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
+[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("43e1640a-8c44-4e5f-b895-8b2e1ad0aacc")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyVersion)]
+[assembly: AssemblyFileVersion(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyFileVersion)]
+#if SIGN
+[assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.StorSimple.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
+#else
+[assembly: InternalsVisibleTo("Microsoft.WindowsAzure.Commands.StorSimple.Test")]
+#endif
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.Designer.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.Designer.cs
new file mode 100644
index 000000000000..7c8c04c5819b
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.Designer.cs
@@ -0,0 +1,981 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.34014
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.WindowsAzure.Commands.StorSimple.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0} Access Control Record{1} found!.
+ ///
+ internal static string ACRGet_StatusMessage {
+ get {
+ return ResourceManager.GetString("ACRGet_StatusMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to More backups are available for your query. To access the next page of your result use \"-First {0} -Skip {1}\" in your commandlet.
+ ///
+ internal static string BackupNextPageFormatMessage {
+ get {
+ return ResourceManager.GetString("BackupNextPageFormatMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to More backups are available in the subsequent pages for your query. To access the next page use \"-Skip {0}\" in your commandlet.
+ ///
+ internal static string BackupNextPagewithNoFirstMessage {
+ get {
+ return ResourceManager.GetString("BackupNextPagewithNoFirstMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No more backup sets are present for your query!.
+ ///
+ internal static string BackupNoMorePagesMessage {
+ get {
+ return ResourceManager.GetString("BackupNoMorePagesMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to BackupPolicy with id {0} found!.
+ ///
+ internal static string BackupPolicyFound {
+ get {
+ return ResourceManager.GetString("BackupPolicyFound", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0} backup polic{1} found!.
+ ///
+ internal static string BackupPolicyGet_StatusMessage {
+ get {
+ return ResourceManager.GetString("BackupPolicyGet_StatusMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to BackupPolicyName should not have characters "[]=';".
+ ///
+ internal static string BackupPolicyNameHasDisallowedChars {
+ get {
+ return ResourceManager.GetString("BackupPolicyNameHasDisallowedChars", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0} backups found!.
+ ///
+ internal static string BackupsReturnedCount {
+ get {
+ return ResourceManager.GetString("BackupsReturnedCount", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to BackupType cannot be Invalid.
+ ///
+ internal static string BackupTypeInvalid {
+ get {
+ return ResourceManager.GetString("BackupTypeInvalid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Could not retrieve secret. Please use Select-AzureStorSimpleResource and provide the Registration key once again..
+ ///
+ internal static string CIKFetchFailed {
+ get {
+ return ResourceManager.GetString("CIKFetchFailed", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Invalid value for Registration Key. CIK could not be retrieved from Registration Key. Please provide the value as such from the portal!.
+ ///
+ internal static string CIKInvalid {
+ get {
+ return ResourceManager.GetString("CIKInvalid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Could not find the persisted secret. Please use Select-AzureStorSimpleResource and provide the Registration key once again..
+ ///
+ internal static string CIKNotPersisted {
+ get {
+ return ResourceManager.GetString("CIKNotPersisted", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to ClientRequestId: {0}.
+ ///
+ internal static string ClientRequestIdMessage {
+ get {
+ return ResourceManager.GetString("ClientRequestIdMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Call to service failed with error code: {0}.
+ ///
+ internal static string CloudExceptionMessage {
+ get {
+ return ResourceManager.GetString("CloudExceptionMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0} StorSimple device{1} found!.
+ ///
+ internal static string DeviceGet_StatusMessage {
+ get {
+ return ResourceManager.GetString("DeviceGet_StatusMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The device name you have specified is not yet configured fully. Please complete the configuration and retry..
+ ///
+ internal static string DeviceNotConfiguredMessage {
+ get {
+ return ResourceManager.GetString("DeviceNotConfiguredMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No StorSimple device is currently registered with this resource. Please register at least one device to the resource and rerun this command..
+ ///
+ internal static string DeviceNotRegisteredMessage {
+ get {
+ return ResourceManager.GetString("DeviceNotRegisteredMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Device with device name {0} not found under resource {1}.
+ ///
+ internal static string DeviceWithNameNotFoundInResourceMessage {
+ get {
+ return ResourceManager.GetString("DeviceWithNameNotFoundInResourceMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Encryption in progress....
+ ///
+ internal static string EncryptionInProgressMessage {
+ get {
+ return ResourceManager.GetString("EncryptionInProgressMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The {0} operation failed, please check the task's status for more details..
+ ///
+ internal static string FailureMessageCompleteJob {
+ get {
+ return ResourceManager.GetString("FailureMessageCompleteJob", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The {0} task failed to submit. .
+ ///
+ internal static string FailureMessageSubmitJob {
+ get {
+ return ResourceManager.GetString("FailureMessageSubmitJob", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Parameter First cannot be <0.
+ ///
+ internal static string FirstParameterInvalidMessage {
+ get {
+ return ResourceManager.GetString("FirstParameterInvalidMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Volume container with name: {0} is found..
+ ///
+ internal static string FoundDataContainerMessage {
+ get {
+ return ResourceManager.GetString("FoundDataContainerMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Access Control Record with given name {0} is found!.
+ ///
+ internal static string FoundMessageACR {
+ get {
+ return ResourceManager.GetString("FoundMessageACR", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Volume with name: {0} is found..
+ ///
+ internal static string FoundVolumeMessage {
+ get {
+ return ResourceManager.GetString("FoundVolumeMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The Registration key specified appears to be in an incorrect format. Please verify that the exact key is copied from the portal!.
+ ///
+ internal static string IncorrectFormatInRegistrationKey {
+ get {
+ return ResourceManager.GetString("IncorrectFormatInRegistrationKey", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Creating StorageAccountCredential inline.
+ ///
+ internal static string InlineSacCreationMessage {
+ get {
+ return ResourceManager.GetString("InlineSacCreationMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Specify valid string for BackupId parameter.
+ ///
+ internal static string InvalidBackupIdParameter {
+ get {
+ return ResourceManager.GetString("InvalidBackupIdParameter", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Specify valid Backup object for Backup parameter .
+ ///
+ internal static string InvalidBackupObjectParameter {
+ get {
+ return ResourceManager.GetString("InvalidBackupObjectParameter", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Specify valid Guid for BackupPolicyId parameter.
+ ///
+ internal static string InvalidBackupPolicyIdParameter {
+ get {
+ return ResourceManager.GetString("InvalidBackupPolicyIdParameter", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Specify valid BackupPolicy object for BackupPolicy Parameter.
+ ///
+ internal static string InvalidBackupPolicyObjectParameter {
+ get {
+ return ResourceManager.GetString("InvalidBackupPolicyObjectParameter", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Atleast one BackupSchedule should be present in BackupSchedulesToAdd parameter.
+ ///
+ internal static string InvalidBackupSchedulesToAddParameter {
+ get {
+ return ResourceManager.GetString("InvalidBackupSchedulesToAddParameter", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Provide valid datetime string for From parameter!.
+ ///
+ internal static string InvalidFromMessage {
+ get {
+ return ResourceManager.GetString("InvalidFromMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Invalid input : {0}.
+ ///
+ internal static string InvalidInputMessage {
+ get {
+ return ResourceManager.GetString("InvalidInputMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Provide valid datetime string for To parameter!.
+ ///
+ internal static string InvalidToMessage {
+ get {
+ return ResourceManager.GetString("InvalidToMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Atleast one VolumeId should be present in VolumeIdsToAdd parameter.
+ ///
+ internal static string InvalidVolumeIdsToAddParameter {
+ get {
+ return ResourceManager.GetString("InvalidVolumeIdsToAddParameter", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0} Iscsi Connection{1} found!.
+ ///
+ internal static string IscsiConnectionGet_StatusMessage {
+ get {
+ return ResourceManager.GetString("IscsiConnectionGet_StatusMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No backuppolicy with name : {0} found in your device: {1} !.
+ ///
+ internal static string NoBackupPolicyWithGivenNameFound {
+ get {
+ return ResourceManager.GetString("NoBackupPolicyWithGivenNameFound", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No device found in your currently selected resource : {0}!.
+ ///
+ internal static string NoDeviceFoundInResourceMessage {
+ get {
+ return ResourceManager.GetString("NoDeviceFoundInResourceMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No device found in your currently selected resource : {0} with id : {1}!.
+ ///
+ internal static string NoDeviceFoundWithGivenIdInResourceMessage {
+ get {
+ return ResourceManager.GetString("NoDeviceFoundWithGivenIdInResourceMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No device found in your currently selected resource : {0} with ModelDescription : {1}!.
+ ///
+ internal static string NoDeviceFoundWithGivenModelInResourceMessage {
+ get {
+ return ResourceManager.GetString("NoDeviceFoundWithGivenModelInResourceMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No device found in your currently selected resource : {0} with name : {1}!.
+ ///
+ internal static string NoDeviceFoundWithGivenNameInResourceMessage {
+ get {
+ return ResourceManager.GetString("NoDeviceFoundWithGivenNameInResourceMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No device found in your currently selected resource : {0} with Type : {1}!.
+ ///
+ internal static string NoDeviceFoundWithGivenTypeInResourceMessage {
+ get {
+ return ResourceManager.GetString("NoDeviceFoundWithGivenTypeInResourceMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No resource found in your subscription!.
+ ///
+ internal static string NoResourceFoundInSubscriptionMessage {
+ get {
+ return ResourceManager.GetString("NoResourceFoundInSubscriptionMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No resource found in your subscription with name : {0}!.
+ ///
+ internal static string NoResourceFoundWithGivenNameInSubscriptionMessage {
+ get {
+ return ResourceManager.GetString("NoResourceFoundWithGivenNameInSubscriptionMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Please provide the EncryptionKey..
+ ///
+ internal static string NotAllowedErrorDataContainerEncryption {
+ get {
+ return ResourceManager.GetString("NotAllowedErrorDataContainerEncryption", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Volume container with name: {0} is not found..
+ ///
+ internal static string NotFoundDataContainerMessage {
+ get {
+ return ResourceManager.GetString("NotFoundDataContainerMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No Access Control Record with given name {0} is found!.
+ ///
+ internal static string NotFoundMessageACR {
+ get {
+ return ResourceManager.GetString("NotFoundMessageACR", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The specified device does not exist..
+ ///
+ internal static string NotFoundMessageDevice {
+ get {
+ return ResourceManager.GetString("NotFoundMessageDevice", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The specified resource does not exist..
+ ///
+ internal static string NotFoundMessageResource {
+ get {
+ return ResourceManager.GetString("NotFoundMessageResource", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Storage account with the specified name does not exist..
+ ///
+ internal static string NotFoundMessageStorageAccountCredential {
+ get {
+ return ResourceManager.GetString("NotFoundMessageStorageAccountCredential", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The specified volume does not exist..
+ ///
+ internal static string NotFoundMessageVirtualDisk {
+ get {
+ return ResourceManager.GetString("NotFoundMessageVirtualDisk", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Volume with name: {0} is not found..
+ ///
+ internal static string NotFoundVolumeMessage {
+ get {
+ return ResourceManager.GetString("NotFoundVolumeMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Registration key parameter is not passed. Validating whether a registration key is already persisted for this resource!.
+ ///
+ internal static string NotProvidedWarningRegistrationKey {
+ get {
+ return ResourceManager.GetString("NotProvidedWarningRegistrationKey", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Secret was persisted earlier, but seems to have been corrupted. Please use Select-AzureStorSimpleResource and provide the Registration key once again..
+ ///
+ internal static string PersistedCIKCorrupted {
+ get {
+ return ResourceManager.GetString("PersistedCIKCorrupted", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Retrieved secret successfully, but was NULL..
+ ///
+ internal static string PersistedCIKIsNull {
+ get {
+ return ResourceManager.GetString("PersistedCIKIsNull", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Failed to validate persisted secret..
+ ///
+ internal static string PersistedCIKValidationFailed {
+ get {
+ return ResourceManager.GetString("PersistedCIKValidationFailed", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Could not persist secret.
+ ///
+ internal static string PersistSecretFailed {
+ get {
+ return ResourceManager.GetString("PersistSecretFailed", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Registration key is provided. Persisting for later use!.
+ ///
+ internal static string ProvidedRegistrationKey {
+ get {
+ return ResourceManager.GetString("ProvidedRegistrationKey", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to RecurrenceType cannot be Invalid.
+ ///
+ internal static string RecurrenceTypeInvalid {
+ get {
+ return ResourceManager.GetString("RecurrenceTypeInvalid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to RecurrenceValue should be >=0.
+ ///
+ internal static string RecurrenceValueLessThanZero {
+ get {
+ return ResourceManager.GetString("RecurrenceValueLessThanZero", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Registrtion key not passed - validating that the secrets are already initialized.
+ ///
+ internal static string RegistrationKeyNotPassedMessage {
+ get {
+ return ResourceManager.GetString("RegistrationKeyNotPassedMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Registration key passed - initializing secrets.
+ ///
+ internal static string RegistrationKeyPassedMessage {
+ get {
+ return ResourceManager.GetString("RegistrationKeyPassedMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Removing backup with backupId {0}....
+ ///
+ internal static string RemoveASSDBackupMessage {
+ get {
+ return ResourceManager.GetString("RemoveASSDBackupMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Removing backuppolicy with backuppolicyId {0}....
+ ///
+ internal static string RemoveASSDBackupPolicyMessage {
+ get {
+ return ResourceManager.GetString("RemoveASSDBackupPolicyMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to remove the backuppolicy with backuppolicyId{0}?.
+ ///
+ internal static string RemoveASSDBackupPolicyWarningMessage {
+ get {
+ return ResourceManager.GetString("RemoveASSDBackupPolicyWarningMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to remove the backup with backupId{0}?.
+ ///
+ internal static string RemoveASSDBackupWarningMessage {
+ get {
+ return ResourceManager.GetString("RemoveASSDBackupWarningMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Removing access control record....
+ ///
+ internal static string RemoveConfirmationACR {
+ get {
+ return ResourceManager.GetString("RemoveConfirmationACR", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Removing volume container....
+ ///
+ internal static string RemoveConfirmationDataContainer {
+ get {
+ return ResourceManager.GetString("RemoveConfirmationDataContainer", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Removing storage account....
+ ///
+ internal static string RemoveConfirmationSAC {
+ get {
+ return ResourceManager.GetString("RemoveConfirmationSAC", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Removing volume....
+ ///
+ internal static string RemoveConfirmationVolume {
+ get {
+ return ResourceManager.GetString("RemoveConfirmationVolume", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to remove the access control record?.
+ ///
+ internal static string RemoveWarningACR {
+ get {
+ return ResourceManager.GetString("RemoveWarningACR", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to remove the volume container?.
+ ///
+ internal static string RemoveWarningDataContainer {
+ get {
+ return ResourceManager.GetString("RemoveWarningDataContainer", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to remove the storage account?.
+ ///
+ internal static string RemoveWarningSAC {
+ get {
+ return ResourceManager.GetString("RemoveWarningSAC", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to remove the volume?.
+ ///
+ internal static string RemoveWarningVolume {
+ get {
+ return ResourceManager.GetString("RemoveWarningVolume", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to You have a resource selected. Resource Name: {0} Id: {1}.
+ ///
+ internal static string ResourceContextFound {
+ get {
+ return ResourceManager.GetString("ResourceContextFound", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Initializing resource context.
+ ///
+ internal static string ResourceContextInitializeMessage {
+ get {
+ return ResourceManager.GetString("ResourceContextInitializeMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Resource Context is not set for your subscription. Please use Select-AzureStorSimpleResource -ResourceName <<name>> to set the resource context..
+ ///
+ internal static string ResourceContextNotSetMessage {
+ get {
+ return ResourceManager.GetString("ResourceContextNotSetMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0} StorSimple resource{1} found!.
+ ///
+ internal static string ResourceGet_StatusMessage {
+ get {
+ return ResourceManager.GetString("ResourceGet_StatusMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to ResourceId must be specified.
+ ///
+ internal static string ResourceIdMissing {
+ get {
+ return ResourceManager.GetString("ResourceIdMissing", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to RetentionCount value should be 1 - 64.
+ ///
+ internal static string RetentionCountRangeInvalid {
+ get {
+ return ResourceManager.GetString("RetentionCountRangeInvalid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0} volume container{1} found!.
+ ///
+ internal static string ReturnedCountDataContainerMessage {
+ get {
+ return ResourceManager.GetString("ReturnedCountDataContainerMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0} volume{1} found for your volume container!.
+ ///
+ internal static string ReturnedCountVolumeMessage {
+ get {
+ return ResourceManager.GetString("ReturnedCountVolumeMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Storage Access Credential with name {0} found!.
+ ///
+ internal static string SACFoundWithName {
+ get {
+ return ResourceManager.GetString("SACFoundWithName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to {0} Storage Access Credential{1} found!.
+ ///
+ internal static string SACGet_StatusMessage {
+ get {
+ return ResourceManager.GetString("SACGet_StatusMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Storage Access Credential with name {0} not found!.
+ ///
+ internal static string SACNotFoundWithName {
+ get {
+ return ResourceManager.GetString("SACNotFoundWithName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Secrets validation complete.
+ ///
+ internal static string SecretsValidationCompleteMessage {
+ get {
+ return ResourceManager.GetString("SecretsValidationCompleteMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Parameter Skip cannot be <0.
+ ///
+ internal static string SkipParameterInvalidMessage {
+ get {
+ return ResourceManager.GetString("SkipParameterInvalidMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Restoring backup with backupId {0}....
+ ///
+ internal static string StartASSDBackupRestoreJobMessage {
+ get {
+ return ResourceManager.GetString("StartASSDBackupRestoreJobMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to restore the backup with backupId{0}?.
+ ///
+ internal static string StartASSDBackupRestoreJobWarningMessage {
+ get {
+ return ResourceManager.GetString("StartASSDBackupRestoreJobWarningMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Provide valid dateTime for StartFrom parameter.
+ ///
+ internal static string StartFromDateForBackupNotValid {
+ get {
+ return ResourceManager.GetString("StartFromDateForBackupNotValid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Cleaning up objects, retry count: {0}.
+ ///
+ internal static string StorageAccountCleanupRetryMessage {
+ get {
+ return ResourceManager.GetString("StorageAccountCleanupRetryMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Found storage account with name : {0}.
+ ///
+ internal static string StorageAccountFoundMessage {
+ get {
+ return ResourceManager.GetString("StorageAccountFoundMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Could not find storage account with name: {0}.
+ ///
+ internal static string StorageAccountNotFoundMessage {
+ get {
+ return ResourceManager.GetString("StorageAccountNotFoundMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Storage credential verification failed..
+ ///
+ internal static string StorageCredentialVerificationFailureMessage {
+ get {
+ return ResourceManager.GetString("StorageCredentialVerificationFailureMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Storage credential verification succeeded..
+ ///
+ internal static string StorageCredentialVerificationSuccessMessage {
+ get {
+ return ResourceManager.GetString("StorageCredentialVerificationSuccessMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Your resource has seen selected successfully. To change to another resource please use Select-AzureStorSimpleResource commandlet!.
+ ///
+ internal static string SuccessfulResourceSelection {
+ get {
+ return ResourceManager.GetString("SuccessfulResourceSelection", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The task created for your {0} operation has completed successfully..
+ ///
+ internal static string SuccessMessageCompleteJob {
+ get {
+ return ResourceManager.GetString("SuccessMessageCompleteJob", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Context set successfully for the given resource name..
+ ///
+ internal static string SuccessMessageSetResourceContext {
+ get {
+ return ResourceManager.GetString("SuccessMessageSetResourceContext", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The {0} task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId {1} for tracking the task's status.
+ ///
+ internal static string SuccessMessageSubmitJob {
+ get {
+ return ResourceManager.GetString("SuccessMessageSubmitJob", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The registration key has been validated successfully! .
+ ///
+ internal static string ValidationSuccessfulRegistrationKey {
+ get {
+ return ResourceManager.GetString("ValidationSuccessfulRegistrationKey", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Web exception encountered with StatusCode: {0}.
+ ///
+ internal static string WebExceptionMessage {
+ get {
+ return ResourceManager.GetString("WebExceptionMessage", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.resx b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.resx
new file mode 100644
index 000000000000..d3ba92961b90
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.resx
@@ -0,0 +1,426 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ {0} backup polic{1} found!
+
+
+ BackupPolicy with id {0} found!
+
+
+ No backuppolicy with name : {0} found in your device: {1} !
+
+
+ The {0} task failed to submit.
+
+
+ Please provide the EncryptionKey.
+
+
+ No Access Control Record with given name {0} is found!
+
+
+ The specified device does not exist.
+
+
+ The specified resource does not exist.
+
+
+ Storage account with the specified name does not exist.
+
+
+ Removing backup with backupId {0}...
+
+
+ Removing backuppolicy with backuppolicyId {0}...
+
+
+ Are you sure you want to remove the backuppolicy with backuppolicyId{0}?
+
+
+ Are you sure you want to remove the backup with backupId{0}?
+
+
+ The specified volume does not exist.
+
+
+ Removing access control record...
+
+
+ Removing volume container...
+
+
+ Removing storage account...
+
+
+ Removing volume...
+
+
+ Are you sure you want to remove the access control record?
+
+
+ Are you sure you want to remove the volume container?
+
+
+ Are you sure you want to remove the storage account?
+
+
+ Are you sure you want to remove the volume?
+
+
+ Restoring backup with backupId {0}...
+
+
+ Are you sure you want to restore the backup with backupId{0}?
+
+
+ Context set successfully for the given resource name.
+
+
+ The {0} task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId {1} for tracking the task's status
+
+
+ Specify valid string for BackupId parameter
+
+
+ Specify valid Backup object for Backup parameter
+
+
+ Specify valid Guid for BackupPolicyId parameter
+
+
+ Specify valid BackupPolicy object for BackupPolicy Parameter
+
+
+ More backups are available for your query. To access the next page of your result use \"-First {0} -Skip {1}\" in your commandlet
+
+
+ More backups are available in the subsequent pages for your query. To access the next page use \"-Skip {0}\" in your commandlet
+
+
+ No more backup sets are present for your query!
+
+
+ Parameter First cannot be <0
+
+
+ Atleast one BackupSchedule should be present in BackupSchedulesToAdd parameter
+
+
+ Provide valid datetime string for From parameter!
+
+
+ Provide valid datetime string for To parameter!
+
+
+ Atleast one VolumeId should be present in VolumeIdsToAdd parameter
+
+
+ Parameter Skip cannot be <0
+
+
+ Provide valid dateTime for StartFrom parameter
+
+
+ Call to service failed with error code: {0}
+
+
+ The {0} operation failed, please check the task's status for more details.
+
+
+ The task created for your {0} operation has completed successfully.
+
+
+ {0} backups found!
+
+
+ Volume container with name: {0} is found.
+
+
+ Volume with name: {0} is found.
+
+
+ Volume container with name: {0} is not found.
+
+
+ Volume with name: {0} is not found.
+
+
+ {0} volume container{1} found!
+
+
+ {0} volume{1} found for your volume container!
+
+
+ ClientRequestId: {0}
+
+
+ Device with device name {0} not found under resource {1}
+
+
+ {0} StorSimple device{1} found!
+
+
+ The Registration key specified appears to be in an incorrect format. Please verify that the exact key is copied from the portal!
+
+
+ {0} Iscsi Connection{1} found!
+
+
+ No device found in your currently selected resource : {0}!
+
+
+ No device found in your currently selected resource : {0} with id : {1}!
+
+
+ No device found in your currently selected resource : {0} with ModelDescription : {1}!
+
+
+ No device found in your currently selected resource : {0} with name : {1}!
+
+
+ No device found in your currently selected resource : {0} with Type : {1}!
+
+
+ No resource found in your subscription!
+
+
+ No resource found in your subscription with name : {0}!
+
+
+ Registration key parameter is not passed. Validating whether a registration key is already persisted for this resource!
+
+
+ Registration key is provided. Persisting for later use!
+
+
+ You have a resource selected. Resource Name: {0} Id: {1}
+
+
+ {0} StorSimple resource{1} found!
+
+
+ Your resource has seen selected successfully. To change to another resource please use Select-AzureStorSimpleResource commandlet!
+
+
+ Encryption in progress...
+
+
+ Web exception encountered with StatusCode: {0}
+
+
+ The registration key has been validated successfully!
+
+
+ Invalid input : {0}
+
+
+ Storage credential verification failed.
+
+
+ Storage credential verification succeeded.
+
+
+ Found storage account with name : {0}
+
+
+ Could not find storage account with name: {0}
+
+
+ Registrtion key not passed - validating that the secrets are already initialized
+
+
+ Registration key passed - initializing secrets
+
+
+ Initializing resource context
+
+
+ Secrets validation complete
+
+
+ Cleaning up objects, retry count: {0}
+
+
+ Creating StorageAccountCredential inline
+
+
+ {0} Access Control Record{1} found!
+
+
+ Access Control Record with given name {0} is found!
+
+
+ Storage Access Credential with name {0} found!
+
+
+ {0} Storage Access Credential{1} found!
+
+
+ Storage Access Credential with name {0} not found!
+
+
+ BackupType cannot be Invalid
+
+
+ RecurrenceType cannot be Invalid
+
+
+ RecurrenceValue should be >=0
+
+
+ RetentionCount value should be 1 - 64
+
+
+ BackupPolicyName should not have characters "[]=';"
+
+
+ ResourceId must be specified
+
+
+ Could not retrieve secret. Please use Select-AzureStorSimpleResource and provide the Registration key once again.
+
+
+ Invalid value for Registration Key. CIK could not be retrieved from Registration Key. Please provide the value as such from the portal!
+
+
+ Could not find the persisted secret. Please use Select-AzureStorSimpleResource and provide the Registration key once again.
+
+
+ Secret was persisted earlier, but seems to have been corrupted. Please use Select-AzureStorSimpleResource and provide the Registration key once again.
+
+
+ Retrieved secret successfully, but was NULL.
+
+
+ Failed to validate persisted secret.
+
+
+ Could not persist secret
+
+
+ The device name you have specified is not yet configured fully. Please complete the configuration and retry.
+
+
+ No StorSimple device is currently registered with this resource. Please register at least one device to the resource and rerun this command.
+
+
+ Resource Context is not set for your subscription. Please use Select-AzureStorSimpleResource -ResourceName <<name>> to set the resource context.
+
+
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleBackupSetClient.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleBackupSetClient.cs
new file mode 100644
index 000000000000..26e18fe3bcaa
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleBackupSetClient.cs
@@ -0,0 +1,60 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.WindowsAzure.Management.StorSimple;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public partial class StorSimpleClient
+ {
+ public GetBackupResponse GetAllBackups(string deviceId, string filterType, string isAllSelected, string filterValue, string startDateTime, string endDateTime,
+ string skip, string top)
+ {
+ return this.GetStorSimpleClient()
+ .Backup.Get(deviceId, filterType, isAllSelected, filterValue, startDateTime, endDateTime, skip, top,
+ GetCustomRequestHeaders());
+ }
+
+ public TaskStatusInfo DeleteBackup(string deviceid, string backupSetId)
+ {
+ return GetStorSimpleClient().Backup.Delete(deviceid, backupSetId, GetCustomRequestHeaders());
+ }
+
+ public TaskResponse DeleteBackupAsync(string deviceid, string backupSetId)
+ {
+ return GetStorSimpleClient().Backup.BeginDeleting(deviceid, backupSetId, GetCustomRequestHeaders());
+ }
+
+ public TaskStatusInfo RestoreBackup(string deviceid, RestoreBackupRequest backupRequest)
+ {
+ return GetStorSimpleClient().Backup.Restore(deviceid, backupRequest, GetCustomRequestHeaders());
+ }
+
+ public TaskResponse RestoreBackupAsync(string deviceid, RestoreBackupRequest backupRequest)
+ {
+ return GetStorSimpleClient().Backup.BeginRestoring(deviceid, backupRequest, GetCustomRequestHeaders());
+ }
+
+ public TaskStatusInfo DoBackup(string deviceid, string backupPolicyId, BackupNowRequest request)
+ {
+ return GetStorSimpleClient().Backup.Create(deviceid, backupPolicyId, request, GetCustomRequestHeaders());
+ }
+
+ public TaskResponse DoBackupAsync(string deviceid, string backupPolicyId, BackupNowRequest request)
+ {
+ return GetStorSimpleClient().Backup.BeginCreatingBackup(deviceid, backupPolicyId, request, GetCustomRequestHeaders());
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleClient.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleClient.cs
new file mode 100644
index 000000000000..86a06a776a6e
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleClient.cs
@@ -0,0 +1,128 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Net;
+using System.IO;
+using System.Runtime.Serialization;
+using System.Xml;
+using System.Net.Security;
+using System.Runtime.Caching;
+using Hyak.Common;
+using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.WindowsAzure.Management.Scheduler;
+using Microsoft.WindowsAzure.Management.StorSimple;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure.Management.Scheduler.Models;
+
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public partial class StorSimpleClient
+ {
+ private CloudServiceManagementClient cloudServicesClient;
+
+ public string ClientRequestId;
+
+ private ObjectCache Resourcecache = MemoryCache.Default;
+
+ private CacheItemPolicy ResourceCachetimeoutPolicy = new CacheItemPolicy();
+
+ public StorSimpleClient(AzureSubscription currentSubscription)
+ {
+ // Temp code to be able to test internal env.
+ ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };//IgnoreCertificateErrorHandler;//delegate { return true; };
+
+ this.cloudServicesClient = AzureSession.ClientFactory.CreateClient(currentSubscription, AzureEnvironment.Endpoint.ServiceManagement);
+
+ ResourceCachetimeoutPolicy.AbsoluteExpiration = DateTimeOffset.Now.AddHours(1.0d);
+ }
+
+ public CloudServiceListResponse GetAzureCloudServicesSyncInt()
+ {
+ return this.cloudServicesClient.CloudServices.List();
+ }
+
+ private StorSimpleManagementClient GetStorSimpleClient()
+ {
+ var storSimpleClient =
+ AzureSession.ClientFactory.CreateCustomClient(
+ StorSimpleContext.CloudServiceName,
+ StorSimpleContext.ResourceName, StorSimpleContext.ResourceId,
+ StorSimpleContext.ResourceProviderNameSpace, StorSimpleContext.StampId,
+ this.cloudServicesClient.Credentials,
+ AzureSession.CurrentContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement));
+
+ if (storSimpleClient == null)
+ {
+ throw new InvalidOperationException();
+ }
+
+ return storSimpleClient;
+
+ }
+
+ public void ThrowCloudExceptionDetails(CloudException cloudException)
+ {
+ Error error = null;
+ try
+ {
+ using (Stream stream = new MemoryStream())
+ {
+ byte[] data = System.Text.Encoding.UTF8.GetBytes(cloudException.Error.Message);
+ stream.Write(data, 0, data.Length);
+ stream.Position = 0;
+
+ var deserializer = new DataContractSerializer(typeof(Error));
+ error = (Error)deserializer.ReadObject(stream);
+ }
+ }
+ catch (XmlException)
+ {
+ throw new XmlException(cloudException.Error.Message);
+ }
+ catch (SerializationException)
+ {
+ throw new SerializationException(cloudException.Error.Message);
+ }
+
+ throw new InvalidOperationException(
+ string.Format(error.Message,"\n",error.HttpCode,"\n",error.ExtendedCode));
+ }
+
+ private CustomRequestHeaders GetCustomRequestHeaders()
+ {
+ var hdrs = new CustomRequestHeaders()
+ {
+ // ClientRequestId is a unique ID for every request to StorSimple .
+ // It is useful when diagnosing failures in API calls.
+ ClientRequestId = this.ClientRequestId,
+ Language = "en-US"
+ };
+
+ return hdrs;
+ }
+
+ private static bool IgnoreCertificateErrorHandler
+ (object sender,
+ System.Security.Cryptography.X509Certificates.X509Certificate certificate,
+ System.Security.Cryptography.X509Certificates.X509Chain chain,
+ SslPolicyErrors sslPolicyErrors)
+ {
+ return true;
+ }
+
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleContextClient.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleContextClient.cs
new file mode 100644
index 000000000000..90d792620f60
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleContextClient.cs
@@ -0,0 +1,166 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.StorSimple.Encryption;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.Scheduler;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public partial class StorSimpleClient
+ {
+
+ public IEnumerable GetAllResources()
+ {
+ var services = cloudServicesClient.CloudServices.List();
+ var toReturn = new List();
+
+
+ foreach (var service in services)
+ {
+
+ if (service.Resources.Count == 0)
+ {
+ continue;
+ }
+ foreach (var resource in service.Resources)
+ {
+ if (!(resource.Type.Equals("CiSVault", StringComparison.CurrentCultureIgnoreCase)))
+ {
+ continue;
+ }
+ try
+ {
+ var resCredentials = new ResourceCredentials
+ {
+ CloudServiceName = service.Name,
+ ResourceType = resource.Type,
+ BackendStampId = resource.OutputItems["BackendStampId"],
+ ResourceId = resource.OutputItems["ResourceId"],
+ ResourceName = resource.Name,
+ ResourceNameSpace = resource.Namespace,
+ StampId = resource.OutputItems["StampId"],
+ ResourceState = resource.State
+ };
+
+ toReturn.Add(resCredentials);
+ }
+ catch (Exception)
+ {
+ }
+
+ }
+
+ }
+ Resourcecache.Add("resourceObject", toReturn, ResourceCachetimeoutPolicy);
+ return toReturn;
+ }
+
+ public ResourceCredentials GetResourceDetails(string resourceName)
+ {
+ var resCredList = GetAllResources();
+ return
+ resCredList.FirstOrDefault(
+ resCred => resCred.ResourceName.Equals(resourceName, StringComparison.CurrentCultureIgnoreCase));
+ }
+
+ public void SetResourceContext(ResourceCredentials resCred)
+ {
+ if (resCred == null)
+ {
+ return;
+ }
+
+ StorSimpleContext.ResourceId = resCred.ResourceId;
+ StorSimpleContext.StampId = resCred.BackendStampId;
+ StorSimpleContext.CloudServiceName = resCred.CloudServiceName;
+ StorSimpleContext.ResourceType = resCred.ResourceType;
+ StorSimpleContext.ResourceName = resCred.ResourceName;
+ StorSimpleContext.ResourceProviderNameSpace = resCred.ResourceNameSpace;
+ StorSimpleContext.KeyManager = new StorSimpleKeyManager(resCred.ResourceId);
+ }
+
+ public void ResetResourceContext()
+ {
+ StorSimpleContext.ResourceId = null;
+ StorSimpleContext.StampId = null;
+ StorSimpleContext.CloudServiceName = null;
+ StorSimpleContext.ResourceType = null;
+ StorSimpleContext.ResourceName = null;
+ StorSimpleContext.ResourceProviderNameSpace = null;
+ StorSimpleContext.KeyManager = null;
+ }
+
+ public StorSimpleResourceContext GetResourceContext()
+ {
+ if (string.IsNullOrEmpty(StorSimpleContext.ResourceId)
+ || string.IsNullOrEmpty(StorSimpleContext.ResourceName)
+ || string.IsNullOrEmpty(StorSimpleContext.ResourceType))
+ return null;
+ else
+ {
+ return new StorSimpleResourceContext(StorSimpleContext.ResourceId, StorSimpleContext.ResourceName,
+ StorSimpleContext.StampId, StorSimpleContext.CloudServiceName, StorSimpleContext.ResourceProviderNameSpace,
+ StorSimpleContext.ResourceType, StorSimpleContext.KeyManager);
+ }
+ }
+
+ ///
+ /// The CIK has to be parsed from the registration key
+ ///
+ ///
+ public string ParseCIKFromRegistrationKey(string registrationKey)
+ {
+ try
+ {
+ string[] parts = registrationKey.Split(new char[] { ':' });
+ return parts[2].Split(new char[] { '#' })[0];
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(Resources.IncorrectFormatInRegistrationKey, ex);
+ }
+ }
+ }
+
+ public class StorSimpleResourceContext
+ {
+ public string ResourceId { get; set; }
+ public string StampId { get; set; }
+ public string CloudServiceName { get; set; }
+ public string ResourceProviderNameSpace { get; set; }
+ public string ResourceType { get; set; }
+ public string ResourceName { get; set; }
+ public StorSimpleKeyManager StorSimpleKeyManager { get; set; }
+
+ public StorSimpleResourceContext(string resourceId, string resourceName, string stampId,
+ string cloudServiceName, string resourceProviderNameSpace, string resourceType, StorSimpleKeyManager keyManager)
+ {
+ this.ResourceId = resourceId;
+ this.ResourceName = resourceName;
+ this.ResourceType = resourceType;
+ this.ResourceProviderNameSpace = resourceProviderNameSpace;
+ this.StampId = stampId;
+ this.CloudServiceName = cloudServiceName;
+ this.StorSimpleKeyManager = keyManager;
+ }
+
+
+ }
+}
+
+
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleDCClient.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleDCClient.cs
new file mode 100644
index 000000000000..289f1c623ada
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleDCClient.cs
@@ -0,0 +1,58 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.WindowsAzure.Management.StorSimple;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public partial class StorSimpleClient
+ {
+ public DataContainerListResponse GetAllDataContainers(string deviceId)
+ {
+ return this.GetStorSimpleClient().DataContainer.List(deviceId, this.GetCustomRequestHeaders());
+ }
+
+ public TaskStatusInfo GetTaskStatus(string taskId)
+ {
+ return GetStorSimpleClient().GetOperationStatus(taskId);
+ }
+ public TaskStatusInfo CreateDataContainer(string deviceId,DataContainerRequest dc)
+ {
+ return GetStorSimpleClient().DataContainer.Create(deviceId, dc, GetCustomRequestHeaders());
+
+ }
+
+ public TaskResponse CreateDataContainerAsync(string deviceId, DataContainerRequest dc)
+ {
+ return GetStorSimpleClient().DataContainer.BeginCreating(deviceId, dc, GetCustomRequestHeaders());
+ }
+
+
+ public DataContainerGetResponse GetDataContainer(string deviceId, string Name)
+ {
+ return GetStorSimpleClient().DataContainer.Get(deviceId, Name, GetCustomRequestHeaders());
+ }
+
+ public TaskResponse DeleteDataContainerAsync(string deviceid, string dcid)
+ {
+ return GetStorSimpleClient().DataContainer.BeginDeleting(deviceid, dcid, GetCustomRequestHeaders());
+ }
+
+ public TaskStatusInfo DeleteDataContainer(string deviceid, string dcid)
+ {
+ return GetStorSimpleClient().DataContainer.Delete(deviceid, dcid, GetCustomRequestHeaders());
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleDevicesClient.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleDevicesClient.cs
new file mode 100644
index 000000000000..544e010a8c50
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleDevicesClient.cs
@@ -0,0 +1,57 @@
+// ----------------------------------------------------------------------------------
+//
+// 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 Microsoft.WindowsAzure.Management.StorSimple;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public partial class StorSimpleClient
+ {
+ public IEnumerable GetAllDevices()
+ {
+ return this.GetStorSimpleClient().Devices.List(this.GetCustomRequestHeaders());
+ }
+
+ public DeviceDetails GetDeviceDetails(string deviceId)
+ {
+ var deviceDetailsResponse = this.GetStorSimpleClient().DeviceDetails.Get(deviceId, this.GetCustomRequestHeaders());
+ if (deviceDetailsResponse == null)
+ {
+ return null;
+ }
+ return deviceDetailsResponse.DeviceDetails;
+ }
+
+ public string GetDeviceId(string deviceToUse)
+ {
+ if (deviceToUse == null) throw new ArgumentNullException("deviceToUse");
+ var deviceInfos = GetAllDevices();
+ return (from deviceInfo in deviceInfos where deviceInfo.FriendlyName.Equals(deviceToUse, StringComparison.InvariantCultureIgnoreCase) select deviceInfo.DeviceId).FirstOrDefault();
+ }
+
+ public List GetAllIscsiConnections(string deviceId)
+ {
+ var iscsiConnectionResponse = GetStorSimpleClient().IscsiConnection.Get(deviceId, GetCustomRequestHeaders());
+ if (iscsiConnectionResponse == null || iscsiConnectionResponse.IscsiConnections == null)
+ {
+ return null;
+ }
+ return iscsiConnectionResponse.IscsiConnections.ToList();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleServiceConfigClient.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleServiceConfigClient.cs
new file mode 100644
index 000000000000..f98557633651
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleServiceConfigClient.cs
@@ -0,0 +1,53 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Collections.Generic;
+using Microsoft.WindowsAzure.Management.StorSimple;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public partial class StorSimpleClient
+ {
+ public TaskStatusInfo ConfigureService(ServiceConfiguration serviceConfig)
+ {
+ return GetStorSimpleClient().ServiceConfig.Create(serviceConfig, GetCustomRequestHeaders());
+ }
+
+ public TaskResponse ConfigureServiceAsync(ServiceConfiguration serviceConfig)
+ {
+ return GetStorSimpleClient().ServiceConfig.BeginCreating(serviceConfig, GetCustomRequestHeaders());
+ }
+
+ public IList GetAllAccessControlRecords()
+ {
+ var sc = GetStorSimpleClient().ServiceConfig.Get(GetCustomRequestHeaders());
+ if (sc == null || sc.AcrChangeList == null)
+ {
+ return null;
+ }
+ return sc.AcrChangeList.Updated;
+ }
+
+ public IList GetAllStorageAccountCredentials()
+ {
+ var sc = GetStorSimpleClient().ServiceConfig.Get(GetCustomRequestHeaders());
+ if (sc == null || sc.CredentialChangeList == null)
+ {
+ return null;
+ }
+ return sc.CredentialChangeList.Updated;
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleVolumeClient.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleVolumeClient.cs
new file mode 100644
index 000000000000..ccb4e20763f1
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleVolumeClient.cs
@@ -0,0 +1,60 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.WindowsAzure.Management.StorSimple;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public partial class StorSimpleClient
+ {
+ public VirtualDiskListResponse GetAllVolumesFordataContainer(string deviceid,string datacontainerid)
+ {
+ return GetStorSimpleClient().VirtualDisk.List(deviceid, datacontainerid, GetCustomRequestHeaders());
+ }
+
+ public VirtualDiskGetResponse GetVolumeByName(string deviceid, string diskName)
+ {
+ return GetStorSimpleClient().VirtualDisk.GetByName(deviceid, diskName, GetCustomRequestHeaders());
+ }
+
+ public TaskStatusInfo CreateVolume(string deviceid, VirtualDiskRequest diskDetails)
+ {
+ return GetStorSimpleClient().VirtualDisk.Create(deviceid, diskDetails, GetCustomRequestHeaders());
+ }
+
+ public GuidTaskResponse CreateVolumeAsync(string deviceid, VirtualDiskRequest diskDetails)
+ {
+ return GetStorSimpleClient().VirtualDisk.BeginCreating(deviceid, diskDetails, GetCustomRequestHeaders());
+ }
+
+ public TaskStatusInfo RemoveVolume(string deviceid, string diskid)
+ {
+ return GetStorSimpleClient().VirtualDisk.Delete(deviceid, diskid, GetCustomRequestHeaders());
+ }
+ public GuidTaskResponse RemoveVolumeAsync(string deviceid, string diskid)
+ {
+ return GetStorSimpleClient().VirtualDisk.BeginDeleting(deviceid, diskid, GetCustomRequestHeaders());
+ }
+
+ public TaskStatusInfo UpdateVolume(string deviceid, string diskid, VirtualDisk diskDetails)
+ {
+ return GetStorSimpleClient().VirtualDisk.Update(deviceid, diskid, diskDetails, GetCustomRequestHeaders());
+ }
+ public GuidTaskResponse UpdateVolumeAsync(string deviceid, string diskid, VirtualDisk diskDetails)
+ {
+ return GetStorSimpleClient().VirtualDisk.BeginUpdating(deviceid, diskid, diskDetails,GetCustomRequestHeaders());
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StoreSimpleBackupPolicyClient.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StoreSimpleBackupPolicyClient.cs
new file mode 100644
index 000000000000..fdfb891af3d4
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StoreSimpleBackupPolicyClient.cs
@@ -0,0 +1,165 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Collections.Generic;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using System;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public partial class StorSimpleClient
+ {
+ public BackupPolicyListResponse GetAllBackupPolicies(string deviceId)
+ {
+ var backupPolicyList = this.GetStorSimpleClient().BackupPolicy.List(deviceId, GetCustomRequestHeaders());
+ backupPolicyList.BackupPolicies = CorrectLastBackupForNewPolicy(backupPolicyList.BackupPolicies);
+ return backupPolicyList;
+ }
+
+ public GetBackupPolicyDetailsResponse GetBackupPolicyByName(string deviceId, string backupPolicyName)
+ {
+ var backupPolicyDetail = this.GetStorSimpleClient().BackupPolicy.GetBackupPolicyDetailsByName(deviceId, backupPolicyName, GetCustomRequestHeaders());
+ backupPolicyDetail.BackupPolicyDetails = CorrectLastBackupForNewPolicyDetail(backupPolicyDetail.BackupPolicyDetails);
+ return backupPolicyDetail;
+ }
+
+ public TaskStatusInfo DeleteBackupPolicy(string deviceid, string backupPolicyId)
+ {
+ return GetStorSimpleClient().BackupPolicy.Delete(deviceid, backupPolicyId, GetCustomRequestHeaders());
+ }
+
+ public TaskResponse DeleteBackupPolicyAsync(string deviceid, string backupPolicyId)
+ {
+ return GetStorSimpleClient().BackupPolicy.BeginDeleting(deviceid, backupPolicyId, GetCustomRequestHeaders());
+ }
+
+ public TaskStatusInfo CreateBackupPolicy(string deviceId, NewBackupPolicyConfig config)
+ {
+ return GetStorSimpleClient().BackupPolicy.Create(deviceId, config, GetCustomRequestHeaders());
+ }
+
+ public TaskResponse CreateBackupPolicyAsync(string deviceId, NewBackupPolicyConfig config)
+ {
+ return GetStorSimpleClient().BackupPolicy.BeginCreatingBackupPolicy(deviceId, config, GetCustomRequestHeaders());
+ }
+
+ public TaskStatusInfo UpdateBackupPolicy(string deviceId, string policyId, UpdateBackupPolicyConfig updatepolicyConfig)
+ {
+ return GetStorSimpleClient().BackupPolicy.Update(deviceId, policyId, updatepolicyConfig, GetCustomRequestHeaders());
+ }
+
+ public TaskResponse UpdateBackupPolicyAsync(string deviceId, string policyId, UpdateBackupPolicyConfig updatepolicyConfig)
+ {
+ return GetStorSimpleClient().BackupPolicy.BeginUpdatingBackupPolicy(deviceId, policyId, updatepolicyConfig, GetCustomRequestHeaders());
+ }
+
+ ///
+ /// for a new backuppolicy for which no backup has yet been taken,service returns last backup time as 1/1/2010 which is misleading
+ /// we are setting it to null
+ ///
+ ///
+ ///
+ private IList CorrectLastBackupForNewPolicy(IList backupPolicyList)
+ {
+ if (backupPolicyList != null)
+ {
+ for (int i = 0; i < backupPolicyList.Count; ++i)
+ {
+ if (backupPolicyList[i].LastBackup.Value.Year == 2010
+ && backupPolicyList[i].LastBackup.Value.Month == 1
+ && backupPolicyList[i].LastBackup.Value.Day == 1)
+ {
+ //this means that for this policy no backup has yet been taken
+ //so the service returns 1/1/2010 which is incorrect. hence we are correcting it here
+ backupPolicyList[i].LastBackup = null;
+ }
+ }
+ }
+ return backupPolicyList;
+ }
+
+ ///
+ /// for a new backuppolicy for which no backup has yet been taken,service returns last backup time as 1/1/2010 which is misleading
+ /// we are setting it to null
+ ///
+ ///
+ ///
+ private BackupPolicyDetails CorrectLastBackupForNewPolicyDetail(BackupPolicyDetails backupPolicyDetail)
+ {
+ if (backupPolicyDetail != null && backupPolicyDetail.LastBackup != null)
+ {
+ if (backupPolicyDetail.LastBackup.Value.Year == 2010
+ && backupPolicyDetail.LastBackup.Value.Month == 1
+ && backupPolicyDetail.LastBackup.Value.Day == 1)
+ {
+ //this means that for this policy no backup has yet been taken
+ //so the service returns 1/1/2010 which is incorrect. hence we are correcting it here
+ backupPolicyDetail.LastBackup = null;
+ }
+
+ }
+ return backupPolicyDetail;
+ }
+
+ public void ValidateBackupScheduleBase(BackupScheduleBase newScheduleObject)
+ {
+ newScheduleObject.StartTime = GetValidStartTime(newScheduleObject.StartTime);
+ ValidateRetentionCount(newScheduleObject.RetentionCount);
+ ValidateRecurrenceValue(newScheduleObject.Recurrence.RecurrenceValue);
+ }
+
+ public void ValidateBackupScheduleUpdateRequest(BackupScheduleUpdateRequest updateScheduleObject)
+ {
+ updateScheduleObject.StartTime = GetValidStartTime(updateScheduleObject.StartTime);
+ ValidateRetentionCount(updateScheduleObject.RetentionCount);
+ ValidateRecurrenceValue(updateScheduleObject.Recurrence.RecurrenceValue);
+ }
+
+ private string GetValidStartTime(string startTime)
+ {
+ DateTime StartFromDt;
+ if (!string.IsNullOrEmpty(startTime))
+ {
+ bool dateTimeValid = DateTime.TryParse(startTime, out StartFromDt);
+
+ if (!dateTimeValid)
+ {
+ throw new ArgumentException(Resources.StartFromDateForBackupNotValid);
+ }
+ }
+ else
+ StartFromDt = DateTime.Now;
+
+ return StartFromDt.ToString("yyyy-MM-ddTHH:mm:sszzz");
+ }
+
+ private void ValidateRetentionCount(long retentionCount)
+ {
+ if (retentionCount < 1 || retentionCount > 64)
+ {
+ throw new ArgumentException(Resources.RetentionCountRangeInvalid);
+ }
+ }
+
+ private void ValidateRecurrenceValue(int recurrenceValue)
+ {
+ if (recurrenceValue <= 0)
+ {
+ throw new ArgumentException(Resources.RecurrenceValueLessThanZero);
+ }
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StoreSimpleCryptKeysClient.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StoreSimpleCryptKeysClient.cs
new file mode 100644
index 000000000000..4c4daac4a16f
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StoreSimpleCryptKeysClient.cs
@@ -0,0 +1,27 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.WindowsAzure.Management.StorSimple;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public partial class StorSimpleClient
+ {
+ public GetResourceEncryptionKeyResponse GetResourceEncryptionKey()
+ {
+ return this.GetStorSimpleClient().ResourceEncryptionKeys.Get(GetCustomRequestHeaders());
+ }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletBase.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletBase.cs
new file mode 100644
index 000000000000..b3d99c159e60
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletBase.cs
@@ -0,0 +1,384 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Threading;
+using Hyak.Common;
+using Microsoft.Azure;
+using System.Xml.Linq;
+using Microsoft.WindowsAzure.Commands.StorSimple.Encryption;
+using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
+using Microsoft.WindowsAzure.Management.StorSimple.Models;
+using Microsoft.WindowsAzure.Commands.Utilities.Common;
+using System.Net;
+using System.Management.Automation;
+using Microsoft.WindowsAzure.Commands.StorSimple.Models;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public class StorSimpleCmdletBase : AzurePSCmdlet
+ {
+ //this property will determine whether before running the actual commandlet logic, should resource selection be verified
+ protected bool verifyResourceBeforeCmdletExecute;
+
+ ///
+ /// default constructor for most commandlets. In this case, Resource check will be verified
+ ///
+ public StorSimpleCmdletBase() : this(true) { }
+
+ ///
+ /// constructor variant if you want to suppress the resource check for your commandlet
+ ///
+ ///
+ public StorSimpleCmdletBase(bool performResourceCheck):base()
+ {
+ verifyResourceBeforeCmdletExecute = performResourceCheck;
+ }
+
+ private StorSimpleClient storSimpleClient;
+
+ internal StorSimpleClient StorSimpleClient
+ {
+ get
+ {
+ if (this.storSimpleClient == null)
+ {
+ this.storSimpleClient = new StorSimpleClient(CurrentContext.Subscription);
+ }
+ storSimpleClient.ClientRequestId = Guid.NewGuid().ToString("D") + "_PS";
+ WriteVerbose(string.Format(Resources.ClientRequestIdMessage, storSimpleClient.ClientRequestId));
+ return this.storSimpleClient;
+ }
+ }
+
+ internal virtual void HandleAsyncTaskResponse(AzureOperationResponse opResponse, string operationName)
+ {
+ string msg = string.Empty;
+
+ if (opResponse.StatusCode != HttpStatusCode.Accepted && opResponse.StatusCode != HttpStatusCode.OK)
+ {
+ msg = string.Format(Resources.FailureMessageSubmitJob, operationName);
+ }
+
+ else
+ {
+ if (opResponse.GetType().Equals(typeof(TaskResponse)))
+ {
+ var taskResponse = opResponse as TaskResponse;
+ msg = string.Format(Resources.SuccessMessageSubmitJob, operationName, taskResponse.TaskId);
+ WriteObject(taskResponse.TaskId);
+ }
+
+ else if (opResponse.GetType().Equals(typeof(GuidTaskResponse)))
+ {
+ var guidTaskResponse = opResponse as GuidTaskResponse;
+ msg = string.Format(Resources.SuccessMessageSubmitJob, operationName, guidTaskResponse.TaskId);
+ WriteObject(guidTaskResponse.TaskId);
+ }
+ }
+
+ WriteVerbose(msg);
+ }
+
+ internal virtual void HandleSyncTaskResponse(TaskStatusInfo taskStatus, string operationName)
+ {
+ string msg = string.Empty;
+ TaskReport taskReport = new TaskReport(taskStatus);
+
+ if (taskStatus.AsyncTaskAggregatedResult != AsyncTaskAggregatedResult.Succeeded)
+ {
+ msg = string.Format(Resources.FailureMessageCompleteJob, operationName);
+ WriteObject(taskReport);
+ }
+
+ else
+ {
+ msg = string.Format(Resources.SuccessMessageCompleteJob, operationName);
+ WriteObject(taskReport);
+ }
+
+ WriteVerbose(msg);
+ }
+
+ private static void StripNamespaces(XDocument doc)
+ {
+ var elements = doc.Descendants();
+ elements.Attributes().Where(attr => attr.IsNamespaceDeclaration).Remove();
+ foreach (var element in elements)
+ {
+ element.Name = element.Name.LocalName;
+ }
+ }
+
+ internal virtual void HandleException(Exception exception)
+ {
+ ErrorRecord errorRecord = null;
+ var ex = exception;
+ do
+ {
+ Type exType = ex.GetType();
+ if(exType == typeof(CloudException))
+ {
+ var cloudEx = ex as CloudException;
+ if (cloudEx == null)
+ break;
+ var response = cloudEx.Response;
+ try
+ {
+ XDocument xDoc = XDocument.Parse(response.Content);
+ StripNamespaces(xDoc);
+ string cloudErrorCode = xDoc.Descendants("ErrorCode").FirstOrDefault().Value;
+ WriteVerbose(string.Format(Resources.CloudExceptionMessage, cloudErrorCode));
+ }
+ catch (Exception)
+ {
+
+ }
+
+ errorRecord = new ErrorRecord(cloudEx, string.Empty, ErrorCategory.InvalidOperation, null);
+ break;
+ }
+ else if(exType == typeof(WebException))
+ {
+ var webEx = ex as WebException;
+ if (webEx == null)
+ break;
+ try
+ {
+ HttpWebResponse response = webEx.Response as HttpWebResponse;
+ WriteVerbose(string.Format(Resources.WebExceptionMessage, response.StatusCode));
+ }
+ catch (Exception)
+ {
+
+ }
+ errorRecord = new ErrorRecord(webEx, string.Empty, ErrorCategory.ConnectionError, null);
+ break;
+ }
+ else if (exType == typeof (FormatException))
+ {
+ var formEx = ex as FormatException;
+ if (formEx == null)
+ break;
+ WriteVerbose(string.Format(Resources.InvalidInputMessage, ex.Message));
+ errorRecord = new ErrorRecord(formEx, string.Empty, ErrorCategory.InvalidData, null);
+ }
+ else if (exType == typeof(NullReferenceException))
+ {
+ var nullEx = ex as NullReferenceException;
+ if (nullEx == null)
+ break;
+ WriteVerbose(string.Format(Resources.InvalidInputMessage, ex.Message));
+ errorRecord = new ErrorRecord(nullEx, string.Empty, ErrorCategory.InvalidData, null);
+ break;
+ }
+ else if (exType == typeof(ArgumentNullException))
+ {
+ var argEx = ex as ArgumentNullException;
+ if (argEx == null)
+ break;
+ WriteVerbose(string.Format(Resources.InvalidInputMessage, ex.Message));
+ errorRecord = new ErrorRecord(argEx, string.Empty, ErrorCategory.InvalidData, null);
+ break;
+ }
+ ex = ex.InnerException;
+ } while (ex != null);
+
+ if(errorRecord == null)
+ {
+ errorRecord = new ErrorRecord(exception, string.Empty, ErrorCategory.NotSpecified, null);
+ }
+
+ WriteError(errorRecord);
+ }
+
+ protected override void BeginProcessing()
+ {
+ base.BeginProcessing();
+ if(verifyResourceBeforeCmdletExecute)
+ VerifyResourceContext();
+ }
+ ///
+ /// this method verifies that a resource has been selected before this commandlet is executed
+ ///
+ private void VerifyResourceContext()
+ {
+ if (!CheckResourceContextPresent())
+ {
+ throw GetGenericException(Resources.ResourceContextNotSetMessage, null);
+ }
+ }
+
+ private bool CheckResourceContextPresent()
+ {
+ var resourceContext = StorSimpleClient.GetResourceContext();
+ if (resourceContext == null
+ || string.IsNullOrEmpty(resourceContext.ResourceId)
+ || string.IsNullOrEmpty(resourceContext.ResourceName))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ internal bool ValidStorageAccountCred(string storageAccountName, string storageAccountKey, string endpoint)
+ {
+ using (System.Management.Automation.PowerShell ps = System.Management.Automation.PowerShell.Create())
+ {
+ bool valid = true;
+ Random rnd = new Random();
+ string testContainerName = string.Format("storsimplesdkvalidation{0}", rnd.Next());
+ //create a storage container and then delete it
+ string validateScript = string.Format(
+ @"$context = New-AzureStorageContext -StorageAccountName {0} -StorageAccountKey {1} -Endpoint {2};"
+ + @"New-AzureStorageContainer -Name {3} -Context $context;"
+ + @"Remove-AzureStorageContainer -Name {3} -Context $context -Force;",
+ storageAccountName, storageAccountKey, endpoint, testContainerName);
+ ps.AddScript(validateScript);
+ ps.Invoke();
+ if (ps.HadErrors)
+ {
+ var exception = ps.Streams.Error[0].Exception;
+ string getScript = string.Format(
+ @"$context = New-AzureStorageContext -StorageAccountName {0} -StorageAccountKey {1};"
+ + @"Get-AzureStorageContainer -Name {2} -Context $context;",
+ storageAccountName, storageAccountKey, testContainerName);
+ ps.AddScript(getScript);
+ var result = ps.Invoke();
+ if (result != null && result.Count > 0)
+ {
+ //storage container successfully created and still exists, retry deleting it
+ int retryCount = 1;
+ string removeScript = string.Format(
+ @"$context = New-AzureStorageContext -StorageAccountName {0} -StorageAccountKey {1};"
+ + @"Remove-AzureStorageContainer -Name {2} -Context $context -Force;",
+ storageAccountName, storageAccountKey, testContainerName);
+ do
+ {
+ WriteVerbose(string.Format(Resources.StorageAccountCleanupRetryMessage, retryCount));
+ ps.AddScript(removeScript);
+ ps.Invoke();
+ Thread.Sleep(retryCount * 1000);
+ ps.AddScript(getScript);
+ result = ps.Invoke();
+ } while (result != null && result.Count > 0 && ++retryCount <= 5);
+ }
+ else
+ {
+ valid = false;
+ HandleException(exception);
+ }
+ }
+ return valid;
+ }
+ }
+
+
+ internal string GetStorageAccountLocation(string storageAccountName, out bool exist)
+ {
+ using (System.Management.Automation.PowerShell ps = System.Management.Automation.PowerShell.Create())
+ {
+ string location = null;
+ exist = false;
+
+ string script = string.Format(@"Get-AzureStorageAccount -StorageAccountName {0}", storageAccountName);
+ ps.AddScript(script);
+ var result = ps.Invoke();
+
+ if (ps.HadErrors)
+ {
+ HandleException(ps.Streams.Error[0].Exception);
+ WriteVerbose(string.Format(Resources.StorageAccountNotFoundMessage, storageAccountName));
+ }
+
+ if (result != null && result.Count > 0)
+ {
+ exist = true;
+ WriteVerbose(string.Format(Resources.StorageAccountFoundMessage, storageAccountName));
+ script = string.Format(@"Get-AzureStorageAccount -StorageAccountName {0}"
+ + @"| Select-Object -ExpandProperty Location", storageAccountName);
+ ps.AddScript(script);
+ result = ps.Invoke();
+ if (ps.HadErrors)
+ {
+ HandleException(ps.Streams.Error[0].Exception);
+ }
+ if (result.Count > 0)
+ {
+ location = result[0].ToString();
+ }
+ }
+ return location;
+ }
+ }
+
+ internal bool ValidateAndEncryptStorageCred(string name, string key, string endpoint, out string encryptedKey, out string thumbprint)
+ {
+ StorSimpleCryptoManager storSimpleCryptoManager = new StorSimpleCryptoManager(StorSimpleClient);
+ thumbprint = storSimpleCryptoManager.GetSecretsEncryptionThumbprint();
+ encryptedKey = null;
+ if (!string.IsNullOrEmpty(key))
+ {
+ //validate storage account credentials
+ if (!ValidStorageAccountCred(name, key, endpoint))
+ {
+ WriteVerbose(Resources.StorageCredentialVerificationFailureMessage);
+ return false;
+ }
+ WriteVerbose(Resources.StorageCredentialVerificationSuccessMessage);
+ WriteVerbose(Resources.EncryptionInProgressMessage);
+ storSimpleCryptoManager.EncryptSecretWithRakPub(key, out encryptedKey);
+ }
+ return true;
+ }
+
+ ///
+ /// this method verifies that the devicename parameter specified is completely configured
+ /// no operation should be allowed to perform on a non-configured device
+ ///
+ public void VerifyDeviceConfigurationCompleteForDevice(string deviceId)
+ {
+ DeviceDetails details = storSimpleClient.GetDeviceDetails(deviceId);
+ bool data0Configured = false;
+
+ if(details.NetInterfaceList!=null)
+ {
+ NetInterface data0 = details.NetInterfaceList.Where(x => x.InterfaceId == NetInterfaceId.Data0).ToList().First();
+ if (data0 != null
+ && data0.IsEnabled
+ && data0.NicIPv4Settings != null
+ && !string.IsNullOrEmpty(data0.NicIPv4Settings.Controller0IPv4Address))
+ data0Configured = true;
+ }
+ if (!data0Configured)
+ throw GetGenericException(Resources.DeviceNotConfiguredMessage, null);
+ }
+
+ internal string GetHostnameFromEndpoint(string endpoint)
+ {
+ return string.Format("blob.{0}", endpoint);
+ }
+
+ internal string GetEndpointFromHostname(string hostname)
+ {
+ return hostname.Substring(hostname.IndexOf('.') + 1);
+ }
+
+ internal Exception GetGenericException(string exceptionMessage, Exception innerException)
+ {
+ return new Exception(exceptionMessage, innerException);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletHelpMessage.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletHelpMessage.cs
new file mode 100644
index 000000000000..615dfa8077d4
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletHelpMessage.cs
@@ -0,0 +1,83 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.WindowsAzure.Commands.StorSimple
+{
+ internal static class StorSimpleCmdletHelpMessage
+ {
+ public const string HelpMessageACRName = "The access control record name.";
+ public const string HelpMessageACRObject = "The access control record object.";
+ public const string HelpMessageDataContainerBandwidth = "The data container bandwidth rate.";
+ public const string HelpMessageDataContainerEncryptionEnabled = "Flag to encrypt the data container.";
+ public const string HelpMessageDataContainerEncryptionkey = "The encryption key for the data container.";
+ public const string HelpMessageDataContainerId = "The volume container identifier.";
+ public const string HelpMessageDataContainerName = "The volume container name.";
+ public const string HelpMessageDataContainerObject = "The volume container object.";
+ public const string HelpMessageDeviceConfigRequired = "Return Configuration details of the device.";
+ public const string HelpMessageDeviceId = "The device identifier.";
+ public const string HelpMessageDeviceModel = "The device model.";
+ public const string HelpMessageDeviceName = "Name of the StorSimple device on which the commandlet is to be run";
+ public const string HelpMessageDeviceType = "The device type.";
+ public const string HelpMessageForce = "User confirmation is not required.";
+ public const string HelpMessageIQNforACR = "The iSCSI Qualified Name (IQN).";
+ public const string HelpMessageTaskId = "The task identifier.";
+ public const string HelpMessageSACObject = "The storage account credential object.";
+ public const string HelpMessageStorageAccountKey = "The storage account key.";
+ public const string HelpMessageStorageAccountName = "The storage account name.";
+ public const string HelpMessageUseSSL = "Flag to use SSL.";
+ public const string HelpMessageEndpoint = "Azure storage endpoint.";
+ public const string HelpMessageVolumeAcrList = "List of access control records.";
+ public const string HelpMessageVolumeAppType = "The application type of the volume.";
+ public const string HelpMessageVolumeDefaultBackup = "Flag to enable default backup.";
+ public const string HelpMessageVolumeId = "The volume identifier.";
+ public const string HelpMessageVolumeMonitoring = "Flag to enable monitoring.";
+ public const string HelpMessageVolumeName = "The volume name.";
+ public const string HelpMessageVolumeOnline = "Is the volume online";
+ public const string HelpMessageVolumeSize = "The size of volume in bytes.";
+ public const string HelpMessageWaitTillComplete = "Wait till the async operation completes.";
+ public const string HelpMessageBackupPolicyName = "Name of the Backup policy that you wish to retrieve. Skip this parameter to get all policies";
+ public const string HelpMessageBackupIdToDelete = "InstanceId of the Backup that needs to be deleted";
+ public const string HelpMessageBackupIdToRestore = "InstanceId of the Backup that needs to be restored";
+ public const string HelpMessagesnapshotIdToRestore = "InstanceId of the Snapshot that needs to be restored";
+ public const string HelpMessageBackupPolicyIdToDelete = "InstanceId of the BackupPolicy that needs to be deleted";
+ public const string HelpMessageBackupPolicyToDelete = "The BackupPolicyDetails object that needs to be deleted";
+ public const string HelpMessageBackupTypeDesc = "Enter LocalSnapshot or CloudSnapshot";
+ public const string HelpMessageRecurrenceTypeDesc = "Enter \"Minutes or Hourly or Daily or Weekly\"";
+ public const string HelpMessageRecurrenceValueDesc = "How often do you want a backup to be taken? Enter a numerical value";
+ public const string HelpMessageRetentionCountDesc = "Number of days the backup should be retained before deleting";
+ public const string HelpMessageBackupStartFromDesc = "Enter date from which you want to start taking backups. Default is now";
+ public const string HelpMessageBackupEnabledDesc = "Set this parameter to false if you want to this backupschedule to be disabled";
+ public const string HelpMessageNewBackupPolicyName = "The new name of the backup policy.";
+ public const string HelpMessageBackupsToAddList = "List of BackupScheduleBase objects to be added to the policy";
+ public const string HelpMessageVolumeIdsToAddList = "List of VolumeIds to be added";
+ public const string HelpMessageBackupPolicyId = "InstanceId of the backupPolicy which created the backups";
+ public const string HelpMessageVolumeIdForBackup = "InstanceId of the volume in which backups exist";
+ public const string HelpMessageBackupPolicyDetailsObject = "Provide the BackupPolicyDetails object. The InstanceId of this object will be used as a filter for backups";
+ public const string HelpMessageVolumeObject = "Provide the VirtualDisk object. The InstanceId of this object will be used as a filter for backups";
+ public const string HelpMessageStartFrom = "The start date time for filtering backups";
+ public const string HelpMessageEndTime = "The end date time for filtering backups";
+ public const string HelpMessageFirstDesc = "Gets only the specified number of objects. Enter the number of objects to get";
+ public const string HelpMessageSkipDesc = "Ignores the specified number of objects and then gets the remaining objects. Enter the number of objects to skip";
+ public const string HelpMessageBackupPolicyIdForCreate = "Id of the backupPolicy which will be used to create backup";
+ public const string HelpMessageBackupScheduleId = "Enter the InstanceId of the BackupSchedule object that you wish to update";
+ public const string HelpMessageBackupPolicyIdToUpdate = "InstanceId of the backupPolicy which you are trying to update";
+ public const string HelpMessageBackupPolicyNameChange = "Name of the backup policy. If you are changing the name, set -IsPolicyRenamed to 1";
+ public const string HelpMessageIsPolicyRenamed = "If you are renaming the policy set this value to 1";
+ public const string HelpMessageBackupScheduleBaseObjsToAdd = "List of BackupScheduleBase objects to be added to the policy";
+ public const string HelpMessageBackupScheduleBaseObjsToUpdate = "List of BackupScheduleUpdateRequest objects to be updated";
+ public const string HelpMessageBackupScheduleBaseObjsToDelete = "List of Instance Id of BackupSchedule objects to be deleted";
+ public const string HelpMessageVolumeObjsToUpdate = "List of VolumeIds to be updated";
+ public const string HelpMessageResourceName = "Name of the resource which needs to be retrieved";
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletParameterSet.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletParameterSet.cs
new file mode 100644
index 000000000000..62b76845348f
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletParameterSet.cs
@@ -0,0 +1,27 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.WindowsAzure.Commands.StorSimple
+{
+ internal static class StorSimpleCmdletParameterSet
+ {
+ public const string Empty = "Empty";
+ public const string IdentifyById = "IdentifyById";
+ public const string IdentifyByName = "IdentifyByName";
+ public const string IdentifyByObject = "IdentifyByObject";
+ public const string IdentifyByParentObject = "IdentifyByParentObject";
+ public const string IdentifyById2 = "IdentifyById2";
+ public const string IdentifyByObject2 = "IdentifyByObject2";
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleContext.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleContext.cs
new file mode 100644
index 000000000000..88f666a22819
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleContext.cs
@@ -0,0 +1,32 @@
+// ----------------------------------------------------------------------------------
+//
+// 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 Microsoft.WindowsAzure.Commands.StorSimple.Encryption;
+
+namespace Microsoft.WindowsAzure.Commands.StorSimple
+{
+ public static class StorSimpleContext
+ {
+ public static string SubscriptionId { get; set; }
+ public static Uri ServiceEndPoint { get; set; }
+ public static string ResourceId { get; set; }
+ public static string StampId { get; set; }
+ public static string CloudServiceName { get; set; }
+ public static string ResourceProviderNameSpace { get; set; }
+ public static string ResourceType { get; set; }
+ public static string ResourceName { get; set; }
+ public static StorSimpleKeyManager KeyManager { get; set; }
+ }
+}
diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/packages.config b/src/ServiceManagement/StorSimple/Commands.StorSimple/packages.config
new file mode 100644
index 000000000000..ceca9f9facc6
--- /dev/null
+++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/packages.config
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file