diff --git a/AzurePowershell.Test.targets b/AzurePowershell.Test.targets index 7a5479fb8b6b..266648bada86 100644 --- a/AzurePowershell.Test.targets +++ b/AzurePowershell.Test.targets @@ -7,7 +7,8 @@ .\src\Local.x64.testsettings .\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll .\src\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll - .\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll + .\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll + .\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll .\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll .\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.dll .\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll @@ -44,6 +45,7 @@ + diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi index 30f644ac672e..bda114bf1eef 100644 --- a/setup/azurecmdfiles.wxi +++ b/setup/azurecmdfiles.wxi @@ -718,15 +718,6 @@ - - - - - - - - - @@ -814,9 +805,6 @@ - - - @@ -1059,15 +1047,6 @@ - - - - - - - - - @@ -1222,15 +1201,6 @@ - - - - - - - - - @@ -1252,9 +1222,6 @@ - - - @@ -1374,9 +1341,6 @@ - - - @@ -1793,6 +1757,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2097,15 +2114,6 @@ - - - - - - - - - @@ -2151,9 +2159,6 @@ - - - @@ -4610,9 +4615,6 @@ - - - @@ -4642,7 +4644,6 @@ - @@ -4713,9 +4714,6 @@ - - - @@ -4766,9 +4764,6 @@ - - - @@ -4776,7 +4771,6 @@ - @@ -4816,7 +4810,6 @@ - @@ -4952,6 +4945,23 @@ + + + + + + + + + + + + + + + + + @@ -5051,9 +5061,6 @@ - - - @@ -5069,7 +5076,6 @@ - diff --git a/src/AzurePowershell.sln b/src/AzurePowershell.sln index d1a7d54f112f..aa8b7fa20a15 100644 --- a/src/AzurePowershell.sln +++ b/src/AzurePowershell.sln @@ -231,6 +231,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureBackup", "Res EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureBackup.Test", "ResourceManager\AzureBackup\Commands.AzureBackup.Test\Commands.AzureBackup.Test.csproj", "{678AE95D-2364-47D7-888C-3FFA6D412CC8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.SiteRecovery", "ResourceManager\SiteRecovery\Commands.SiteRecovery\Commands.SiteRecovery.csproj", "{7C879645-31EE-4A78-AD81-5512300FA104}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.SiteRecovery.Test", "ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\Commands.SiteRecovery.Test.csproj", "{6C7D3D81-37AB-445E-8081-78A1FEC0A773}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -573,6 +577,14 @@ Global {678AE95D-2364-47D7-888C-3FFA6D412CC8}.Debug|Any CPU.Build.0 = Debug|Any CPU {678AE95D-2364-47D7-888C-3FFA6D412CC8}.Release|Any CPU.ActiveCfg = Release|Any CPU {678AE95D-2364-47D7-888C-3FFA6D412CC8}.Release|Any CPU.Build.0 = Release|Any CPU + {7C879645-31EE-4A78-AD81-5512300FA104}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C879645-31EE-4A78-AD81-5512300FA104}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C879645-31EE-4A78-AD81-5512300FA104}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C879645-31EE-4A78-AD81-5512300FA104}.Release|Any CPU.Build.0 = Release|Any CPU + {6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -619,5 +631,6 @@ Global {F220C306-29A3-4511-8518-A58A55C60D07} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} {6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} {678AE95D-2364-47D7-888C-3FFA6D412CC8} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} + {6C7D3D81-37AB-445E-8081-78A1FEC0A773} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} EndGlobalSection EndGlobal diff --git a/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 b/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 index f953bad7a358..7513c2bb580f 100644 --- a/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 +++ b/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 @@ -103,7 +103,8 @@ NestedModules = @( '.\OperationalInsights\Microsoft.Azure.Commands.OperationalInsights.dll', '.\UsageAggregates\Microsoft.Azure.Commands.UsageAggregates.dll', '.\ApiManagement\Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll', - '.\AzureBackup\Microsoft.Azure.Commands.AzureBackup.dll' + '.\AzureBackup\Microsoft.Azure.Commands.AzureBackup.dll', + '.\SiteRecovery\Microsoft.Azure.Commands.SiteRecovery.dll' ) # Functions to export from this module diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Commands.SiteRecovery.Test.csproj b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Commands.SiteRecovery.Test.csproj new file mode 100644 index 000000000000..bdc32cb645d1 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Commands.SiteRecovery.Test.csproj @@ -0,0 +1,181 @@ + + + + + Debug + AnyCPU + {6C7D3D81-37AB-445E-8081-78A1FEC0A773} + Library + Properties + Microsoft.Azure.Commands.SiteRecovery.Test + Microsoft.Azure.Commands.SiteRecovery.Test + v4.5 + 512 + ..\..\..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.27-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll + + + ..\..\..\packages\Microsoft.Azure.Management.SiteRecovery.0.1.0-preview\lib\net40\Microsoft.Azure.Management.SiteRecovery.dll + True + + + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + + + + ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5571.32271-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll + + + ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5571.32271-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll + + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\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.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll + + + False + ..\..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll + + + ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + + + + + False + C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll + + + + + ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll + True + + + ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll + True + + + + + + + + + + False + ..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll + + + ..\..\..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + {5ee72c53-1720-4309-b54b-5fb79703195f} + Commands.Common + + + {c1bda476-a5cc-4394-914d-48b0ec31a710} + Commands.ScenarioTests.Common + + + {7c879645-31ee-4a78-ad81-5512300fa104} + Commands.SiteRecovery + + + + + + + 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/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Properties/AssemblyInfo.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..036f491f2332 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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.Commands.SiteRecovery.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Hewlett-Packard Company")] +[assembly: AssemblyProduct("Commands.SiteRecovery.Test")] +[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 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)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("53c5f637-216c-44d5-ab19-c133cf33bb8d")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/SiteRecoveryTests.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/SiteRecoveryTests.cs new file mode 100644 index 000000000000..9612be6aee20 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/SiteRecoveryTests.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 Microsoft.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests +{ + public class SiteRecoveryTests : SiteRecoveryTestsBase + { + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void EnumerationTests() + { + this.RunPowerShellTest("Test-SiteRecoveryEnumerationTests -vaultSettingsFilePath \"" + vaultSettingsFilePath + "\""); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestCreateProfile() + { + this.RunPowerShellTest("Test-SiteRecoveryCreateProfile -vaultSettingsFilePath \"" + vaultSettingsFilePath + "\""); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestDeleteProfile() + { + this.RunPowerShellTest("Test-SiteRecoveryDeleteProfile -vaultSettingsFilePath \"" + vaultSettingsFilePath + "\""); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestAssociateProfile() + { + this.RunPowerShellTest("Test-SiteRecoveryAssociateProfile -vaultSettingsFilePath \"" + vaultSettingsFilePath + "\""); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestDissociateProfile() + { + this.RunPowerShellTest("Test-SiteRecoveryDissociateProfile -vaultSettingsFilePath \"" + vaultSettingsFilePath + "\""); + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/SiteRecoveryTests.ps1 b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/SiteRecoveryTests.ps1 new file mode 100644 index 000000000000..b61e93a694a0 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/SiteRecoveryTests.ps1 @@ -0,0 +1,161 @@ +# ---------------------------------------------------------------------------------- +# +# 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. +# ---------------------------------------------------------------------------------- + +########################## Site Recovery Tests ############################# + + +<# +.SYNOPSIS +Site Recovery Enumeration Tests +#> +function Test-SiteRecoveryEnumerationTests +{ + param([string] $vaultSettingsFilePath) + + # Import Azure Site Recovery Vault Settings + Import-AzureSiteRecoveryVaultSettingsFile $vaultSettingsFilePath + + # Enumerate Vaults + $vaults = Get-AzureSiteRecoveryVault + Assert-True { $vaults.Count -gt 0 } + Assert-NotNull($vaults) + foreach($vault in $vaults) + { + Assert-NotNull($vault.Name) + Assert-NotNull($vault.ID) + } + + # Enumerate Servers + $servers = Get-AzureSiteRecoveryServer + Assert-True { $servers.Count -gt 0 } + Assert-NotNull($servers) + foreach($server in $servers) + { + Assert-NotNull($server.Name) + Assert-NotNull($server.ID) + } + + # Enumerate Protection Containers + $protectionContainers = Get-AzureSiteRecoveryProtectionContainer + Assert-True { $protectionContainers.Count -gt 0 } + Assert-NotNull($protectionContainers) + foreach($protectionContainer in $protectionContainers) + { + Assert-NotNull($protectionContainer.Name) + Assert-NotNull($protectionContainer.ID) + } +} + +<# +.SYNOPSIS +Site Recovery Create profile Test +#> +function Test-SiteRecoveryCreateProfile +{ + param([string] $vaultSettingsFilePath) + + # Import Azure Site Recovery Vault Settings + Import-AzureSiteRecoveryVaultSettingsFile $vaultSettingsFilePath + + # Create profile + $job = New-AzureSiteRecoveryProtectionProfile -Name pp -ReplicationProvider HyperVReplica -ReplicationMethod Online -ReplicationFrequencyInSeconds 30 -RecoveryPoints 1 -ApplicationConsistentSnapshotFrequencyInHours 0 -ReplicationPort 8083 -Authentication Kerberos + # WaitForJobCompletion -JobId $job.Name +} + +<# +.SYNOPSIS +Site Recovery Delete profile Test +#> +function Test-SiteRecoveryDeleteProfile +{ + param([string] $vaultSettingsFilePath) + + # Import Azure Site Recovery Vault Settings + Import-AzureSiteRecoveryVaultSettingsFile $vaultSettingsFilePath + + # Get a profile created in previous test (with name pp) + $profiles = Get-AzureSiteRecoveryProtectionProfile -Name pp + Assert-True { $profiles.Count -gt 0 } + Assert-NotNull($profiles) + + # Delete the profile + $job = Remove-AzureSiteRecoveryProtectionProfile -ProtectionProfile $profiles[0] + # WaitForJobCompletion -JobId $job.Name +} + +<# +.SYNOPSIS +Site Recovery Associate profile Test +#> +function Test-SiteRecoveryAssociateProfile +{ + param([string] $vaultSettingsFilePath) + + # Import Azure Site Recovery Vault Settings + Import-AzureSiteRecoveryVaultSettingsFile $vaultSettingsFilePath + + # Get the primary cloud, recovery cloud, and protection profile + $pri = Get-AzureSiteRecoveryProtectionContainer -FriendlyName pri + $rec = Get-AzureSiteRecoveryProtectionContainer -FriendlyName rec + $pp = Get-AzureSiteRecoveryProtectionProfile -Name pp; + + # Associate the profile + $job = Start-AzureSiteRecoveryProtectionProfileAssociationJob -ProtectionProfile $pp -PrimaryProtectionContainer $pri -RecoveryProtectionContainer $rec + # WaitForJobCompletion -JobId $job.Name +} + +<# +.SYNOPSIS +Site Recovery Dissociate profile Test +#> +function Test-SiteRecoveryDissociateProfile +{ + param([string] $vaultSettingsFilePath) + + # Import Azure Site Recovery Vault Settings + Import-AzureSiteRecoveryVaultSettingsFile $vaultSettingsFilePath + + # Get the primary cloud, recovery cloud, and protection profile + $pri = Get-AzureSiteRecoveryProtectionContainer -FriendlyName pri + $rec = Get-AzureSiteRecoveryProtectionContainer -FriendlyName rec + $pp = Get-AzureSiteRecoveryProtectionProfile -Name pp; + + # Dissociate the profile + $job = Start-AzureSiteRecoveryProtectionProfileDissociationJob -ProtectionProfile $pp -PrimaryProtectionContainer $pri -RecoveryProtectionContainer $rec + # WaitForJobCompletion -JobId $job.Name +} + +<# +.SYNOPSIS +Wait for job completion +Usage: + WaitForJobCompletion -JobId $job.ID + WaitForJobCompletion -JobId $job.ID -NumOfSecondsToWait 10 +#> +function WaitForJobCompletion +{ + param([string] $JobId, [Int] $NumOfSecondsToWait = 120) + $endStateDescription = @('Succeeded','Failed','Cancelled','Suspended') + + $timeElapse = 0; + $interval = 5; + do + { + Start-Sleep $interval + $timeElapse = $timeElapse + $interval + $job = Get-AzureSiteRecoveryJob -Name $JobId; + } while((-not ($endStateDescription -ccontains $job.State)) -and ($timeElapse -lt $NumOfSecondsToWait)) + + Assert-True { $endStateDescription -ccontains $job.State } "Job did not reached desired state within $NumOfSecondsToWait seconds." +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/SiteRecoveryTestsBase.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/SiteRecoveryTestsBase.cs new file mode 100644 index 000000000000..e7fe07614ed7 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/SiteRecoveryTestsBase.cs @@ -0,0 +1,141 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Net; +using System.Net.Security; +using System.Runtime.Serialization; +using System.Xml; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using Microsoft.WindowsAzure; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Microsoft.Azure.Management.RecoveryServices; +using Microsoft.Azure.Management.SiteRecovery; +using Microsoft.Azure.Test; +using Microsoft.WindowsAzure.Commands.Common; +using Microsoft.Azure.Common.Authentication.Models; +using Microsoft.Azure.Common.Authentication; + +namespace Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests +{ + public abstract class SiteRecoveryTestsBase + { + private CSMTestEnvironmentFactory armTestFactory; + private EnvironmentSetupHelper helper; + protected string vaultSettingsFilePath; + private ASRVaultCreds asrVaultCreds = null; + + public SiteRecoveryManagementClient SiteRecoveryMgmtClient { get; private set; } + public RecoveryServicesManagementClient RecoveryServicesMgmtClient { get; private set; } + + protected SiteRecoveryTestsBase() + { + this.vaultSettingsFilePath = "ScenarioTests\\vaultSettings.VaultCredentials"; + + if (File.Exists(this.vaultSettingsFilePath)) + { + try + { + var serializer1 = new DataContractSerializer(typeof(ASRVaultCreds)); + using (var s = new FileStream( + this.vaultSettingsFilePath, + FileMode.Open, + FileAccess.Read, + FileShare.Read)) + { + asrVaultCreds = (ASRVaultCreds)serializer1.ReadObject(s); + } + } + catch (XmlException xmlException) + { + throw new XmlException( + "XML is malformed or file is empty", xmlException); + } + catch (SerializationException serializationException) + { + throw new SerializationException( + "XML is malformed or file is empty", serializationException); + } + } + else + { + throw new FileNotFoundException( + "Vault settings file not found, please pass the file downloaded from portal"); + } + + helper = new EnvironmentSetupHelper(); + } + + protected void SetupManagementClients() + { + RecoveryServicesMgmtClient = GetRecoveryServicesManagementClient(); + SiteRecoveryMgmtClient = GetSiteRecoveryManagementClient(); + + helper.SetupManagementClients(RecoveryServicesMgmtClient, SiteRecoveryMgmtClient); + } + + protected void RunPowerShellTest(params string[] scripts) + { + using (UndoContext context = UndoContext.Current) + { + context.Start(TestUtilities.GetCallingClass(2), TestUtilities.GetCurrentMethodName(2)); + + this.armTestFactory = new CSMTestEnvironmentFactory(); + + SetupManagementClients(); + + helper.SetupEnvironment(AzureModule.AzureServiceManagement); + helper.SetupModules(AzureModule.AzureResourceManager, + "ScenarioTests\\" + this.GetType().Name + ".ps1"); + + helper.RunPowerShellTest(scripts); + } + } + + private RecoveryServicesManagementClient GetRecoveryServicesManagementClient() + { + return TestBase.GetServiceClient(this.armTestFactory); + } + + private SiteRecoveryManagementClient GetSiteRecoveryManagementClient() + { + TestEnvironment environment = this.armTestFactory.GetTestEnvironment(); + + if (ServicePointManager.ServerCertificateValidationCallback == null) + { + ServicePointManager.ServerCertificateValidationCallback = + IgnoreCertificateErrorHandler; + } + + return new SiteRecoveryManagementClient( + asrVaultCreds.ResourceGroupName, + asrVaultCreds.ResourceName, + asrVaultCreds.ResourceGroupName, + RecoveryServicesMgmtClient.Credentials, + RecoveryServicesMgmtClient.BaseUri).WithHandler(HttpMockServer.CreateInstance()); + } + + 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/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/vaultSettings.VaultCredentials b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/vaultSettings.VaultCredentials new file mode 100644 index 000000000000..8b84da7b59fb --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/vaultSettings.VaultCredentials @@ -0,0 +1 @@ +00a07ea0-ad8b-491c-9de8-77bf10881499HyperVRecoveryManagerVaultppeVault2accesscontrol.windows.netwusppe1rrp1usershttp://windowscloudbackup/m3tmPfTki5UFSdaEq2JFvzuw==testsitegroup1.0 diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/EnumerationTests.json b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/EnumerationTests.json new file mode 100644 index 000000000000..3cca932198f5 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/EnumerationTests.json @@ -0,0 +1,640 @@ +{ + "Entries": [ + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-request-id": [ + "4abcc1ed-cf3c-447a-88bb-0b82aa0d906e" + ], + "x-ms-correlation-request-id": [ + "4abcc1ed-cf3c-447a-88bb-0b82aa0d906e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092819Z:4abcc1ed-cf3c-447a-88bb-0b82aa0d906e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:19 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14994" + ], + "x-ms-request-id": [ + "acf463df-805e-4fd2-a556-27c7569dad2c" + ], + "x-ms-correlation-request-id": [ + "acf463df-805e-4fd2-a556-27c7569dad2c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092821Z:acf463df-805e-4fd2-a556-27c7569dad2c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:21 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14991" + ], + "x-ms-request-id": [ + "716c5765-edce-418f-9b41-3a5aaa5b91e8" + ], + "x-ms-correlation-request-id": [ + "716c5765-edce-418f-9b41-3a5aaa5b91e8" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092822Z:716c5765-edce-418f-9b41-3a5aaa5b91e8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:22 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14989" + ], + "x-ms-request-id": [ + "bb0f0058-7804-465e-a5bc-bca92aa09497" + ], + "x-ms-correlation-request-id": [ + "bb0f0058-7804-465e-a5bc-bca92aa09497" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092826Z:bb0f0058-7804-465e-a5bc-bca92aa09497" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:26 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0754e060-5739-4f4a-a664-3290b41530fb-2015-07-28 09:28:19Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "7bdbd9fd-1a30-4f6b-aa23-16f3ef36085c" + ], + "x-ms-client-request-id": [ + "0754e060-5739-4f4a-a664-3290b41530fb-2015-07-28 09:28:19Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-correlation-request-id": [ + "7bdbd9fd-1a30-4f6b-aa23-16f3ef36085c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092820Z:7bdbd9fd-1a30-4f6b-aa23-16f3ef36085c" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:19 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "bac4bed3-9d94-472e-9490-3df8eb0e8565-2015-07-28 09:28:21Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "fbe14f6f-d6b5-4401-a0de-bd9d74b45868" + ], + "x-ms-client-request-id": [ + "bac4bed3-9d94-472e-9490-3df8eb0e8565-2015-07-28 09:28:21Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14992" + ], + "x-ms-correlation-request-id": [ + "fbe14f6f-d6b5-4401-a0de-bd9d74b45868" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092822Z:fbe14f6f-d6b5-4401-a0de-bd9d74b45868" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:21 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b9632da3-1d2e-4536-bd4f-c565cddc32c4-2015-07-28 09:28:22Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "2377b055-6966-458c-8a70-b72cded529bf" + ], + "x-ms-client-request-id": [ + "b9632da3-1d2e-4536-bd4f-c565cddc32c4-2015-07-28 09:28:22Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14990" + ], + "x-ms-correlation-request-id": [ + "2377b055-6966-458c-8a70-b72cded529bf" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092822Z:2377b055-6966-458c-8a70-b72cded529bf" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:22 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "4d3fd094-3d7a-4509-b997-cfcbbac5f54b-2015-07-28 09:28:26Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "6579b1ad-c1e4-4d96-9ed6-a5abf2052152" + ], + "x-ms-client-request-id": [ + "4d3fd094-3d7a-4509-b997-cfcbbac5f54b-2015-07-28 09:28:26Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14988" + ], + "x-ms-correlation-request-id": [ + "6579b1ad-c1e4-4d96-9ed6-a5abf2052152" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092826Z:6579b1ad-c1e4-4d96-9ed6-a5abf2052152" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:26 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXMtTjJRUlJQVEU0WUpHSUpMQ1k1VTI1UlFWN1A0SzI0RU5VRzZMWVpGNUY1MzZWRlpJTTVQQS1XZXN0LVVTL3Byb3ZpZGVycy9NaWNyb3NvZnQuU2l0ZVJlY292ZXJ5L1NpdGVSZWNvdmVyeVZhdWx0P2FwaS12ZXJzaW9uPTIwMTUtMDMtMTU=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c2b07874-a7b0-4be2-93d4-ee1015d1d71e-2015-07-28 09:28:21Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "12" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14993" + ], + "x-ms-request-id": [ + "1b63e0e2-f903-4bd2-9fe8-9bbb93d12168" + ], + "x-ms-correlation-request-id": [ + "1b63e0e2-f903-4bd2-9fe8-9bbb93d12168" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092821Z:1b63e0e2-f903-4bd2-9fe8-9bbb93d12168" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:21 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/Servers?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1NlcnZlcnM/YXBpLXZlcnNpb249MjAxNS0wOC0xMA==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "936a0db5-1fd6-4e5e-8adf-64a340593880-2015-07-28 09:28:22Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/Servers/57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"name\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"type\": \"Microsoft.SiteRecovery/Servers\",\r\n \"properties\": {\r\n \"serverVersion\": \"3.2.7510.0\",\r\n \"providerVersion\": \"3.5.601.0\",\r\n \"lastHeartbeat\": \"2015-07-28T09:27:10.6378094Z\",\r\n \"connectionStatus\": \"Connected\",\r\n \"fabricType\": \"VMM\",\r\n \"fabricObjectID\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"friendlyName\": \"sriramvu-hv2.fareast.corp.microsoft.com\"\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "593" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "936a0db5-1fd6-4e5e-8adf-64a340593880-2015-07-28 09:28:22Z-P 7/28/2015 9:28:24 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "936a0db5-1fd6-4e5e-8adf-64a340593880-2015-07-28 09:28:22Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-correlation-request-id": [ + "8dac9bfd-622c-4440-862c-0b91e0f74f1a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092824Z:8dac9bfd-622c-4440-862c-0b91e0f74f1a" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:24 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Db250YWluZXJzP2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f54466ec-88f8-45b0-85a9-bdf6a12cf002-2015-07-28 09:28:26Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"name\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"pri\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"name\": \"19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"cloud9\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"name\": \"42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"d2\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"name\": \"7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"d1\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"name\": \"b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"alokSec\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"name\": \"de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"alokPri\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"name\": \"f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"azurecloud\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"name\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"rec\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "4147" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "f54466ec-88f8-45b0-85a9-bdf6a12cf002-2015-07-28 09:28:26Z-P 7/28/2015 9:28:27 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "f54466ec-88f8-45b0-85a9-bdf6a12cf002-2015-07-28 09:28:26Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-correlation-request-id": [ + "b766a144-65fb-4ea3-9c68-1f2f57d13b8c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T092827Z:b766a144-65fb-4ea3-9c68-1f2f57d13b8c" + ], + "Date": [ + "Tue, 28 Jul 2015 09:28:26 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "00a07ea0-ad8b-491c-9de8-77bf10881499" + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestAssociateProfile.json b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestAssociateProfile.json new file mode 100644 index 000000000000..2f65d78ccf0c --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestAssociateProfile.json @@ -0,0 +1,1020 @@ +{ + "Entries": [ + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14937" + ], + "x-ms-request-id": [ + "25f8981d-9b16-45df-888e-aaa772fe6e5d" + ], + "x-ms-correlation-request-id": [ + "25f8981d-9b16-45df-888e-aaa772fe6e5d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113522Z:25f8981d-9b16-45df-888e-aaa772fe6e5d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:22 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14935" + ], + "x-ms-request-id": [ + "4a501fa5-e5ba-4e09-8df3-b6496f2edeb8" + ], + "x-ms-correlation-request-id": [ + "4a501fa5-e5ba-4e09-8df3-b6496f2edeb8" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113523Z:4a501fa5-e5ba-4e09-8df3-b6496f2edeb8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:23 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14933" + ], + "x-ms-request-id": [ + "2ed461f5-609e-4e46-894b-a7d311de7677" + ], + "x-ms-correlation-request-id": [ + "2ed461f5-609e-4e46-894b-a7d311de7677" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113526Z:2ed461f5-609e-4e46-894b-a7d311de7677" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:25 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14931" + ], + "x-ms-request-id": [ + "9484770b-3134-40f6-a2ac-d04e4c81330f" + ], + "x-ms-correlation-request-id": [ + "9484770b-3134-40f6-a2ac-d04e4c81330f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113527Z:9484770b-3134-40f6-a2ac-d04e4c81330f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:27 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14929" + ], + "x-ms-request-id": [ + "7d815d4e-0baf-46a1-ac6c-a0fdf2f3cad1" + ], + "x-ms-correlation-request-id": [ + "7d815d4e-0baf-46a1-ac6c-a0fdf2f3cad1" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113528Z:7d815d4e-0baf-46a1-ac6c-a0fdf2f3cad1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:28 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14927" + ], + "x-ms-request-id": [ + "a19b5d0a-9e7b-4791-86ed-2354345f4cd5" + ], + "x-ms-correlation-request-id": [ + "a19b5d0a-9e7b-4791-86ed-2354345f4cd5" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113531Z:a19b5d0a-9e7b-4791-86ed-2354345f4cd5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:30 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "adb96490-acc3-442d-863a-1dd0593425e4-2015-07-28 11:35:22Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "d76e4a02-1f04-444c-a186-e86c6f023dc0" + ], + "x-ms-client-request-id": [ + "adb96490-acc3-442d-863a-1dd0593425e4-2015-07-28 11:35:22Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14936" + ], + "x-ms-correlation-request-id": [ + "d76e4a02-1f04-444c-a186-e86c6f023dc0" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113523Z:d76e4a02-1f04-444c-a186-e86c6f023dc0" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:22 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "80772c67-0793-4074-bbc1-4c92e180759e-2015-07-28 11:35:23Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "a3a04e68-238d-4cc5-b9af-f690369093a3" + ], + "x-ms-client-request-id": [ + "80772c67-0793-4074-bbc1-4c92e180759e-2015-07-28 11:35:23Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14934" + ], + "x-ms-correlation-request-id": [ + "a3a04e68-238d-4cc5-b9af-f690369093a3" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113524Z:a3a04e68-238d-4cc5-b9af-f690369093a3" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:23 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c9a5b5fc-1d85-4723-9e6b-d32f880aa459-2015-07-28 11:35:26Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "8f1d4ad0-b4cd-4a7d-b174-a21f7af1b90b" + ], + "x-ms-client-request-id": [ + "c9a5b5fc-1d85-4723-9e6b-d32f880aa459-2015-07-28 11:35:26Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14932" + ], + "x-ms-correlation-request-id": [ + "8f1d4ad0-b4cd-4a7d-b174-a21f7af1b90b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113526Z:8f1d4ad0-b4cd-4a7d-b174-a21f7af1b90b" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:25 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "1299f83f-8fbc-4dd0-8af8-36e2502345d8-2015-07-28 11:35:27Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "d6220b33-c27a-4a62-a3a7-eb5d5da7b081" + ], + "x-ms-client-request-id": [ + "1299f83f-8fbc-4dd0-8af8-36e2502345d8-2015-07-28 11:35:27Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14930" + ], + "x-ms-correlation-request-id": [ + "d6220b33-c27a-4a62-a3a7-eb5d5da7b081" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113527Z:d6220b33-c27a-4a62-a3a7-eb5d5da7b081" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:27 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "329a3a8d-3824-45f4-8e27-6e836ffd6024-2015-07-28 11:35:28Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "e0b8f9c0-7dca-4c5f-9a52-30f562b949b5" + ], + "x-ms-client-request-id": [ + "329a3a8d-3824-45f4-8e27-6e836ffd6024-2015-07-28 11:35:28Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14928" + ], + "x-ms-correlation-request-id": [ + "e0b8f9c0-7dca-4c5f-9a52-30f562b949b5" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113529Z:e0b8f9c0-7dca-4c5f-9a52-30f562b949b5" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:28 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ea8fafd4-e5cb-4ffe-ae07-01af9269d24f-2015-07-28 11:35:31Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "3b88d2a2-50ce-4621-b9ea-ac0f8c5ddd78" + ], + "x-ms-client-request-id": [ + "ea8fafd4-e5cb-4ffe-ae07-01af9269d24f-2015-07-28 11:35:31Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14926" + ], + "x-ms-correlation-request-id": [ + "3b88d2a2-50ce-4621-b9ea-ac0f8c5ddd78" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113531Z:3b88d2a2-50ce-4621-b9ea-ac0f8c5ddd78" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:31 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Db250YWluZXJzP2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d861df58-ef18-4f91-b9a5-3aa018dfa1c3-2015-07-28 11:35:24Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"name\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"pri\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"name\": \"19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"cloud9\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"name\": \"42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"d2\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"name\": \"7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"d1\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"name\": \"b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"alokSec\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"name\": \"de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"alokPri\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"name\": \"f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"azurecloud\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"name\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"rec\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "4147" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "d861df58-ef18-4f91-b9a5-3aa018dfa1c3-2015-07-28 11:35:24Z-P 7/28/2015 11:35:25 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "d861df58-ef18-4f91-b9a5-3aa018dfa1c3-2015-07-28 11:35:24Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14961" + ], + "x-ms-correlation-request-id": [ + "0b906aae-863a-4948-ba95-57c92cc8aefa" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113525Z:0b906aae-863a-4948-ba95-57c92cc8aefa" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:24 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Db250YWluZXJzP2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c8ca0f56-502a-4b06-acaa-331dbab26a90-2015-07-28 11:35:26Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"name\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"pri\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"name\": \"19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"cloud9\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"name\": \"42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"d2\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"name\": \"7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"d1\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"name\": \"b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"alokSec\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"name\": \"de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"alokPri\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"name\": \"f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"azurecloud\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"name\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"rec\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "4147" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "c8ca0f56-502a-4b06-acaa-331dbab26a90-2015-07-28 11:35:26Z-P 7/28/2015 11:35:26 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "c8ca0f56-502a-4b06-acaa-331dbab26a90-2015-07-28 11:35:26Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14960" + ], + "x-ms-correlation-request-id": [ + "3c74c760-54af-4ba5-a2b5-2133e91f2424" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113527Z:3c74c760-54af-4ba5-a2b5-2133e91f2424" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:26 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Qcm9maWxlcy9wcD9hcGktdmVyc2lvbj0yMDE1LTA4LTEw", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ed3fb3de-d37b-4c22-9ec2-5578341246b5-2015-07-28 11:35:27Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp\",\r\n \"name\": \"pp\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionProfile\",\r\n \"properties\": {\r\n \"friendlyName\": \"pp\",\r\n \"protectedEntityCount\": 0,\r\n \"associationStatus\": \"Associated\",\r\n \"replicationProvider\": \"HyperVReplica\",\r\n \"replicationProviderSettings\": {\r\n \"__type\": \"HyperVReplicaProtectionProfileDetails\",\r\n \"recoveryPoints\": 1,\r\n \"applicationConsistentSnapshotFrequencyInHours\": 0,\r\n \"compression\": \"Disabled\",\r\n \"initialReplicationMethod\": \"OverNetwork\",\r\n \"onlineReplicationStartTime\": null,\r\n \"offlineReplicationImportPath\": \"\",\r\n \"offlineReplicationExportPath\": \"\",\r\n \"replicationPort\": 8083,\r\n \"allowedAuthenticationType\": 1,\r\n \"replicaDeletionOption\": \"None\",\r\n \"replicationFrequencyInSeconds\": 30\r\n },\r\n \"associationDetail\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "825" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ed3fb3de-d37b-4c22-9ec2-5578341246b5-2015-07-28 11:35:27Z-P 7/28/2015 11:35:28 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "ed3fb3de-d37b-4c22-9ec2-5578341246b5-2015-07-28 11:35:27Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14959" + ], + "x-ms-correlation-request-id": [ + "b9a4b792-6089-49df-b552-a86283d7702c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113528Z:b9a4b792-6089-49df-b552-a86283d7702c" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:27 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp/Associate?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Qcm9maWxlcy9wcC9Bc3NvY2lhdGU/YXBpLXZlcnNpb249MjAxNS0wOC0xMA==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"primaryProtectionContainerId\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"recoveryProtectionContainerId\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/Json" + ], + "Content-Length": [ + "154" + ], + "Accept": [ + "application/Json" + ], + "Agent-Authentication": [ + "{\"NotBeforeTimestamp\":\"\\/Date(1438079729326)\\/\",\"NotAfterTimestamp\":\"\\/Date(1438684529326)\\/\",\"ClientRequestId\":\"87f216d3-5c9c-42a1-865b-8b247b274842-2015-07-28 11:35:29Z-P\",\"HashFunction\":\"HMACSHA256\",\"Hmac\":\"JBMPi2dzKfWsGhwBpmRG6W4+nM0L/Go1oZI234ik1S0=\",\"Version\":{\"Major\":1,\"Minor\":2,\"Build\":-1,\"Revision\":-1,\"MajorRevision\":-1,\"MinorRevision\":-1},\"PropertyBag\":{}}" + ], + "x-ms-client-request-id": [ + "87f216d3-5c9c-42a1-865b-8b247b274842-2015-07-28 11:35:29Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "30" + ], + "Azure-AsyncOperation": [ + "https://api-dogfood.resources.windows-int.net/Jobs/03f49e2d-50f4-4377-8310-3b3651cbc7a2?api-version=2015-08-10" + ], + "x-ms-request-id": [ + "87f216d3-5c9c-42a1-865b-8b247b274842-2015-07-28 11:35:29Z-P 7/28/2015 11:35:30 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-client-request-id": [ + "87f216d3-5c9c-42a1-865b-8b247b274842-2015-07-28 11:35:29Z-P" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "e158badf-e59d-408a-96ab-2f7844efbcb6" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113530Z:e158badf-e59d-408a-96ab-2f7844efbcb6" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:30 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp/operationresults/03f49e2d-50f4-4377-8310-3b3651cbc7a2?api-version=2015-08-10" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/jobs/03f49e2d-50f4-4377-8310-3b3651cbc7a2?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL2pvYnMvMDNmNDllMmQtNTBmNC00Mzc3LTgzMTAtM2IzNjUxY2JjN2EyP2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "2c34d3b9-40a1-4259-b740-5e141dec1e5b-2015-07-28 11:35:31Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/Jobs/03f49e2d-50f4-4377-8310-3b3651cbc7a2\",\r\n \"name\": \"03f49e2d-50f4-4377-8310-3b3651cbc7a2\",\r\n \"type\": \"Microsoft.SiteRecovery/Job\",\r\n \"properties\": {\r\n \"activityId\": \"87f216d3-5c9c-42a1-865b-8b247b274842-2015-07-28 11:35:29Z-P\",\r\n \"scenarioName\": \"CloudPairing\",\r\n \"displayName\": \"Protection configuration\",\r\n \"state\": \"InProgress\",\r\n \"tasks\": [\r\n {\r\n \"id\": \"9208701f-5eaa-45c9-ad8a-0d8d097264ef\",\r\n \"name\": \"CloudPairingHyperVReplicaBlue\",\r\n \"startTime\": \"0001-01-01T00:00:00\",\r\n \"endTime\": \"0001-01-01T00:00:00\",\r\n \"actions\": [],\r\n \"state\": \"NotStarted\",\r\n \"childJobId\": null\r\n }\r\n ],\r\n \"errors\": [],\r\n \"startTime\": \"2015-07-28T11:35:30.0983484Z\",\r\n \"endTime\": null,\r\n \"allowedActions\": [\r\n \"Cancel\",\r\n \"Restart\"\r\n ],\r\n \"targetObjectId\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"targetObjectType\": \"ProtectionContainer\",\r\n \"targetObjectName\": \"pri\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "899" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "2c34d3b9-40a1-4259-b740-5e141dec1e5b-2015-07-28 11:35:31Z-P 7/28/2015 11:35:31 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "2c34d3b9-40a1-4259-b740-5e141dec1e5b-2015-07-28 11:35:31Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14958" + ], + "x-ms-correlation-request-id": [ + "46154c2d-8c68-4bcf-a0e3-e73e0970f658" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113532Z:46154c2d-8c68-4bcf-a0e3-e73e0970f658" + ], + "Date": [ + "Tue, 28 Jul 2015 11:35:32 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "00a07ea0-ad8b-491c-9de8-77bf10881499" + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestCreateProfile.json b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestCreateProfile.json new file mode 100644 index 000000000000..9451fb166756 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestCreateProfile.json @@ -0,0 +1,842 @@ +{ + "Entries": [ + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14997" + ], + "x-ms-request-id": [ + "ea9a1d07-8f13-480e-b227-e1049c6a9e4f" + ], + "x-ms-correlation-request-id": [ + "ea9a1d07-8f13-480e-b227-e1049c6a9e4f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T094940Z:ea9a1d07-8f13-480e-b227-e1049c6a9e4f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:49:40 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-request-id": [ + "9bab2118-61c0-4bf0-b84a-44d0b09b87a2" + ], + "x-ms-correlation-request-id": [ + "9bab2118-61c0-4bf0-b84a-44d0b09b87a2" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T094957Z:9bab2118-61c0-4bf0-b84a-44d0b09b87a2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:49:57 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14993" + ], + "x-ms-request-id": [ + "21429428-0e3c-41e5-b9ff-4afeb8e24f3f" + ], + "x-ms-correlation-request-id": [ + "21429428-0e3c-41e5-b9ff-4afeb8e24f3f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T095001Z:21429428-0e3c-41e5-b9ff-4afeb8e24f3f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:50:01 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14991" + ], + "x-ms-request-id": [ + "45bf1d17-d2d0-4e3a-ae76-83a0fffea307" + ], + "x-ms-correlation-request-id": [ + "45bf1d17-d2d0-4e3a-ae76-83a0fffea307" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T095007Z:45bf1d17-d2d0-4e3a-ae76-83a0fffea307" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:50:07 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14989" + ], + "x-ms-request-id": [ + "bd8b1f8c-7d34-4348-9d55-46aa44017325" + ], + "x-ms-correlation-request-id": [ + "bd8b1f8c-7d34-4348-9d55-46aa44017325" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T095023Z:bd8b1f8c-7d34-4348-9d55-46aa44017325" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:50:22 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7a24434d-e912-49b0-8f09-8980b1f212be-2015-07-28 09:49:40Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ddb8bae6-d164-4b8c-b5c5-878d047fff78" + ], + "x-ms-client-request-id": [ + "7a24434d-e912-49b0-8f09-8980b1f212be-2015-07-28 09:49:40Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-correlation-request-id": [ + "ddb8bae6-d164-4b8c-b5c5-878d047fff78" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T094940Z:ddb8bae6-d164-4b8c-b5c5-878d047fff78" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:49:40 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "680fae71-37ca-4f8d-af6e-d6dd8e675991-2015-07-28 09:49:57Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "337f60bc-600e-4a15-b39d-67022ebfcfc8" + ], + "x-ms-client-request-id": [ + "680fae71-37ca-4f8d-af6e-d6dd8e675991-2015-07-28 09:49:57Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14994" + ], + "x-ms-correlation-request-id": [ + "337f60bc-600e-4a15-b39d-67022ebfcfc8" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T094958Z:337f60bc-600e-4a15-b39d-67022ebfcfc8" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:49:57 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f7b913d4-2c1c-4fd1-8a30-a8cef1ea4260-2015-07-28 09:50:01Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "baaadc12-f287-4bc1-9590-6279a79bcae4" + ], + "x-ms-client-request-id": [ + "f7b913d4-2c1c-4fd1-8a30-a8cef1ea4260-2015-07-28 09:50:01Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14992" + ], + "x-ms-correlation-request-id": [ + "baaadc12-f287-4bc1-9590-6279a79bcae4" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T095001Z:baaadc12-f287-4bc1-9590-6279a79bcae4" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:50:01 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9a3cce5c-abec-4f33-a299-825efbf48262-2015-07-28 09:50:07Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "deb9d987-3f87-4629-ba2d-25d15c2debec" + ], + "x-ms-client-request-id": [ + "9a3cce5c-abec-4f33-a299-825efbf48262-2015-07-28 09:50:07Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14990" + ], + "x-ms-correlation-request-id": [ + "deb9d987-3f87-4629-ba2d-25d15c2debec" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T095008Z:deb9d987-3f87-4629-ba2d-25d15c2debec" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:50:08 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "82ac45a5-f3fc-49ec-ada2-a38b2f467890-2015-07-28 09:50:22Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "9322c2dd-0ff8-4ebf-9fdd-52043cb7088f" + ], + "x-ms-client-request-id": [ + "82ac45a5-f3fc-49ec-ada2-a38b2f467890-2015-07-28 09:50:22Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14988" + ], + "x-ms-correlation-request-id": [ + "9322c2dd-0ff8-4ebf-9fdd-52043cb7088f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T095023Z:9322c2dd-0ff8-4ebf-9fdd-52043cb7088f" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:50:23 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Qcm9maWxlcy9wcD9hcGktdmVyc2lvbj0yMDE1LTA4LTEw", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"name\": \"pp\",\r\n \"replicationProvider\": \"HyperVReplica\",\r\n \"replicationProviderSettings\": {\r\n \"__type\": \"HyperVReplicaProtectionProfileInput\",\r\n \"replicationFrequencyInSeconds\": 30,\r\n \"recoveryPoints\": 1,\r\n \"applicationConsistentSnapshotFrequencyInHours\": 0,\r\n \"compression\": \"Disable\",\r\n \"initialReplicationMethod\": \"OverNetwork\",\r\n \"replicationPort\": 8083,\r\n \"allowedAuthenticationType\": 1,\r\n \"replicaDeletion\": \"NotRequired\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/Json" + ], + "Content-Length": [ + "468" + ], + "Accept": [ + "application/Json" + ], + "Agent-Authentication": [ + "{\"NotBeforeTimestamp\":\"\\/Date(1438073398265)\\/\",\"NotAfterTimestamp\":\"\\/Date(1438678198265)\\/\",\"ClientRequestId\":\"4dc0eac4-9e70-4361-b30a-078dbf0aac06-2015-07-28 09:49:58Z-P\",\"HashFunction\":\"HMACSHA256\",\"Hmac\":\"HndeYmHnLukeOh6vcrrS3LyYftnDbLFIoE57P9SAdBI=\",\"Version\":{\"Major\":1,\"Minor\":2,\"Build\":-1,\"Revision\":-1,\"MajorRevision\":-1,\"MinorRevision\":-1},\"PropertyBag\":{}}" + ], + "x-ms-client-request-id": [ + "4dc0eac4-9e70-4361-b30a-078dbf0aac06-2015-07-28 09:49:58Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "30" + ], + "Azure-AsyncOperation": [ + "https://api-dogfood.resources.windows-int.net/Jobs/1df60d48-db6c-445d-b48e-6416ef76f309?api-version=2015-08-10" + ], + "x-ms-request-id": [ + "4dc0eac4-9e70-4361-b30a-078dbf0aac06-2015-07-28 09:49:58Z-P 7/28/2015 9:50:00 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-client-request-id": [ + "4dc0eac4-9e70-4361-b30a-078dbf0aac06-2015-07-28 09:49:58Z-P" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "1a9353cd-bac3-44d0-9bae-4ac0ec6602bb" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T095000Z:1a9353cd-bac3-44d0-9bae-4ac0ec6602bb" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 09:50:00 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp/operationresults/1df60d48-db6c-445d-b48e-6416ef76f309?api-version=2015-08-10" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/jobs/1df60d48-db6c-445d-b48e-6416ef76f309?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL2pvYnMvMWRmNjBkNDgtZGI2Yy00NDVkLWI0OGUtNjQxNmVmNzZmMzA5P2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9de2e92e-103c-456b-9907-64cceb71dcca-2015-07-28 09:50:01Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/Jobs/1df60d48-db6c-445d-b48e-6416ef76f309\",\r\n \"name\": \"1df60d48-db6c-445d-b48e-6416ef76f309\",\r\n \"type\": \"Microsoft.SiteRecovery/Job\",\r\n \"properties\": {\r\n \"activityId\": \"4dc0eac4-9e70-4361-b30a-078dbf0aac06-2015-07-28 09:49:58Z-P\",\r\n \"scenarioName\": \"AddProtectionProfile\",\r\n \"displayName\": \"Configuring protection group\",\r\n \"state\": \"Succeeded\",\r\n \"tasks\": [\r\n {\r\n \"id\": \"AddProtectionProfilePreflightsCheckTask\",\r\n \"name\": \"AddProtectionProfilePreflightsCheckTask\",\r\n \"startTime\": \"2015-07-28T09:50:01.1841869Z\",\r\n \"endTime\": \"2015-07-28T09:50:01.3560319Z\",\r\n \"actions\": [],\r\n \"state\": \"Succeeded\",\r\n \"childJobId\": null\r\n },\r\n {\r\n \"id\": \"AddProtectionProfileTask\",\r\n \"name\": \"AddProtectionProfileTask\",\r\n \"startTime\": \"2015-07-28T09:50:01.3560319Z\",\r\n \"endTime\": \"2015-07-28T09:50:01.3560319Z\",\r\n \"actions\": [],\r\n \"state\": \"Succeeded\",\r\n \"childJobId\": null\r\n }\r\n ],\r\n \"errors\": [],\r\n \"startTime\": \"2015-07-28T09:50:00.5081255Z\",\r\n \"endTime\": \"2015-07-28T09:50:01Z\",\r\n \"allowedActions\": [\r\n \"Cancel\",\r\n \"Restart\"\r\n ],\r\n \"targetObjectId\": \"pp\",\r\n \"targetObjectType\": \"ProtectionProfile\",\r\n \"targetObjectName\": \"pp\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1124" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "9de2e92e-103c-456b-9907-64cceb71dcca-2015-07-28 09:50:01Z-P 7/28/2015 9:50:02 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "9de2e92e-103c-456b-9907-64cceb71dcca-2015-07-28 09:50:01Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14990" + ], + "x-ms-correlation-request-id": [ + "5416048a-9d2c-4a72-be1c-554e0d0ea91b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T095002Z:5416048a-9d2c-4a72-be1c-554e0d0ea91b" + ], + "Date": [ + "Tue, 28 Jul 2015 09:50:02 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/jobs/1df60d48-db6c-445d-b48e-6416ef76f309?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL2pvYnMvMWRmNjBkNDgtZGI2Yy00NDVkLWI0OGUtNjQxNmVmNzZmMzA5P2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "32bf99d8-28f5-467f-bfcf-3b7fd16577a9-2015-07-28 09:50:08Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/Jobs/1df60d48-db6c-445d-b48e-6416ef76f309\",\r\n \"name\": \"1df60d48-db6c-445d-b48e-6416ef76f309\",\r\n \"type\": \"Microsoft.SiteRecovery/Job\",\r\n \"properties\": {\r\n \"activityId\": \"4dc0eac4-9e70-4361-b30a-078dbf0aac06-2015-07-28 09:49:58Z-P\",\r\n \"scenarioName\": \"AddProtectionProfile\",\r\n \"displayName\": \"Configuring protection group\",\r\n \"state\": \"Succeeded\",\r\n \"tasks\": [\r\n {\r\n \"id\": \"AddProtectionProfilePreflightsCheckTask\",\r\n \"name\": \"AddProtectionProfilePreflightsCheckTask\",\r\n \"startTime\": \"2015-07-28T09:50:01.1841869Z\",\r\n \"endTime\": \"2015-07-28T09:50:01.3560319Z\",\r\n \"actions\": [],\r\n \"state\": \"Succeeded\",\r\n \"childJobId\": null\r\n },\r\n {\r\n \"id\": \"AddProtectionProfileTask\",\r\n \"name\": \"AddProtectionProfileTask\",\r\n \"startTime\": \"2015-07-28T09:50:01.3560319Z\",\r\n \"endTime\": \"2015-07-28T09:50:01.3560319Z\",\r\n \"actions\": [],\r\n \"state\": \"Succeeded\",\r\n \"childJobId\": null\r\n }\r\n ],\r\n \"errors\": [],\r\n \"startTime\": \"2015-07-28T09:50:00.5081255Z\",\r\n \"endTime\": \"2015-07-28T09:50:01Z\",\r\n \"allowedActions\": [\r\n \"Cancel\",\r\n \"Restart\"\r\n ],\r\n \"targetObjectId\": \"pp\",\r\n \"targetObjectType\": \"ProtectionProfile\",\r\n \"targetObjectName\": \"pp\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1124" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "32bf99d8-28f5-467f-bfcf-3b7fd16577a9-2015-07-28 09:50:08Z-P 7/28/2015 9:50:08 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "32bf99d8-28f5-467f-bfcf-3b7fd16577a9-2015-07-28 09:50:08Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14989" + ], + "x-ms-correlation-request-id": [ + "9c35d7b2-1f0f-4a12-85b6-bb8cc626e089" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T095008Z:9c35d7b2-1f0f-4a12-85b6-bb8cc626e089" + ], + "Date": [ + "Tue, 28 Jul 2015 09:50:08 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Qcm9maWxlcy9wcD9hcGktdmVyc2lvbj0yMDE1LTA4LTEw", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9cd5dadb-800c-4ce3-86f6-997d65902389-2015-07-28 09:50:23Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp\",\r\n \"name\": \"pp\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionProfile\",\r\n \"properties\": {\r\n \"friendlyName\": \"pp\",\r\n \"protectedEntityCount\": 0,\r\n \"associationStatus\": \"Associated\",\r\n \"replicationProvider\": \"HyperVReplica\",\r\n \"replicationProviderSettings\": {\r\n \"__type\": \"HyperVReplicaProtectionProfileDetails\",\r\n \"recoveryPoints\": 1,\r\n \"applicationConsistentSnapshotFrequencyInHours\": 0,\r\n \"compression\": \"Disabled\",\r\n \"initialReplicationMethod\": \"OverNetwork\",\r\n \"onlineReplicationStartTime\": null,\r\n \"offlineReplicationImportPath\": \"\",\r\n \"offlineReplicationExportPath\": \"\",\r\n \"replicationPort\": 8083,\r\n \"allowedAuthenticationType\": 1,\r\n \"replicaDeletionOption\": \"None\",\r\n \"replicationFrequencyInSeconds\": 30\r\n },\r\n \"associationDetail\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "825" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "9cd5dadb-800c-4ce3-86f6-997d65902389-2015-07-28 09:50:23Z-P 7/28/2015 9:50:24 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "9cd5dadb-800c-4ce3-86f6-997d65902389-2015-07-28 09:50:23Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14988" + ], + "x-ms-correlation-request-id": [ + "bed007db-1730-4a1f-b14a-f35f088d0de7" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T095024Z:bed007db-1730-4a1f-b14a-f35f088d0de7" + ], + "Date": [ + "Tue, 28 Jul 2015 09:50:23 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "00a07ea0-ad8b-491c-9de8-77bf10881499" + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestDeleteProfile.json b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestDeleteProfile.json new file mode 100644 index 000000000000..d06df20ae36a --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestDeleteProfile.json @@ -0,0 +1,658 @@ +{ + "Entries": [ + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14969" + ], + "x-ms-request-id": [ + "b82d259d-836c-4071-8f90-091472b79be6" + ], + "x-ms-correlation-request-id": [ + "b82d259d-836c-4071-8f90-091472b79be6" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113923Z:b82d259d-836c-4071-8f90-091472b79be6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:22 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14967" + ], + "x-ms-request-id": [ + "45072869-2792-44ce-9de9-f76fa27d61ae" + ], + "x-ms-correlation-request-id": [ + "45072869-2792-44ce-9de9-f76fa27d61ae" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113924Z:45072869-2792-44ce-9de9-f76fa27d61ae" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:23 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14965" + ], + "x-ms-request-id": [ + "c5ea8b20-f4a6-419a-9620-8ead1d4f6d8d" + ], + "x-ms-correlation-request-id": [ + "c5ea8b20-f4a6-419a-9620-8ead1d4f6d8d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113926Z:c5ea8b20-f4a6-419a-9620-8ead1d4f6d8d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:26 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14963" + ], + "x-ms-request-id": [ + "dad2d34b-1a8f-4c42-b758-c24ab65da2b6" + ], + "x-ms-correlation-request-id": [ + "dad2d34b-1a8f-4c42-b758-c24ab65da2b6" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113928Z:dad2d34b-1a8f-4c42-b758-c24ab65da2b6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:28 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7fd7ba17-6dfa-44ff-90b7-2e1a7e52b484-2015-07-28 11:39:23Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "41d253f4-6dce-4054-b57e-a1b467cdb5ef" + ], + "x-ms-client-request-id": [ + "7fd7ba17-6dfa-44ff-90b7-2e1a7e52b484-2015-07-28 11:39:23Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14968" + ], + "x-ms-correlation-request-id": [ + "41d253f4-6dce-4054-b57e-a1b467cdb5ef" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113923Z:41d253f4-6dce-4054-b57e-a1b467cdb5ef" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:23 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "4784fdb3-550f-4664-b0ca-0a62e10a66ab-2015-07-28 11:39:24Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "3dc64cb3-ce52-48c4-b8c7-8e4b6ab006ee" + ], + "x-ms-client-request-id": [ + "4784fdb3-550f-4664-b0ca-0a62e10a66ab-2015-07-28 11:39:24Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14966" + ], + "x-ms-correlation-request-id": [ + "3dc64cb3-ce52-48c4-b8c7-8e4b6ab006ee" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113924Z:3dc64cb3-ce52-48c4-b8c7-8e4b6ab006ee" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:24 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e6737c19-2850-440b-93f6-9aff344ca750-2015-07-28 11:39:26Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "850f199d-3a93-4de6-b0d9-d42f2289d615" + ], + "x-ms-client-request-id": [ + "e6737c19-2850-440b-93f6-9aff344ca750-2015-07-28 11:39:26Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14964" + ], + "x-ms-correlation-request-id": [ + "850f199d-3a93-4de6-b0d9-d42f2289d615" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113927Z:850f199d-3a93-4de6-b0d9-d42f2289d615" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:27 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "4fe4f3ee-47bd-4e97-b2ab-d88323012771-2015-07-28 11:39:28Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "c978a9e3-dbe4-480b-9ac9-cada01c29c29" + ], + "x-ms-client-request-id": [ + "4fe4f3ee-47bd-4e97-b2ab-d88323012771-2015-07-28 11:39:28Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14962" + ], + "x-ms-correlation-request-id": [ + "c978a9e3-dbe4-480b-9ac9-cada01c29c29" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113928Z:c978a9e3-dbe4-480b-9ac9-cada01c29c29" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:28 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Qcm9maWxlcy9wcD9hcGktdmVyc2lvbj0yMDE1LTA4LTEw", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ce2ba953-9c40-4c35-a8d1-8262dca10f89-2015-07-28 11:39:24Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp\",\r\n \"name\": \"pp\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionProfile\",\r\n \"properties\": {\r\n \"friendlyName\": \"pp\",\r\n \"protectedEntityCount\": 0,\r\n \"associationStatus\": \"Associated\",\r\n \"replicationProvider\": \"HyperVReplica\",\r\n \"replicationProviderSettings\": {\r\n \"__type\": \"HyperVReplicaProtectionProfileDetails\",\r\n \"recoveryPoints\": 1,\r\n \"applicationConsistentSnapshotFrequencyInHours\": 0,\r\n \"compression\": \"Disabled\",\r\n \"initialReplicationMethod\": \"OverNetwork\",\r\n \"onlineReplicationStartTime\": null,\r\n \"offlineReplicationImportPath\": \"\",\r\n \"offlineReplicationExportPath\": \"\",\r\n \"replicationPort\": 8083,\r\n \"allowedAuthenticationType\": 1,\r\n \"replicaDeletionOption\": \"None\",\r\n \"replicationFrequencyInSeconds\": 30\r\n },\r\n \"associationDetail\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "825" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ce2ba953-9c40-4c35-a8d1-8262dca10f89-2015-07-28 11:39:24Z-P 7/28/2015 11:39:26 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "ce2ba953-9c40-4c35-a8d1-8262dca10f89-2015-07-28 11:39:24Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14983" + ], + "x-ms-correlation-request-id": [ + "4658c915-61f9-4ee7-95ff-a3f2066969db" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113926Z:4658c915-61f9-4ee7-95ff-a3f2066969db" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:26 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Qcm9maWxlcy9wcD9hcGktdmVyc2lvbj0yMDE1LTA4LTEw", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "Accept": [ + "application/Json" + ], + "Agent-Authentication": [ + "{\"NotBeforeTimestamp\":\"\\/Date(1438079967433)\\/\",\"NotAfterTimestamp\":\"\\/Date(1438684767433)\\/\",\"ClientRequestId\":\"defb2a19-a3f8-4ddb-a762-49bc1e357b2e-2015-07-28 11:39:27Z-P\",\"HashFunction\":\"HMACSHA256\",\"Hmac\":\"YwSy8QjlCfESA3bMm9VhcbjPK8WWTT2rG7uajlXC/94=\",\"Version\":{\"Major\":1,\"Minor\":2,\"Build\":-1,\"Revision\":-1,\"MajorRevision\":-1,\"MinorRevision\":-1},\"PropertyBag\":{}}" + ], + "x-ms-client-request-id": [ + "defb2a19-a3f8-4ddb-a762-49bc1e357b2e-2015-07-28 11:39:27Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "30" + ], + "Azure-AsyncOperation": [ + "https://api-dogfood.resources.windows-int.net/Jobs/99565575-e134-45e0-8a43-2719f96965b4?api-version=2015-08-10" + ], + "x-ms-request-id": [ + "defb2a19-a3f8-4ddb-a762-49bc1e357b2e-2015-07-28 11:39:27Z-P 7/28/2015 11:39:27 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-client-request-id": [ + "defb2a19-a3f8-4ddb-a762-49bc1e357b2e-2015-07-28 11:39:27Z-P" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "beab5f36-5069-4083-92ad-b4ec239372d7" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113928Z:beab5f36-5069-4083-92ad-b4ec239372d7" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:28 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp/operationresults/99565575-e134-45e0-8a43-2719f96965b4?api-version=2015-08-10" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/jobs/99565575-e134-45e0-8a43-2719f96965b4?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL2pvYnMvOTk1NjU1NzUtZTEzNC00NWUwLThhNDMtMjcxOWY5Njk2NWI0P2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9f1c0ac6-1604-4793-9595-5563d2c1b5f2-2015-07-28 11:39:29Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/Jobs/99565575-e134-45e0-8a43-2719f96965b4\",\r\n \"name\": \"99565575-e134-45e0-8a43-2719f96965b4\",\r\n \"type\": \"Microsoft.SiteRecovery/Job\",\r\n \"properties\": {\r\n \"activityId\": \"defb2a19-a3f8-4ddb-a762-49bc1e357b2e-2015-07-28 11:39:27Z-P\",\r\n \"scenarioName\": \"RemoveProtectionProfile\",\r\n \"displayName\": \"Remove the protection group\",\r\n \"state\": \"Succeeded\",\r\n \"tasks\": [\r\n {\r\n \"id\": \"RemoveProtectionProfilePreflightsCheckTask\",\r\n \"name\": \"RemoveProtectionProfilePreflightsCheckTask\",\r\n \"startTime\": \"2015-07-28T11:39:27.9544575Z\",\r\n \"endTime\": \"2015-07-28T11:39:28.0638278Z\",\r\n \"actions\": [],\r\n \"state\": \"Succeeded\",\r\n \"childJobId\": null\r\n },\r\n {\r\n \"id\": \"RemoveProtectionProfileTask\",\r\n \"name\": \"RemoveProtectionProfileTask\",\r\n \"startTime\": \"2015-07-28T11:39:28.0638278Z\",\r\n \"endTime\": \"2015-07-28T11:39:28.0638278Z\",\r\n \"actions\": [],\r\n \"state\": \"Succeeded\",\r\n \"childJobId\": null\r\n }\r\n ],\r\n \"errors\": [],\r\n \"startTime\": \"2015-07-28T11:39:27.5920617Z\",\r\n \"endTime\": \"2015-07-28T11:39:27Z\",\r\n \"allowedActions\": [\r\n \"Cancel\",\r\n \"Restart\"\r\n ],\r\n \"targetObjectId\": \"pp\",\r\n \"targetObjectType\": \"ProtectionProfile\",\r\n \"targetObjectName\": \"pp\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1138" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "9f1c0ac6-1604-4793-9595-5563d2c1b5f2-2015-07-28 11:39:29Z-P 7/28/2015 11:39:29 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "9f1c0ac6-1604-4793-9595-5563d2c1b5f2-2015-07-28 11:39:29Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14982" + ], + "x-ms-correlation-request-id": [ + "0abf07c1-0fed-4854-a7f8-517bb45e3f9b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113929Z:0abf07c1-0fed-4854-a7f8-517bb45e3f9b" + ], + "Date": [ + "Tue, 28 Jul 2015 11:39:29 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "00a07ea0-ad8b-491c-9de8-77bf10881499" + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestDissociateProfile.json b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestDissociateProfile.json new file mode 100644 index 000000000000..f15ce993e5cb --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/SessionRecords/Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests/TestDissociateProfile.json @@ -0,0 +1,1020 @@ +{ + "Entries": [ + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14956" + ], + "x-ms-request-id": [ + "8905c4dd-c7df-4638-8537-b52a85698968" + ], + "x-ms-correlation-request-id": [ + "8905c4dd-c7df-4638-8537-b52a85698968" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113749Z:8905c4dd-c7df-4638-8537-b52a85698968" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:48 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14954" + ], + "x-ms-request-id": [ + "2fc7eb88-5a51-4b93-bddf-88e1258395d9" + ], + "x-ms-correlation-request-id": [ + "2fc7eb88-5a51-4b93-bddf-88e1258395d9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113750Z:2fc7eb88-5a51-4b93-bddf-88e1258395d9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:50 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14952" + ], + "x-ms-request-id": [ + "ab2a497f-9bb8-4429-a9bc-c4b6b3de0a9d" + ], + "x-ms-correlation-request-id": [ + "ab2a497f-9bb8-4429-a9bc-c4b6b3de0a9d" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113756Z:ab2a497f-9bb8-4429-a9bc-c4b6b3de0a9d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:55 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14950" + ], + "x-ms-request-id": [ + "4e9b1512-c649-4d44-a3bf-51838c843d6b" + ], + "x-ms-correlation-request-id": [ + "4e9b1512-c649-4d44-a3bf-51838c843d6b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113757Z:4e9b1512-c649-4d44-a3bf-51838c843d6b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:57 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14948" + ], + "x-ms-request-id": [ + "5aa68a17-2547-48b6-9e4e-220fbe2f4af1" + ], + "x-ms-correlation-request-id": [ + "5aa68a17-2547-48b6-9e4e-220fbe2f4af1" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113758Z:5aa68a17-2547-48b6-9e4e-220fbe2f4af1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:58 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups?api-version=2015-01-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTUtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"name\": \"RecoveryServices-N2QRRPTE4YJGIJLCY5U25RQV7P4K24ENUG6LYZF5F536VFZIM5PA-West-US\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup\",\r\n \"name\": \"testsitegroup\",\r\n \"location\": \"centralus\",\r\n \"tags\": {\r\n \"department\": \"finance\",\r\n \"owner\": \"billg\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "550" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14946" + ], + "x-ms-request-id": [ + "b717b06b-d8e7-48e4-987a-aab275483ca9" + ], + "x-ms-correlation-request-id": [ + "b717b06b-d8e7-48e4-987a-aab275483ca9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113801Z:b717b06b-d8e7-48e4-987a-aab275483ca9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:38:00 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e2fdf362-55c0-4800-bed3-d37f73dacb96-2015-07-28 11:37:49Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "7699fd5e-0017-4c08-88bb-52f0e6c28918" + ], + "x-ms-client-request-id": [ + "e2fdf362-55c0-4800-bed3-d37f73dacb96-2015-07-28 11:37:49Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14955" + ], + "x-ms-correlation-request-id": [ + "7699fd5e-0017-4c08-88bb-52f0e6c28918" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113750Z:7699fd5e-0017-4c08-88bb-52f0e6c28918" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:50 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f639d350-3338-445b-9f21-daf2ca9c9c41-2015-07-28 11:37:50Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "08b8d01a-0c78-4d31-b49c-74e929d7ba28" + ], + "x-ms-client-request-id": [ + "f639d350-3338-445b-9f21-daf2ca9c9c41-2015-07-28 11:37:50Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14953" + ], + "x-ms-correlation-request-id": [ + "08b8d01a-0c78-4d31-b49c-74e929d7ba28" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113751Z:08b8d01a-0c78-4d31-b49c-74e929d7ba28" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:50 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c2e6bb8f-aa04-4c84-90b8-121fefa66e5d-2015-07-28 11:37:56Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "48ae98f7-7653-4e65-a8b9-322968714bd2" + ], + "x-ms-client-request-id": [ + "c2e6bb8f-aa04-4c84-90b8-121fefa66e5d-2015-07-28 11:37:56Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14951" + ], + "x-ms-correlation-request-id": [ + "48ae98f7-7653-4e65-a8b9-322968714bd2" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113756Z:48ae98f7-7653-4e65-a8b9-322968714bd2" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:55 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9c35de08-f227-41ea-84c8-5001ac7c3374-2015-07-28 11:37:57Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "1409c002-f1a1-4e5f-b387-be79966048fa" + ], + "x-ms-client-request-id": [ + "9c35de08-f227-41ea-84c8-5001ac7c3374-2015-07-28 11:37:57Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14949" + ], + "x-ms-correlation-request-id": [ + "1409c002-f1a1-4e5f-b387-be79966048fa" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113758Z:1409c002-f1a1-4e5f-b387-be79966048fa" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:58 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "df3c51f1-3b9d-4512-926c-13dcad76f0b9-2015-07-28 11:37:59Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "b2186f95-c3a0-4c1f-8d9c-0dff43e7037b" + ], + "x-ms-client-request-id": [ + "df3c51f1-3b9d-4512-926c-13dcad76f0b9-2015-07-28 11:37:59Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14947" + ], + "x-ms-correlation-request-id": [ + "b2186f95-c3a0-4c1f-8d9c-0dff43e7037b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113759Z:b2186f95-c3a0-4c1f-8d9c-0dff43e7037b" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:59 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault?api-version=2015-03-15", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wMy0xNQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "4a53d06c-7712-4fc3-bc28-d95572659470-2015-07-28 11:38:01Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"Value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault1\",\r\n \"etag\": \"0b2d574e-c7d7-40c8-90cd-84d731c37857\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault1\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"ppeVault2\",\r\n \"etag\": \"85300ead-5b9b-47da-82df-3b8cc13cd1dd\",\r\n \"tags\": null,\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"standard\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2\",\r\n \"type\": \"Microsoft.SiteRecovery/SiteRecoveryVault\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "753" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "6943269e-107e-46eb-8a96-549ab29a481b" + ], + "x-ms-client-request-id": [ + "4a53d06c-7712-4fc3-bc28-d95572659470-2015-07-28 11:38:01Z-P" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14945" + ], + "x-ms-correlation-request-id": [ + "6943269e-107e-46eb-8a96-549ab29a481b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113801Z:6943269e-107e-46eb-8a96-549ab29a481b" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:38:00 GMT" + ], + "Server": [ + "Microsoft-IIS/8.0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Db250YWluZXJzP2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "949594cd-73fd-4173-b78f-4ddf8d584ada-2015-07-28 11:37:51Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"name\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"pri\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"role\": \"Primary\",\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": [\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/26f79ebe-875a-4a9b-bd3c-871b80bb6f1b\",\r\n \"name\": \"26f79ebe-875a-4a9b-bd3c-871b80bb6f1b\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionProfile\",\r\n \"properties\": {\r\n \"friendlyName\": \"26f79ebe-875a-4a9b-bd3c-871b80bb6f1b\",\r\n \"protectedEntityCount\": 0,\r\n \"associationStatus\": \"Associated\",\r\n \"replicationProvider\": \"HyperVReplica\",\r\n \"replicationProviderSettings\": {\r\n \"__type\": \"HyperVReplicaProtectionProfileDetails\",\r\n \"recoveryPoints\": 1,\r\n \"applicationConsistentSnapshotFrequencyInHours\": 0,\r\n \"compression\": \"Disabled\",\r\n \"initialReplicationMethod\": \"OverNetwork\",\r\n \"onlineReplicationStartTime\": null,\r\n \"offlineReplicationImportPath\": \"\",\r\n \"offlineReplicationExportPath\": \"\",\r\n \"replicationPort\": 8083,\r\n \"allowedAuthenticationType\": 1,\r\n \"replicaDeletionOption\": \"None\",\r\n \"replicationFrequencyInSeconds\": 30\r\n },\r\n \"associationDetail\": [\r\n {\r\n \"associationStatus\": \"Paired\",\r\n \"primaryProtectionContainerId\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"recoveryProtectionContainerId\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/ff10d996-9083-4aee-b99d-7f7f44c81118\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"name\": \"19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"cloud9\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"name\": \"42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"d2\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"name\": \"7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"d1\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"name\": \"b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"alokSec\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"name\": \"de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"alokPri\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"name\": \"f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"azurecloud\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"name\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"rec\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"role\": \"Recovery\",\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "5582" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "949594cd-73fd-4173-b78f-4ddf8d584ada-2015-07-28 11:37:51Z-P 7/28/2015 11:37:55 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "949594cd-73fd-4173-b78f-4ddf8d584ada-2015-07-28 11:37:51Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14986" + ], + "x-ms-correlation-request-id": [ + "f440bf7c-a688-433c-aacd-5185ae049b0e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113755Z:f440bf7c-a688-433c-aacd-5185ae049b0e" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:54 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Db250YWluZXJzP2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0309fe50-82a1-46cd-b4eb-a6957aba3d9d-2015-07-28 11:37:56Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"name\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"pri\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"role\": \"Primary\",\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": [\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/26f79ebe-875a-4a9b-bd3c-871b80bb6f1b\",\r\n \"name\": \"26f79ebe-875a-4a9b-bd3c-871b80bb6f1b\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionProfile\",\r\n \"properties\": {\r\n \"friendlyName\": \"26f79ebe-875a-4a9b-bd3c-871b80bb6f1b\",\r\n \"protectedEntityCount\": 0,\r\n \"associationStatus\": \"Associated\",\r\n \"replicationProvider\": \"HyperVReplica\",\r\n \"replicationProviderSettings\": {\r\n \"__type\": \"HyperVReplicaProtectionProfileDetails\",\r\n \"recoveryPoints\": 1,\r\n \"applicationConsistentSnapshotFrequencyInHours\": 0,\r\n \"compression\": \"Disabled\",\r\n \"initialReplicationMethod\": \"OverNetwork\",\r\n \"onlineReplicationStartTime\": null,\r\n \"offlineReplicationImportPath\": \"\",\r\n \"offlineReplicationExportPath\": \"\",\r\n \"replicationPort\": 8083,\r\n \"allowedAuthenticationType\": 1,\r\n \"replicaDeletionOption\": \"None\",\r\n \"replicationFrequencyInSeconds\": 30\r\n },\r\n \"associationDetail\": [\r\n {\r\n \"associationStatus\": \"Paired\",\r\n \"primaryProtectionContainerId\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"recoveryProtectionContainerId\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/ff10d996-9083-4aee-b99d-7f7f44c81118\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"name\": \"19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"cloud9\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"19996177-88ca-4aa8-8fe6-8ae9198c06d3\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"name\": \"42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"d2\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"42432614-e000-4cb9-8827-a49ea1d0d3cc\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"name\": \"7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"d1\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"7c3641bb-d572-4d56-80da-498440f924e7\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"name\": \"b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"alokSec\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"b007f06c-646c-4978-a7bd-2a3d1a13110e\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"name\": \"de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"alokPri\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"de58c031-820e-4e1a-9505-763523bb69c5\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"name\": \"f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"azurecloud\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"f0982c81-dfb1-4bfa-ba0d-a7d941f6e8c7\",\r\n \"role\": null,\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionContainers/ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"name\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionContainer\",\r\n \"properties\": {\r\n \"friendlyName\": \"rec\",\r\n \"serverId\": \"57f95c35-6c83-42ce-bb21-2c4f10f92d8e\",\r\n \"fabricObjectId\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\",\r\n \"role\": \"Recovery\",\r\n \"fabricType\": \"VMM\",\r\n \"availableProtectionProfiles\": []\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "5582" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "0309fe50-82a1-46cd-b4eb-a6957aba3d9d-2015-07-28 11:37:56Z-P 7/28/2015 11:37:57 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "0309fe50-82a1-46cd-b4eb-a6957aba3d9d-2015-07-28 11:37:56Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14985" + ], + "x-ms-correlation-request-id": [ + "6880df5f-7a51-4563-b831-65a72b9ebe1b" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113757Z:6880df5f-7a51-4563-b831-65a72b9ebe1b" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:57 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Qcm9maWxlcy9wcD9hcGktdmVyc2lvbj0yMDE1LTA4LTEw", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "1e5eac15-0c82-4ee4-a035-2edbf36cef0b-2015-07-28 11:37:58Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp\",\r\n \"name\": \"pp\",\r\n \"type\": \"Microsoft.SiteRecovery/ProtectionProfile\",\r\n \"properties\": {\r\n \"friendlyName\": \"pp\",\r\n \"protectedEntityCount\": 0,\r\n \"associationStatus\": \"Associated\",\r\n \"replicationProvider\": \"HyperVReplica\",\r\n \"replicationProviderSettings\": {\r\n \"__type\": \"HyperVReplicaProtectionProfileDetails\",\r\n \"recoveryPoints\": 1,\r\n \"applicationConsistentSnapshotFrequencyInHours\": 0,\r\n \"compression\": \"Disabled\",\r\n \"initialReplicationMethod\": \"OverNetwork\",\r\n \"onlineReplicationStartTime\": null,\r\n \"offlineReplicationImportPath\": \"\",\r\n \"offlineReplicationExportPath\": \"\",\r\n \"replicationPort\": 8083,\r\n \"allowedAuthenticationType\": 1,\r\n \"replicaDeletionOption\": \"None\",\r\n \"replicationFrequencyInSeconds\": 30\r\n },\r\n \"associationDetail\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "825" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "1e5eac15-0c82-4ee4-a035-2edbf36cef0b-2015-07-28 11:37:58Z-P 7/28/2015 11:37:58 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "1e5eac15-0c82-4ee4-a035-2edbf36cef0b-2015-07-28 11:37:58Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14984" + ], + "x-ms-correlation-request-id": [ + "8e94324c-d42a-427c-83cd-266cff26721e" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113758Z:8e94324c-d42a-427c-83cd-266cff26721e" + ], + "Date": [ + "Tue, 28 Jul 2015 11:37:58 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp/Dissociate?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL1Byb3RlY3Rpb25Qcm9maWxlcy9wcC9EaXNzb2NpYXRlP2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"name\": \"pp\",\r\n \"replicationProviderSettings\": \"\",\r\n \"primaryProtectionContainerId\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"recoveryProtectionContainerId\": \"ff10d996-9083-4aee-b99d-7f7f44c81118\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/Json" + ], + "Content-Length": [ + "209" + ], + "Accept": [ + "application/Json" + ], + "Agent-Authentication": [ + "{\"NotBeforeTimestamp\":\"\\/Date(1438079879469)\\/\",\"NotAfterTimestamp\":\"\\/Date(1438684679469)\\/\",\"ClientRequestId\":\"95084069-d9be-43be-8949-457979a1cf6a-2015-07-28 11:37:59Z-P\",\"HashFunction\":\"HMACSHA256\",\"Hmac\":\"BOX/DS6b+fVJq8qXPXtTjzstWXxOEBDUxljljI85NLA=\",\"Version\":{\"Major\":1,\"Minor\":2,\"Build\":-1,\"Revision\":-1,\"MajorRevision\":-1,\"MinorRevision\":-1},\"PropertyBag\":{}}" + ], + "x-ms-client-request-id": [ + "95084069-d9be-43be-8949-457979a1cf6a-2015-07-28 11:37:59Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "30" + ], + "Azure-AsyncOperation": [ + "https://api-dogfood.resources.windows-int.net/Jobs/9457344d-808d-42d1-b834-8c4a997db486?api-version=2015-08-10" + ], + "x-ms-request-id": [ + "95084069-d9be-43be-8949-457979a1cf6a-2015-07-28 11:37:59Z-P 7/28/2015 11:38:00 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-client-request-id": [ + "95084069-d9be-43be-8949-457979a1cf6a-2015-07-28 11:37:59Z-P" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "de5c931d-3261-4af5-83a0-d5c6b106bac6" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113800Z:de5c931d-3261-4af5-83a0-d5c6b106bac6" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 28 Jul 2015 11:38:00 GMT" + ], + "Location": [ + "https://api-dogfood.resources.windows-int.net/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/ProtectionProfiles/pp/operationresults/9457344d-808d-42d1-b834-8c4a997db486?api-version=2015-08-10" + ], + "X-Powered-By": [ + "ASP.NET" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/jobs/9457344d-808d-42d1-b834-8c4a997db486?api-version=2015-08-10", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvMDBhMDdlYTAtYWQ4Yi00OTFjLTlkZTgtNzdiZjEwODgxNDk5L3Jlc291cmNlR3JvdXBzL3Rlc3RzaXRlZ3JvdXAvcHJvdmlkZXJzL01pY3Jvc29mdC5TaXRlUmVjb3ZlcnkvU2l0ZVJlY292ZXJ5VmF1bHQvcHBlVmF1bHQyL2pvYnMvOTQ1NzM0NGQtODA4ZC00MmQxLWI4MzQtOGM0YTk5N2RiNDg2P2FwaS12ZXJzaW9uPTIwMTUtMDgtMTA=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c6c25954-e3a8-4335-ae20-5ac777c06dfb-2015-07-28 11:38:01Z-P" + ], + "x-ms-version": [ + "2015-01-01" + ], + "User-Agent": [ + "Microsoft.Azure.Management.SiteRecovery.SiteRecoveryManagementClient/0.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft.SiteRecovery/SiteRecoveryVault/ppeVault2/Jobs/9457344d-808d-42d1-b834-8c4a997db486\",\r\n \"name\": \"9457344d-808d-42d1-b834-8c4a997db486\",\r\n \"type\": \"Microsoft.SiteRecovery/Job\",\r\n \"properties\": {\r\n \"activityId\": \"95084069-d9be-43be-8949-457979a1cf6a-2015-07-28 11:37:59Z-P\",\r\n \"scenarioName\": \"CloudUnPairing\",\r\n \"displayName\": \"Remove protection\",\r\n \"state\": \"InProgress\",\r\n \"tasks\": [\r\n {\r\n \"id\": \"6c11a271-07bc-4ec4-bf1b-82b2189f980f\",\r\n \"name\": \"CloudUnPairingHyperVReplica\",\r\n \"startTime\": \"2015-07-28T11:38:00.7533383Z\",\r\n \"endTime\": \"2015-07-28T11:38:00.972046Z\",\r\n \"actions\": [],\r\n \"state\": \"Succeeded\",\r\n \"childJobId\": null\r\n },\r\n {\r\n \"id\": \"9208701f-5eaa-45c9-ad8a-0d8d097264ef\",\r\n \"name\": \"CloudUnPairingHyperVReplicaBlue\",\r\n \"startTime\": \"2015-07-28T11:38:00.9408346Z\",\r\n \"endTime\": \"2015-07-28T11:38:01Z\",\r\n \"actions\": [],\r\n \"state\": \"InProgress\",\r\n \"childJobId\": null\r\n }\r\n ],\r\n \"errors\": [],\r\n \"startTime\": \"2015-07-28T11:38:00.4901505Z\",\r\n \"endTime\": null,\r\n \"allowedActions\": [\r\n \"Cancel\",\r\n \"Restart\"\r\n ],\r\n \"targetObjectId\": \"01709fee-1177-4b82-9d56-cbaf6618070d\",\r\n \"targetObjectType\": \"ProtectionContainer\",\r\n \"targetObjectName\": \"pri\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1123" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "c6c25954-e3a8-4335-ae20-5ac777c06dfb-2015-07-28 11:38:01Z-P 7/28/2015 11:38:02 AM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.0" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "c6c25954-e3a8-4335-ae20-5ac777c06dfb-2015-07-28 11:38:01Z-P" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14983" + ], + "x-ms-correlation-request-id": [ + "7c94b617-69a2-47ec-a4be-b9a35df71ba1" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20150728T113802Z:7c94b617-69a2-47ec-a4be-b9a35df71ba1" + ], + "Date": [ + "Tue, 28 Jul 2015 11:38:02 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "00a07ea0-ad8b-491c-9de8-77bf10881499" + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/packages.config b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/packages.config new file mode 100644 index 000000000000..49f496c9eebd --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/packages.config @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Commands.SiteRecovery.csproj b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Commands.SiteRecovery.csproj new file mode 100644 index 000000000000..1e77ec9fe3f9 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Commands.SiteRecovery.csproj @@ -0,0 +1,188 @@ + + + + + Debug + AnyCPU + {7C879645-31EE-4A78-AD81-5512300FA104} + Library + Properties + Microsoft.Azure.Commands.SiteRecovery + Microsoft.Azure.Commands.SiteRecovery + v4.5 + 512 + ..\..\..\ + true + + + true + full + false + ..\..\..\Package\Debug\ResourceManager\AzureResourceManager\SiteRecovery\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\..\Package\Release\ResourceManager\AzureResourceManager\SiteRecovery\ + TRACE + prompt + 4 + + + + False + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.27-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + ..\..\..\packages\Microsoft.Azure.Management.SiteRecovery.0.1.0-preview\lib\net40\Microsoft.Azure.Management.SiteRecovery.dll + True + + + False + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll + + + False + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll + + + False + ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll + + + False + ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + + + Utilities\Security.Cryptography.dll + + + + + False + ..\..\..\..\..\..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll + + + + + False + ..\..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + + + False + ..\..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Resources.resx + True + True + + + + + + + + + + + + + + + + + + + + + + + + + + + {5ee72c53-1720-4309-b54b-5fb79703195f} + Commands.Common + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + 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/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesClient.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesClient.cs new file mode 100644 index 000000000000..7e89027d2123 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesClient.cs @@ -0,0 +1,352 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Diagnostics.CodeAnalysis; +using System.IO; +using System.Net; +using System.Runtime.Serialization; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Web.Script.Serialization; +using System.Xml; +using Microsoft.Azure.Common.Authentication; +using Microsoft.Azure.Common.Authentication.Models; +using Microsoft.Azure.Management.RecoveryServices; +using Microsoft.Azure.Management.RecoveryServices.Models; +using Microsoft.Azure.Management.SiteRecovery; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using Microsoft.WindowsAzure.Commands.Common; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Recovery services convenience client. + /// + public partial class PSRecoveryServicesClient + { + /// + /// client request id. + /// + public string ClientRequestId { get; set; } + + /// + /// Gets the value of recovery services management client. + /// + public RecoveryServicesManagementClient GetRecoveryServicesClient + { + get + { + return this.recoveryServicesClient; + } + } + + /// Azure profile + /// + public AzureProfile Profile { get; set; } + + /// + /// Amount of time to sleep before fetching job details again. + /// + public const int TimeToSleepBeforeFetchingJobDetailsAgain = 30000; + + /// + /// Resource credentials holds vault, cloud service name, vault key and other details. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1401:FieldsMustBePrivate", + Justification = "For Resource Credentials.")] + public static ASRVaultCreds asrVaultCreds = new ASRVaultCreds(); + + public static string idPrefixtillvaultName = string.Empty; + + /// + /// Recovery Services client. + /// + private RecoveryServicesManagementClient recoveryServicesClient; + + /// + /// Initializes a new instance of the class with + /// required current subscription. + /// + /// Azure Subscription + public PSRecoveryServicesClient(AzureProfile azureProfile, AzureSubscription azureSubscription) + { + this.Profile = azureProfile; + this.recoveryServicesClient = + AzureSession.ClientFactory.CreateClient(azureProfile, azureSubscription, AzureEnvironment.Endpoint.ResourceManager); + } + + /// + /// Validates current in-memory Vault Settings. + /// + /// Resource Name + /// Cloud Service Name + /// Whether Vault settings are valid or not + public bool ValidateVaultSettings( + string resourceName, + string resourceGroupName) + { + if (string.IsNullOrEmpty(resourceName) || string.IsNullOrEmpty(resourceGroupName)) + { + throw new InvalidOperationException(Properties.Resources.MissingVaultSettings); + } + + bool validResourceGroup = false; + bool validResource = false; + + foreach (ResourceGroup resourceGroup in this.GetRecoveryServicesClient.ResourceGroup.List()) + { + if (resourceGroup.Name == resourceGroupName) + { + validResourceGroup = true; + break; + } + } + + if (!validResourceGroup) + { + throw new ArgumentException(Properties.Resources.InvalidResourceGroup); + } + + foreach (Vault vault in GetRecoveryServicesClient.Vaults.Get(resourceGroupName, this.GetRequestHeaders(false))) + { + if (vault.Name == resourceName) + { + validResource = true; + idPrefixtillvaultName = vault.Id; + break; + } + } + + if (!validResource) + { + throw new ArgumentException(Properties.Resources.InvalidResource); + } + + return true; + } + + public static string GetResourceGroup(string resourceId) + { + const string resourceGroup = "resourceGroups"; + + var startIndex = resourceId.IndexOf(resourceGroup, StringComparison.OrdinalIgnoreCase) + resourceGroup.Length + 1; + var endIndex = resourceId.IndexOf("/", startIndex, StringComparison.OrdinalIgnoreCase); + + return resourceId.Substring(startIndex, endIndex - startIndex); + } + + public static string GetSubscriptionId(string resourceId) + { + const string subscriptions = "subscriptions"; + + var startIndex = resourceId.IndexOf(subscriptions, StringComparison.OrdinalIgnoreCase) + subscriptions.Length + 1; + var endIndex = resourceId.IndexOf("/", startIndex, StringComparison.OrdinalIgnoreCase); + + return resourceId.Substring(startIndex, endIndex - startIndex); + } + + public static string GetJobIdFromReponseLocation(string responseLocation) + { + const string operationResults = "operationresults"; + + var startIndex = responseLocation.IndexOf(operationResults, StringComparison.OrdinalIgnoreCase) + operationResults.Length + 1; + var endIndex = responseLocation.IndexOf("?", startIndex, StringComparison.OrdinalIgnoreCase); + + return responseLocation.Substring(startIndex, endIndex - startIndex); + } + + /// + /// Site Recovery requests that go to on-premise components (like the Provider installed + /// in VMM) require an authentication token that is signed with the vault key to indicate + /// that the request indeed originated from the end-user client. + /// Generating that authentication token here and sending it via http headers. + /// + /// Unique identifier for the client's request + /// The authentication token for the provider + public string GenerateAgentAuthenticationHeader(string clientRequestId) + { + CikTokenDetails cikTokenDetails = new CikTokenDetails(); + + DateTime currentDateTime = DateTime.Now; + currentDateTime = currentDateTime.AddHours(-1); + cikTokenDetails.NotBeforeTimestamp = TimeZoneInfo.ConvertTimeToUtc(currentDateTime); + cikTokenDetails.NotAfterTimestamp = cikTokenDetails.NotBeforeTimestamp.AddDays(7); + cikTokenDetails.ClientRequestId = clientRequestId; + cikTokenDetails.Version = new Version(1, 2); + cikTokenDetails.PropertyBag = new Dictionary(); + + string shaInput = new JavaScriptSerializer().Serialize(cikTokenDetails); + + if (null == asrVaultCreds.ChannelIntegrityKey) + { + throw new ArgumentException(Properties.Resources.MissingChannelIntergrityKey); + } + HMACSHA256 sha = new HMACSHA256(Encoding.UTF8.GetBytes(asrVaultCreds.ChannelIntegrityKey)); + cikTokenDetails.Hmac = + Convert.ToBase64String(sha.ComputeHash(Encoding.UTF8.GetBytes(shaInput))); + cikTokenDetails.HashFunction = CikSupportedHashFunctions.HMACSHA256.ToString(); + + return new JavaScriptSerializer().Serialize(cikTokenDetails); + } + + /// + /// Gets request headers. + /// + /// specifies whether to sign the request or not + /// Custom request headers + public CustomRequestHeaders GetRequestHeaders(bool shouldSignRequest = true) + { + this.ClientRequestId = Guid.NewGuid().ToString() + "-" + DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ssZ") + "-P"; + + return new CustomRequestHeaders() + { + // ClientRequestId is a unique ID for every request to Azure Site Recovery. + // It is useful when diagnosing failures in API calls. + ClientRequestId = this.ClientRequestId, + AgentAuthenticationHeader = shouldSignRequest ? this.GenerateAgentAuthenticationHeader(this.ClientRequestId) : "" + }; + } + + /// + /// Gets Site Recovery client. + /// + /// Site Recovery Management client + private SiteRecoveryManagementClient GetSiteRecoveryClient() + { + this.ValidateVaultSettings( + asrVaultCreds.ResourceName, + asrVaultCreds.ResourceGroupName); + + SiteRecoveryManagementClient siteRecoveryClient = + AzureSession.ClientFactory.CreateCustomClient( + asrVaultCreds.ResourceGroupName, + asrVaultCreds.ResourceName, + asrVaultCreds.ResourceGroupName, + recoveryServicesClient.Credentials, + Profile.Context.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager)); + + if (null == siteRecoveryClient) + { + throw new InvalidOperationException(Properties.Resources.NullRecoveryServicesClient); + } + + return siteRecoveryClient; + } + } + + /// + /// Helper around serialization/deserialization of objects. This one is a thin wrapper around + /// DataContractUtils template class which is the one doing the heavy lifting. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all contracts together.")] + public static class DataContractUtils + { + /// + /// Serializes the supplied object to the string. + /// + /// The object type. + /// Object to serialize + /// Serialized string. + public static string Serialize(T obj) + { + return DataContractUtils.Serialize(obj); + } + + /// + /// Deserialize the string to the expected object type. + /// + /// The object type + /// Serialized string + /// Deserialized object + public static void Deserialize(string xmlString, out T result) + { + result = DataContractUtils.Deserialize(xmlString); + } + } + + /// + /// Template class for DataContractUtils. + /// + /// The object type + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all contracts together.")] + public static class DataContractUtils + { + /// + /// Serializes the propertyBagContainer to the string. + /// + /// Property bag + /// Serialized string + public static string Serialize(T propertyBagContainer) + { + var serializer = new DataContractSerializer(typeof(T)); + string xmlString; + StringWriter sw = null; + try + { + sw = new StringWriter(); + using (var writer = new XmlTextWriter(sw)) + { + // Indent the XML so it's human readable. + writer.Formatting = Formatting.Indented; + serializer.WriteObject(writer, propertyBagContainer); + writer.Flush(); + xmlString = sw.ToString(); + } + } + finally + { + if (sw != null) + { + sw.Close(); + } + } + + return xmlString; + } + + /// + /// Deserialize the string to the propertyBagContainer. + /// + /// Serialized string + /// Deserialized object + public static T Deserialize(string xmlString) + { + T propertyBagContainer; + using (Stream stream = new MemoryStream()) + { + byte[] data = System.Text.Encoding.UTF8.GetBytes(xmlString); + stream.Write(data, 0, data.Length); + stream.Position = 0; + DataContractSerializer deserializer = new DataContractSerializer(typeof(T)); + propertyBagContainer = (T)deserializer.ReadObject(stream); + } + + return propertyBagContainer; + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesClientHelper.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesClientHelper.cs new file mode 100644 index 000000000000..d98dd52e13f3 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesClientHelper.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.Collections.Generic; +using Microsoft.Azure.Common.Authentication; +using Microsoft.Azure.Common.Authentication.Models; +using Microsoft.Azure.Management.SiteRecovery; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Microsoft.WindowsAzure.Commands.Common; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Recovery Services Client Helper Methods class + /// + public partial class PSRecoveryServicesClient + { + /// + /// Converts the Parameter set string of Replication Frequency in seconds to UShort. + /// + /// Replication frequency in seconds. + /// A UShort corresponding to the value. + public static ushort ConvertReplicationFrequencyToUshort(string replicationFrequencyString) + { + if (replicationFrequencyString == null) + { + return 0; + } + + ushort replicationFrequency; + + if (!ushort.TryParse(replicationFrequencyString, out replicationFrequency)) + { + throw new InvalidOperationException( + string.Format( + Properties.Resources.InvalidReplicationFrequency, + replicationFrequencyString)); + } + + return replicationFrequency; + } + + /// + /// Validates if the time span object has a valid value. + /// + /// Time span object to be validated + public static void ValidateReplicationStartTime(TimeSpan? timeSpan) + { + if (timeSpan == null) + { + return; + } + + if (TimeSpan.Compare(timeSpan.Value, new TimeSpan(24, 0, 0)) == 1) + { + throw new InvalidOperationException( + string.Format(Properties.Resources.ReplicationStartTimeInvalid)); + } + } + + /// + /// Validates whether the subscription belongs to the currently logged account or not. + /// + /// Azure Subscription ID + public void ValidateSubscriptionAccountAssociation(string azureSubscriptionId) + { + if (string.IsNullOrEmpty(azureSubscriptionId)) + { + throw new InvalidOperationException( + string.Format( + Properties.Resources.SubscriptionIdIsNotValid)); + } + + bool associatedSubscription = false; + List subscriptions = + new List(this.Profile.Subscriptions.Values); + + foreach (AzureSubscription sub in subscriptions) + { + if (azureSubscriptionId.Equals(sub.Id.ToString(), StringComparison.OrdinalIgnoreCase)) + { + associatedSubscription = true; + break; + } + } + + if (!associatedSubscription) + { + throw new InvalidOperationException( + string.Format( + Properties.Resources.SubscriptionIsNotAssociatedWithTheAccount, + azureSubscriptionId)); + } + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesCloudServiceClient.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesCloudServiceClient.cs new file mode 100644 index 000000000000..bc60bc945aef --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesCloudServiceClient.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.Collections.Generic; +//// using Microsoft.Azure.Commands.RecoveryServices.SiteRecovery; +//using Microsoft.WindowsAzure.Management.RecoveryServices; +//using Microsoft.WindowsAzure.Management.RecoveryServices.Models; +//using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +//namespace Microsoft.Azure.Commands.RecoveryServices +//{ +// /// +// /// Recovery services convenience client. +// /// +// public partial class PSRecoveryServicesClient +// { +// /// +// /// Method to retrieve cloud services list for the current subscription +// /// +// /// list of cloud services. +// public IEnumerable GetCloudServices() +// { +// CloudServiceListResponse response = this.GetRecoveryServicesClient.CloudServices.List(); + +// return response.CloudServices; +// } + +// /// +// /// Method to get Cloud Service object for a given vault +// /// +// /// vault object +// /// cloud service object. +// public CloudService GetCloudServiceForVault(ASRVault vault) +// { +// IEnumerable cloudServiceList = this.GetCloudServices(); + +// foreach (var cloudService in cloudServiceList) +// { +// Vault selectedVault = null; +// if (cloudService.GeoRegion.Equals(vault.Location, StringComparison.InvariantCultureIgnoreCase)) +// { +// foreach (var resource in cloudService.Resources) +// { +// if (resource.Name.Equals(vault.Name, StringComparison.InvariantCultureIgnoreCase)) +// { +// selectedVault = resource; +// return cloudService; +// } +// } +// } +// } + +// throw new ArgumentException( +// string.Format( +// Properties.Resources.InCorrectVaultInformation, +// vault.Name, +// vault.Location)); +// } + +// /// +// /// Method to Either find or create the cloud service. +// /// +// /// name of the cloud service to be created +// /// cloud service input to create the service. +// public void FindOrCreateCloudService(string cloudServiceName, CloudServiceCreateArgs cloudServiceInput) +// { +// bool cloudServicePresent = this.DoesCloudServiceExits(cloudServiceName); + +// if (!cloudServicePresent) +// { +// this.GetRecoveryServicesClient.CloudServices.Create(cloudServiceName, cloudServiceInput); +// } +// } + +// /// +// /// Checks whether a cloud service is present or not. +// /// +// /// name of the cloud service to be created +// /// returns true in case the cloud service exits and false otherwise. +// private bool DoesCloudServiceExits(string cloudServiceName) +// { +// IEnumerable cloudServiceList = this.GetCloudServices(); +// bool cloudServicePresent = false; + +// foreach (var cloudService in cloudServiceList) +// { +// if (cloudServiceName.Equals(cloudService.Name, StringComparison.InvariantCultureIgnoreCase)) +// { +// cloudServicePresent = true; +// break; +// } +// } + +// return cloudServicePresent; +// } +// } +//} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesJobsClient.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesJobsClient.cs new file mode 100644 index 000000000000..1bbda2c115eb --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesJobsClient.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.Azure.Management.SiteRecovery; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Recovery services convenience client. + /// + public partial class PSRecoveryServicesClient + { + /// + /// Gets Azure Site Recovery Job details. + /// + /// Job ID + /// Job response + public JobResponse GetAzureSiteRecoveryJobDetails(string jobId) + { + return this.GetSiteRecoveryClient().Jobs.Get(jobId, this.GetRequestHeaders()); + } + + /// + /// Get Azure Site Recovery Job. + /// + /// Job query parameter. + /// Job list response + public JobListResponse GetAzureSiteRecoveryJob(JobQueryParameter jqp) + { + return this.GetSiteRecoveryClient().Jobs.List(jqp, this.GetRequestHeaders()); + } + + /// + /// Resumes Azure Site Recovery Job. + /// + /// Job ID + /// Resume Job parameters + /// Long running operation response + public LongRunningOperationResponse ResumeAzureSiteRecoveryJob( + string jobId, + ResumeJobParams resumeJobParams) + { + return this.GetSiteRecoveryClient().Jobs.BeginResuming(jobId, resumeJobParams, this.GetRequestHeaders()); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesProtectionContainerClient.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesProtectionContainerClient.cs new file mode 100644 index 000000000000..c81e5f9c8f0b --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesProtectionContainerClient.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Azure.Management.SiteRecovery; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Recovery services convenience client. + /// + public partial class PSRecoveryServicesClient + { + /// + /// Gets Azure Site Recovery Protection Container. + /// + /// Protection Container list response + public ProtectionContainerListResponse GetAzureSiteRecoveryProtectionContainer() + { + return this.GetSiteRecoveryClient().ProtectionContainer.List(this.GetRequestHeaders()); + } + + /// + /// Gets Azure Site Recovery Protection Container. + /// + /// Protection Container ID + /// Protection Container response + public ProtectionContainerResponse GetAzureSiteRecoveryProtectionContainer( + string protectionContainerId) + { + return this.GetSiteRecoveryClient().ProtectionContainer.Get(protectionContainerId, this.GetRequestHeaders()); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesProtectionEntityClient.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesProtectionEntityClient.cs new file mode 100644 index 000000000000..4e85e0e27fb3 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesProtectionEntityClient.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 Microsoft.Azure.Management.SiteRecovery; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Recovery services convenience client. + /// + public partial class PSRecoveryServicesClient + { + /// + /// Retrieves Protection Entity. + /// + /// Protection Container ID + /// Protection entity list response + public ProtectionEntityListResponse GetAzureSiteRecoveryProtectionEntity( + string protectionContainerId) + { + return + this + .GetSiteRecoveryClient() + .ProtectionEntity + .List(protectionContainerId, this.GetRequestHeaders()); + } + + /// + /// Retrieves Protection Entity. + /// + /// Protection Container ID + /// Virtual Machine ID + /// Protection entity response + public ProtectionEntityResponse GetAzureSiteRecoveryProtectionEntity( + string protectionContainerId, + string virtualMachineId) + { + return + this + .GetSiteRecoveryClient() + .ProtectionEntity + .Get(protectionContainerId, virtualMachineId, this.GetRequestHeaders()); + } + + /// + /// Sets protection on Protection entity. + /// + /// Protection Container ID + /// Virtual Machine ID or Replication group Id + /// Enable protection input. + /// Job response + public LongRunningOperationResponse EnableProtection( + string protectionContainerId, + string protectionEntityId, + EnableProtectionInput input) + { + return this.GetSiteRecoveryClient().ProtectionEntity.EnableProtection( + protectionContainerId, + protectionEntityId, + input, + this.GetRequestHeaders()); + } + + /// + /// Sets protection on Protection entity. + /// + /// Protection Container ID + /// Virtual Machine ID or Replication group Id + /// Disable protection input. + /// Job response + public LongRunningOperationResponse DisableProtection( + string protectionContainerId, + string protectionEntityId, + DisableProtectionInput input) + { + return this.GetSiteRecoveryClient().ProtectionEntity.DisableProtection( + protectionContainerId, + protectionEntityId, + input, + this.GetRequestHeaders()); + } + + /// + /// Starts Azure Site Recovery Planned failover. + /// + /// Protection Container ID + /// Protection entity ID + /// Planned failover request + /// Job response + public LongRunningOperationResponse StartAzureSiteRecoveryPlannedFailover( + string protectionContainerId, + string protectionEntityId, + PlannedFailoverRequest plannedFailoverRequest) + { + return this.GetSiteRecoveryClient().ProtectionEntity.BeginPlannedFailover( + protectionContainerId, + protectionEntityId, + plannedFailoverRequest, + this.GetRequestHeaders()); + } + + /// + /// Starts Azure Site Recovery Unplanned failover. + /// + /// Protection Container ID + /// Protection entity ID + /// Unplanned failover request + /// Job response + public LongRunningOperationResponse StartAzureSiteRecoveryUnplannedFailover( + string protectionContainerId, + string protectionEntityId, + UnplannedFailoverRequest unplannedFailoverRequest) + { + return this.GetSiteRecoveryClient().ProtectionEntity.BeginUnplannedFailover( + protectionContainerId, + protectionEntityId, + unplannedFailoverRequest, + this.GetRequestHeaders()); + } + + /// + /// Starts Azure Site Recovery Unplanned failover. + /// + /// Protection Container ID + /// Protection entity ID + /// Test failover request + /// Job response + public LongRunningOperationResponse StartAzureSiteRecoveryTestFailover( + string protectionContainerId, + string protectionEntityId, + TestFailoverRequest testFailoverRequest) + { + return this.GetSiteRecoveryClient().ProtectionEntity.BeginTestFailover( + protectionContainerId, + protectionEntityId, + testFailoverRequest, + this.GetRequestHeaders()); + } + + /// + /// Starts Azure Site Recovery Commit failover. + /// + /// Protection Container ID + /// Recovery Plan ID + /// Commit failover request. + /// Job response + public LongRunningOperationResponse StartAzureSiteRecoveryCommitFailover( + string protectionContainerId, + string protectionEntityId, + CommitFailoverRequest request) + { + return this.GetSiteRecoveryClient().ProtectionEntity.BeginCommitFailover( + protectionContainerId, + protectionEntityId, + request, + this.GetRequestHeaders()); + } + + /// + /// Re-protects the Azure Site Recovery protection entity. + /// + /// Protection Container ID + /// Recovery Plan ID + /// Re-protect request. + /// Job response + public LongRunningOperationResponse StartAzureSiteRecoveryReprotection( + string protectionContainerId, + string protectionEntityId, + ReprotectRequest request) + { + return this.GetSiteRecoveryClient().ProtectionEntity.BeginReprotect( + protectionContainerId, + protectionEntityId, + request, + this.GetRequestHeaders()); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesProtectionProfileClient.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesProtectionProfileClient.cs new file mode 100644 index 000000000000..5b4e1b517437 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesProtectionProfileClient.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 Microsoft.Azure.Management.SiteRecovery; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Recovery services convenience client. + /// + public partial class PSRecoveryServicesClient + { + /// + /// Gets Azure Site Recovery Protection Profile. + /// + /// Protection Profile list response + public ProtectionProfileListResponse GetAzureSiteRecoveryProtectionProfile() + { + return this.GetSiteRecoveryClient().ProtectionProfile.List(this.GetRequestHeaders()); + } + + /// + /// Gets Azure Site Recovery Protection Profile given the ID. + /// + /// Protection Profile ID + /// Protection Profile response + public ProtectionProfileResponse GetAzureSiteRecoveryProtectionProfile( + string protectionProfileId) + { + return this.GetSiteRecoveryClient().ProtectionProfile.Get( + protectionProfileId, + this.GetRequestHeaders()); + } + + /// + /// Creates Azure Site Recovery Protection Profile. + /// + /// Protection Profile Input + /// Long operation response + public LongRunningOperationResponse CreateProtectionProfile( + CreateProtectionProfileInput createProtectionProfileInput) + { + return this.GetSiteRecoveryClient().ProtectionProfile.BeginCreating( + createProtectionProfileInput, + this.GetRequestHeaders()); + } + + /// + /// Deletes Azure Site Recovery Protection Profile. + /// + /// Protection Profile Input + /// Long operation response + public LongRunningOperationResponse DeleteProtectionProfile(string profile) + { + return this.GetSiteRecoveryClient().ProtectionProfile.BeginDeleting( + profile, + this.GetRequestHeaders()); + } + + /// + /// Associates Azure Site Recovery Protection Profile. + /// + /// Protection Profile association input + /// Long running operation response + public LongRunningOperationResponse AssociateAzureSiteRecoveryProtectionProfile( + string profileName, + ProtectionProfileAssociationInput protectionProfileAssociationInput) + { + return this.GetSiteRecoveryClient().ProtectionProfile.BeginAssociating( + profileName, + protectionProfileAssociationInput, + this.GetRequestHeaders()); + } + + /// + /// Dissociates Azure Site Recovery Protection Profile. + /// + /// Protection Profile ID + /// Protection Profile disassociation Input + /// Long running operation response + public LongRunningOperationResponse DissociateAzureSiteRecoveryProtectionProfile( + string protectionProfileId, + DisassociateProtectionProfileInput disassociateProtectionProfileInput) + { + return this.GetSiteRecoveryClient().ProtectionProfile.BeginDissociating( + protectionProfileId, + disassociateProtectionProfileInput, + this.GetRequestHeaders()); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesServerClient.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesServerClient.cs new file mode 100644 index 000000000000..b496ad737d67 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesServerClient.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Azure.Management.SiteRecovery; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Recovery services convenience client. + /// + public partial class PSRecoveryServicesClient + { + /// + /// Gets Azure Site Recovery Servers. + /// + /// Boolean indicating if the request should be signed ACIK + /// Server list response + public ServerListResponse GetAzureSiteRecoveryServer(bool shouldSignRequest = true) + { + return this.GetSiteRecoveryClient().Servers.List(this.GetRequestHeaders(shouldSignRequest)); + } + + /// + /// Gets Azure Site Recovery Server. + /// + /// Server ID + /// Server response + public ServerResponse GetAzureSiteRecoveryServer(string serverId) + { + return this.GetSiteRecoveryClient().Servers.Get(serverId, this.GetRequestHeaders()); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesVaultClient.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesVaultClient.cs new file mode 100644 index 000000000000..42a240baad5a --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesVaultClient.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.Threading.Tasks; +using Microsoft.Azure.Management.RecoveryServices; +using Microsoft.Azure.Management.RecoveryServices.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Recovery services convenience client. + /// + public partial class PSRecoveryServicesClient + { + /// + /// Method to list Azure Site Recovery Vaults + /// + /// name of the resouce group + /// vault list response object. + public VaultListResponse GetVaultsInResouceGroup(string resouceGroupName) + { + return this.GetRecoveryServicesClient.Vaults.Get(resouceGroupName, this.GetRequestHeaders(false)); + } + + /// + /// Method to create Azure Site Recovery Vault + /// + /// name of the resouce group + /// name of the vault + /// vault creation input object + /// creation response object. + public VaultCreateResponse CreateVault(string resouceGroupName, string vaultName, VaultCreateArgs vaultCreateInput) + { + return this.recoveryServicesClient.Vaults.BeginCreating(resouceGroupName, vaultName, vaultCreateInput); + } + + /// + /// Method to list Azure resouce groups + /// + /// resource group list response object. + public ResourceGroupListResponse GetResouceGroups() + { + return this.GetRecoveryServicesClient.ResourceGroup.List(); + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesVaultExtendedInfoClient.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesVaultExtendedInfoClient.cs new file mode 100644 index 000000000000..ab00468e5236 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/PSRecoveryServicesVaultExtendedInfoClient.cs @@ -0,0 +1,265 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Security.Cryptography.X509Certificates; +using System.Threading.Tasks; +using System.Web.Script.Serialization; +using Hyak.Common; +using Microsoft.Azure.Commands.SiteRecovery.Properties; +using Microsoft.Azure.Management.RecoveryServices; +using Microsoft.Azure.Management.RecoveryServices.Models; +using Microsoft.Azure.Management.SiteRecovery; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Microsoft.Azure.Portal.HybridServicesCore; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using rpError = Microsoft.Azure.Commands.SiteRecovery.RestApiInfra; + + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Recovery services convenience client. + /// + public partial class PSRecoveryServicesClient + { + /// + /// Gets Vault Extended Information + /// + /// Vault Extended Information Response + public async Task GetExtendedInfo() + { + ResourceExtendedInformationResponse response = + await this.recoveryServicesClient.VaultExtendedInfo.GetExtendedInfoAsync( + asrVaultCreds.ResourceGroupName, + asrVaultCreds.ResourceName, + this.GetRequestHeaders(false)); + + return response.ResourceExtendedInformation; + } + + /// + /// Creates the extended information for the vault + /// + /// extended info to be created + /// Vault Extended Information + public AzureOperationResponse CreateExtendedInfo(ResourceExtendedInformationArgs extendedInfoArgs) + { + return this.recoveryServicesClient.VaultExtendedInfo.CreateExtendedInfo( + asrVaultCreds.ResourceGroupName, + asrVaultCreds.ResourceName, + extendedInfoArgs, + this.GetRequestHeaders(false)); + } + + /// + /// Updates the vault certificate + /// + /// the certificate update arguments + /// Upload Certificate Response + public async Task UpdateVaultCertificate(CertificateArgs args, string certFriendlyName) + { + return await this.recoveryServicesClient.VaultExtendedInfo.UploadCertificateAsync( + asrVaultCreds.ResourceGroupName, + asrVaultCreds.ResourceName, + args, certFriendlyName, + this.GetRequestHeaders(false)); + } + + /// + /// Gets the vault credential object + /// + /// certificate to be uploaded + /// vault object + /// credential object + public ASRVaultCreds GenerateVaultCredential(X509Certificate2 managementCert, ASRVault vault) + { + string currentResourceName = PSRecoveryServicesClient.asrVaultCreds.ResourceName; + string currentResourceGroupName = PSRecoveryServicesClient.asrVaultCreds.ResourceGroupName; + + // Update vault settings with the working vault to generate file + Utilities.UpdateVaultSettings(new ASRVaultCreds() + { + ResourceGroupName = vault.ResouceGroupName, + ResourceName = vault.Name + }); + + // Get Channel Integrity key + string channelIntegrityKey; + Task getChannelIntegrityKey = this.GetChannelIntegrityKey(); + + // Making sure we can generate the file, once the SDK and portal are inter-operable + // upload certificate and fetch of ACIK can be made parallel to improvve the performace. + getChannelIntegrityKey.Wait(); + + // Upload certificate + UploadCertificateResponse acsDetails; + Task uploadCertificate = this.UpdateVaultCertificate(managementCert); + uploadCertificate.Wait(); + + acsDetails = uploadCertificate.Result; + channelIntegrityKey = getChannelIntegrityKey.Result; + + ASRVaultCreds asrVaultCreds = this.GenerateCredentialObject( + managementCert, + acsDetails, + channelIntegrityKey, + vault); + + // Update back the original vault settings + Utilities.UpdateVaultSettings(new ASRVaultCreds() + { + ResourceGroupName = currentResourceGroupName, + ResourceName = currentResourceName + }); + + return asrVaultCreds; + } + + /// + /// Changes the Vault context + /// + /// vault object + /// credential object + public ASRVaultCreds ChangeVaultContext(ASRVault vault) + { + // Update vault settings + Utilities.UpdateVaultSettings(new ASRVaultCreds() + { + ResourceGroupName = vault.ResouceGroupName, + ResourceName = vault.Name + }); + + // Get Channel Integrity key + Task getChannelIntegrityKey = this.GetChannelIntegrityKey(); + getChannelIntegrityKey.Wait(); + + + // Update vault settings along with Channel integrity key + Utilities.UpdateVaultSettings(new ASRVaultCreds() + { + ResourceGroupName = vault.ResouceGroupName, + ResourceName = vault.Name, + ChannelIntegrityKey = getChannelIntegrityKey.Result + }); + + return asrVaultCreds; + } + + /// + /// Method to update vault certificate + /// + /// certificate object + /// Upload Certificate Response + private async Task UpdateVaultCertificate(X509Certificate2 cert) + { + var certificateArgs = new CertificateArgs(); + certificateArgs.Properties = new Dictionary(); + certificateArgs.Properties.Add("certificate", Convert.ToBase64String(cert.GetRawCertData())); + // CertificateArgs.Properties.Add("ContractVersion", "V2012_12"); + + UploadCertificateResponse response = await this.UpdateVaultCertificate(certificateArgs, cert.FriendlyName); + + return response; + } + + /// + /// Get the Integrity key + /// + /// key as string. + private async Task GetChannelIntegrityKey() + { + ResourceExtendedInformation extendedInformation = null; + try + { + extendedInformation = await this.GetExtendedInfo(); + } + catch (Exception exception) + { + CloudException cloudException = exception as CloudException; + + if (cloudException != null && cloudException.Response != null && !string.IsNullOrEmpty(cloudException.Response.Content)) + { + JavaScriptSerializer serializer = new JavaScriptSerializer(); + rpError.Error error = serializer.Deserialize(cloudException.Response.Content); + + // rpError.Error error = (rpError.Error)Utilities.Deserialize(cloudException.Response.Content); + if (error.ErrorCode.Equals(RpErrorCode.ResourceExtendedInfoNotFound.ToString(), StringComparison.InvariantCultureIgnoreCase)) + { + extendedInformation = new ResourceExtendedInformation(); + } + } + } + + ResourceExtendedInfo extendedInfo = Utilities.Deserialize(extendedInformation.ExtendedInfo); + + if (extendedInfo == null) + { + extendedInfo = this.CreateVaultExtendedInformation(); + } + else + { + if (!extendedInfo.Algorithm.Equals(CryptoAlgorithm.None.ToString(), StringComparison.InvariantCultureIgnoreCase)) + { + // In case this condition is true that means the credential was first generated in portal + // and hence can not be fetched here. + throw new CloudException(Resources.VaultSettingsGenerationUnSupported); + } + } + + return extendedInfo.ChannelIntegrityKey; + } + + /// + /// Method to create the extended info for the vault. + /// + /// returns the object as task + private ResourceExtendedInfo CreateVaultExtendedInformation() + { + ResourceExtendedInfo extendedInfo = new ResourceExtendedInfo(); + extendedInfo.GenerateSecurityInfo(); + ResourceExtendedInformationArgs extendedInfoArgs = extendedInfo.Translate(); + this.CreateExtendedInfo(extendedInfoArgs); + + return extendedInfo; + } + + /// + /// Method to generate the credential file content + /// + /// management cert + /// ACS details + /// Integrity key + /// vault object + /// site object + /// vault credential object + private ASRVaultCreds GenerateCredentialObject(X509Certificate2 managementCert, UploadCertificateResponse acsDetails, string channelIntegrityKey, ASRVault vault) + { + string serializedCertifivate = Convert.ToBase64String(managementCert.Export(X509ContentType.Pfx)); + + AcsNamespace acsNamespace = new AcsNamespace(acsDetails); + + ASRVaultCreds vaultCreds = new ASRVaultCreds( + vault.SubscriptionId, + vault.Name, + serializedCertifivate, + acsNamespace, + channelIntegrityKey, + vault.ResouceGroupName); + + return vaultCreds; + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/SiteRecoveryCmdletBase.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/SiteRecoveryCmdletBase.cs new file mode 100644 index 000000000000..3b643dec2116 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Common/SiteRecoveryCmdletBase.cs @@ -0,0 +1,192 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Runtime.Serialization; +using System.Threading; +using System.Xml; +using Hyak.Common; +using Microsoft.Azure.Management.RecoveryServices; +using Microsoft.Azure.Management.RecoveryServices.Models; +using Microsoft.Azure.Management.SiteRecovery; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// The base class for all Windows Azure Recovery Services commands + /// + public abstract class SiteRecoveryCmdletBase : AzurePSCmdlet + { + /// + /// Recovery Services client. + /// + private PSRecoveryServicesClient recoveryServicesClient; + + /// + /// Gets or sets a value indicating whether stop processing has been triggered. + /// + internal bool StopProcessingFlag { get; set; } + + /// + /// Gets Recovery Services client. + /// + internal PSRecoveryServicesClient RecoveryServicesClient + { + get + { + if (this.recoveryServicesClient == null) + { + this.recoveryServicesClient = new PSRecoveryServicesClient(Profile, Profile.Context.Subscription); + } + + return this.recoveryServicesClient; + } + } + + /// + /// Exception handler. + /// + /// Exception to handle. + public void HandleException(Exception ex) + { + string clientRequestIdMsg = string.Empty; + if (this.recoveryServicesClient != null) + { + clientRequestIdMsg = "ClientRequestId: " + this.recoveryServicesClient.ClientRequestId + "\n"; + } + + CloudException cloudException = ex as CloudException; + if (cloudException != null) + { + Error error = null; + try + { + using (Stream stream = new MemoryStream()) + { + if (cloudException.Message != null) + { + byte[] data = System.Text.Encoding.UTF8.GetBytes(cloudException.Message); + stream.Write(data, 0, data.Length); + stream.Position = 0; + + var deserializer = new DataContractSerializer(typeof(ErrorInException)); + error = (Error)deserializer.ReadObject(stream); + + throw new InvalidOperationException( + string.Format( + Properties.Resources.CloudExceptionDetails, + error.Message, + error.PossibleCauses, + error.RecommendedAction, + error.ClientRequestId)); + } + else + { + throw new Exception( + string.Format( + Properties.Resources.InvalidCloudExceptionErrorMessage, + clientRequestIdMsg + ex.Message), + ex); + } + } + } + catch (XmlException) + { + throw new XmlException( + string.Format( + Properties.Resources.InvalidCloudExceptionErrorMessage, + cloudException.Message), + cloudException); + } + catch (SerializationException) + { + throw new SerializationException( + string.Format( + Properties.Resources.InvalidCloudExceptionErrorMessage, + clientRequestIdMsg + cloudException.Message), + cloudException); + } + } + else if (ex.Message != null) + { + throw new Exception( + string.Format( + Properties.Resources.InvalidCloudExceptionErrorMessage, + clientRequestIdMsg + ex.Message), + ex); + } + } + + /// + /// Waits for the job to complete. + /// + /// Id of the job to wait for. + public void WaitForJobCompletion(string jobId) + { + JobResponse jobResponse = null; + do + { + Thread.Sleep(PSRecoveryServicesClient.TimeToSleepBeforeFetchingJobDetailsAgain); + jobResponse = this.RecoveryServicesClient.GetAzureSiteRecoveryJobDetails(jobId); + this.WriteProgress( + new System.Management.Automation.ProgressRecord( + 0, + Properties.Resources.WaitingForCompletion, + jobResponse.Job.Properties.State)); + } + while (!(jobResponse.Job.Properties.State == JobStatus.Cancelled || + jobResponse.Job.Properties.State == JobStatus.Failed || + jobResponse.Job.Properties.State == JobStatus.Suspended || + jobResponse.Job.Properties.State == JobStatus.Succeeded || + this.StopProcessingFlag)); + } + + /// + /// Handles interrupts. + /// + protected override void StopProcessing() + { + // Ctrl + C and etc + base.StopProcessing(); + this.StopProcessingFlag = true; + } + + /// + /// Validates if the usage by ID is allowed or not. + /// + /// Replication provider. + /// Parameter name. + protected void ValidateUsageById(string replicationProvider, string paramName) + { + if (replicationProvider != Constants.HyperVReplica) + { + throw new Exception( + string.Format( + "Call using ID based parameter {0} is not supported for this provider. Please use its corresponding full object parameter instead", + paramName)); + } + else + { + this.WriteWarningWithTimestamp( + string.Format( + Properties.Resources.IDBasedParamUsageNotSupportedFromNextRelease, + paramName)); + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Job/GetAzureSiteRecoveryJob.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Job/GetAzureSiteRecoveryJob.cs new file mode 100644 index 000000000000..a6e69df60b70 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Job/GetAzureSiteRecoveryJob.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.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Retrieves Azure site Recovery Job. + /// + [Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryJob", DefaultParameterSetName = ASRParameterSets.ByParam)] + [OutputType(typeof(IEnumerable))] + public class GetAzureSiteRecoveryJob : SiteRecoveryCmdletBase + { + #region Parameters + /// + /// Gets or sets Job Name. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + /// + /// Gets or sets Job Object. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByObject, Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRJob Job { get; set; } + + ///// + ///// Gets or sets start time. Allows to filter the list of jobs started after the given + ///// start time. + ///// + //[Parameter(ParameterSetName = ASRParameterSets.ByParam, HelpMessage = "Represents start time of jobs to querying, jobs with the start time later than this will be returned")] + //[ValidateNotNullOrEmpty] + //public DateTime? StartTime { get; set; } + + ///// + ///// Gets or sets end time. Allows to filter the list of jobs ended before it. + ///// + //[Parameter(ParameterSetName = ASRParameterSets.ByParam, HelpMessage = "Represents end time of jobs to query.")] + //[ValidateNotNullOrEmpty] + //public DateTime? EndTime { get; set; } + + ///// + ///// Gets or sets target object id. + ///// + //[Parameter(ParameterSetName = ASRParameterSets.ByParam, HelpMessage = "ID of the object on which Job was targeted to.")] + //[ValidateNotNullOrEmpty] + //public string TargetObjectId { get; set; } + + ///// + ///// Gets or sets state. Take string input for possible States of ASR Job. Use this parameter + ///// to get filtered view of Jobs + ///// + ///// Considered Valid states from WorkflowStatus enum in SRS (WorkflowData.cs) + //[Parameter(ParameterSetName = ASRParameterSets.ByParam, HelpMessage = "State of job to return.")] + //[ValidateNotNullOrEmpty] + //[ValidateSet( + // "NotStarted", + // "InProgress", + // "Succeeded", + // "Other", + // "Failed", + // "Cancelled", + // "Suspended")] + //public string State { get; set; } + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByObject: + this.Name = this.Job.Name; + this.GetByName(); + break; + + case ASRParameterSets.ByName: + this.GetByName(); + break; + + case ASRParameterSets.ByParam: + default: + this.GetByParam(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Queries by Name. + /// + private void GetByName() + { + this.WriteJob(RecoveryServicesClient.GetAzureSiteRecoveryJobDetails(this.Name).Job); + } + + /// + /// Queries by Parameters. + /// + private void GetByParam() + { + JobQueryParameter jqp = new JobQueryParameter(); + + //if (this.StartTime.HasValue) + //{ + // jqp.StartTime = + // this.StartTime.Value.ToUniversalTime().ToBinary().ToString(); + //} + + //if (this.EndTime.HasValue) + //{ + // jqp.EndTime = + // this.EndTime.Value.ToUniversalTime().ToBinary().ToString(); + //} + + //jqp.State = this.State; + //jqp.ObjectId = this.TargetObjectId; + + this.WriteJobs(RecoveryServicesClient.GetAzureSiteRecoveryJob(jqp).Jobs); + } + + /// + /// Writes Job. + /// + /// JOB object + private void WriteJob(Microsoft.Azure.Management.SiteRecovery.Models.Job job) + { + this.WriteObject(new ASRJob(job)); + } + + /// + /// Writes Jobs. + /// + /// Job objects + private void WriteJobs(IList jobs) + { + this.WriteObject(jobs.Select(j => new ASRJob(j)), true); + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Job/ResumeAzureSiteRecoveryJob.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Job/ResumeAzureSiteRecoveryJob.cs new file mode 100644 index 000000000000..c7e4e59a973a --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Job/ResumeAzureSiteRecoveryJob.cs @@ -0,0 +1,98 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Resumes Azure Site Recovery Job. + /// + [Cmdlet(VerbsLifecycle.Resume, "AzureSiteRecoveryJob", DefaultParameterSetName = ASRParameterSets.ByObject)] + [OutputType(typeof(ASRJob))] + public class ResumeAzureSiteRecoveryJob : SiteRecoveryCmdletBase + { + #region Parameters + /// + /// Gets or sets Job ID. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + /// + /// Gets or sets Job Object. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByObject, Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRJob Job { get; set; } + + /// + /// Gets or sets job comments. + /// + [Parameter(Mandatory = false)] + [ValidateNotNullOrEmpty] + public string Comments { get; set; } + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByObject: + this.Name = this.Job.Name; + this.ResumesByName(); + break; + + case ASRParameterSets.ByName: + this.ResumesByName(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Resumes by Name. + /// + private void ResumesByName() + { + ResumeJobParams resumeJobParams = new ResumeJobParams(); + if (string.IsNullOrEmpty(this.Comments)) + { + this.Comments = " "; + } + + resumeJobParams.Comments = this.Comments; + + LongRunningOperationResponse response = RecoveryServicesClient.ResumeAzureSiteRecoveryJob(this.Name, resumeJobParams); + + JobResponse jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + WriteObject(new ASRJob(jobResponse.Job)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Microsoft.Azure.Commands.SiteRecovery.dll-help.xml b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Microsoft.Azure.Commands.SiteRecovery.dll-help.xml new file mode 100644 index 000000000000..aa1b198ba801 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Microsoft.Azure.Commands.SiteRecovery.dll-help.xml @@ -0,0 +1,198 @@ + + + + + + + + Get-AzureSiteRecoveryServer + + + Get information about Azure Site Recovery Server for current Azure Site Recovery vault + + + + + Get + AzureSiteRecoveryServer + + + + Get information about Azure Site Recovery server for current Azure Site Recovery vault + + + + + Get-AzureSiteRecoveryServer + + Name + + Name of the Server + + string + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + Get-AzureSiteRecoveryServer + + FriendlyName + + FriendlyName of the Server + + string + + + Profile + + Non-mandatory AzureProfile input object + + AzureProfile + + + + + + + FriendlyName + + FriendlyName of the Server + + + string + + string + + + + + + Name + + Name of the Server + + + string + + string + + + + + + Profile + + Non-mandatory AzureProfile input object + + + AzureProfile + + AzureProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + + + PS C:\> + + + Get-AzureSiteRecoveryServer + +FriendlyName : sriramvu-hv2.fareast.corp.microsoft.com +Name : 57f95c35-6c83-42ce-bb21-2c4f10f92d8e +ID : /Subscriptions/00a07ea0-ad8b-491c-9de8-77bf10881499/resourceGroups/testsitegroup/providers/Microsoft. +SiteRecovery/SiteRecoveryVault/ppeVault2/Servers/57f95c35-6c83-42ce-bb21-2c4f10f92d8e +Type : Microsoft.SiteRecovery/Servers +FabricType : VMM +FabricObjectID : 57f95c35-6c83-42ce-bb21-2c4f10f92d8e +LastHeartbeat : 29-07-2015 10:52:09 +ProviderVersion : 3.5.601.0 +ServerVersion : 3.2.7510.0 + + + + Description + ----------- + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Models/PSContracts.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Models/PSContracts.cs new file mode 100644 index 000000000000..71329d1370df --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Models/PSContracts.cs @@ -0,0 +1,894 @@ +//// ---------------------------------------------------------------------------------- +//// +//// 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.Diagnostics.CodeAnalysis; +using System.Runtime.Serialization; +using System.Text; +using Microsoft.Azure.Commands.SiteRecovery; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Hash functions which can be used to calculate CIK HMAC. + /// + public enum CikSupportedHashFunctions + { + /// + /// Represents a HMACSHA256 hash function. + /// + HMACSHA256, + + /// + /// Represents a HMACSHA384 hash function. + /// + HMACSHA384, + + /// + /// Represents a HMACSHA512 hash function. + /// + HMACSHA512 + } + + /// + /// The types of crypto algorithms + /// + public enum CryptoAlgorithm + { + /// + /// The asymmetric key based RSA 2048 algorithm. + /// + RSAPKCS1V17, + + /// + /// The asymmetric key based RSA 2048 algorithm. + /// + RSAPKCS1V15, + + /// + /// The symmetric key based AES algorithm with key size 256 bits. + /// + AES256, + + /// + /// The symmetric key based SHA 256 Algorithm + /// + HMACSHA256, + + /// + /// When no algorithm is used. + /// + None + } + + /// + /// The RP service error code that needs to be handled by portal. + /// + public enum RpErrorCode + { + /// + /// The error code sent by RP if the Resource extended info doesn't exists. + /// + ResourceExtendedInfoNotFound + } + + /// + /// Error contract returned when some exception occurs in ASR REST API. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all contracts together.")] + [DataContract] + public class ErrorInException : Error + { + } + + /// + /// Error contract returned when some exception occurs in ASR REST API. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all contracts together.")] + [DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")] + public class Error + { + /// + /// Initializes a new instance of the class. + /// + public Error() + { + } + + /// + /// Initializes a new instance of the class with required parameters. + /// + /// Service Error + public Error(ServiceError se) + { + this.ClientRequestId = se.ActivityId; + this.Code = se.Code; + this.Message = se.Message; + this.PossibleCauses = se.PossibleCauses; + this.RecommendedAction = se.RecommendedAction; + } + + /// + /// Initializes a new instance of the class. + /// + /// Service generated error code. + /// Error message. + /// Possible causes of the error. + /// Recommended action to resolve the error. + /// ActivityId in which error occurred. + public Error( + string errorCode, + string message, + string possibleCauses, + string recommendedAction, + string activityId) + { + this.Code = errorCode; + this.Message = message; + this.PossibleCauses = possibleCauses; + this.RecommendedAction = recommendedAction; + this.ClientRequestId = activityId; + } + + /// + /// Gets or sets error code. + /// + [DataMember] + public string Code { get; set; } + + /// + /// Gets or sets error message. + /// + [DataMember] + public string Message { get; set; } + + /// + /// Gets or sets possible causes of error. + /// + [DataMember] + public string PossibleCauses { get; set; } + + /// + /// Gets or sets recommended action to resolve error. + /// + [DataMember] + public string RecommendedAction { get; set; } + + /// + /// Gets or sets client request Id. + /// + [DataMember(Name = "ActivityId")] + public string ClientRequestId { get; set; } + } + + /// + /// CIK token details. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all contracts together.")] + [DataContract] + public class CikTokenDetails + { + /// + /// Gets or sets the timestamp before which the token is not valid. + /// + [DataMember] + public DateTime NotBeforeTimestamp { get; set; } + + /// + /// Gets or sets the timestamp after which the token is not valid. + /// + [DataMember] + public DateTime NotAfterTimestamp { get; set; } + + /// + /// Gets or sets the client request Id for the operation linked with this CIK token. + /// + [DataMember] + public string ClientRequestId { get; set; } + + /// + /// Gets or sets Hash function used to calculate the HMAC. + /// + [DataMember] + public string HashFunction { get; set; } + + /// + /// Gets or sets the HMAC generated using the CIK key. + /// + [DataMember] + public string Hmac { get; set; } + + /// + /// Gets or sets Data contract version. + /// + [DataMember(Name = "Version")] + public Version Version { get; set; } + + /// + /// Gets or sets property bag. This property bag is introduced to support addition of any + /// new property in data contract without breaking the existing clients. + /// If any new property needs to be introduced in the contract, + /// add a key value pair for it in this dictionary. + /// + [DataMember] + public Dictionary PropertyBag { get; set; } + + /// + /// Converts the object into string. + /// + /// The string representation. + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine("NotBeforeTimestamp: " + this.NotBeforeTimestamp); + sb.AppendLine("NotAfterTimestamp: " + this.NotAfterTimestamp); + sb.AppendLine("ClientRequestId: " + this.ClientRequestId); + sb.AppendLine("Hmac: " + this.Hmac); + return sb.ToString(); + } + } + + /// + /// Possible states of the Job. + /// + public class JobStatus : TaskStatus + { + } + + /// + /// Possible states of the Task. + /// + public class TaskStatus + { + /// + /// TaskStatus NotStarted value. + /// + public static readonly string NotStarted = "NotStarted"; + + /// + /// Status InProgress value. + /// + public static readonly string InProgress = "InProgress"; + + /// + /// Status Succeeded value. + /// + public static readonly string Succeeded = "Succeeded"; + + /// + /// Status Other value. + /// + public static readonly string Other = "Other"; + + /// + /// Status Failed value. + /// + public static readonly string Failed = "Failed"; + + /// + /// Status Cancelled value. + /// + public static readonly string Cancelled = "Cancelled"; + + /// + /// Status Suspended value. + /// + public static readonly string Suspended = "Suspended"; + } +} + +//// TODO: Remove this once we get nuget +namespace Microsoft.Azure.Commands.SiteRecovery.RestApiInfra +{ + /// + /// Class to define the error for RP + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all contracts together.")] + [DataContract(Namespace = "http://schemas.microsoft.com/wars")] + public class Error + { + /// + /// Gets or sets the value for the error as string. + /// + [DataMember] + public string ErrorCode { get; set; } + } +} + +namespace Microsoft.Azure.Portal.RecoveryServices.Models.Common +{ + /// + /// Class to define Vault credentials + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all contracts together.")] + [DataContract] + public class VaultCreds + { + #region Constructores + + /// + /// Initializes a new instance of the class. + /// + public VaultCreds() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// subscription Id + /// resource name + /// management cert + /// authenticating service namespace + public VaultCreds(string subscriptionId, string resourceName, string managementCert, AcsNamespace acsNamespace) + { + this.SubscriptionId = subscriptionId; + this.ResourceType = Constants.ASRVaultType; + this.ResourceName = resourceName; + this.ManagementCert = managementCert; + this.AcsNamespace = acsNamespace; + } + + #endregion + + #region Properties + /// + /// Gets or sets the key name for Namespace entry + /// + [DataMember(Order = 0)] + public string SubscriptionId { get; set; } + + /// + /// Gets or sets the key name for Namespace entry + /// + [DataMember(Order = 1)] + public string ResourceType { get; set; } + + /// + /// Gets or sets the key name for Namespace entry + /// + [DataMember(Order = 2)] + public string ResourceName { get; set; } + + /// + /// Gets or sets the key name for Namespace entry + /// + [DataMember(Order = 3)] + public string ManagementCert { get; set; } + + /// + /// Gets or sets the key name for HostName entry + /// + [DataMember(Order = 4)] + public AcsNamespace AcsNamespace { get; set; } + #endregion + } + + /// + /// Class to define ASR Vault credentials + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all contracts together.")] + public class ASRVaultCreds : VaultCreds + { + #region Constructores + + /// + /// Initializes a new instance of the class. + /// + public ASRVaultCreds() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// subscription Id + /// resource name + /// management cert + /// authenticating service namespace + /// Agent Channel Integrity Key + /// cloud service name + /// custom site Id + /// custom site name + public ASRVaultCreds( + string subscriptionId, + string resourceName, + string managementCert, + AcsNamespace acsNamespace, + string channelIntegrityKey, + string cloudServiceName) + : base(subscriptionId, resourceName, managementCert, acsNamespace) + { + this.ChannelIntegrityKey = channelIntegrityKey; + this.ResourceGroupName = cloudServiceName; + this.Version = Constants.VaultCredentialVersion; + } + + #endregion + + #region Properties + /// + /// Gets or sets the value for ACIK + /// + [DataMember(Order = 0)] + public string ChannelIntegrityKey { get; set; } + + /// + /// Gets or sets the value for cloud service name + /// + [DataMember(Order = 1)] + public string ResourceGroupName { get; set; } + + /// + /// Gets or sets the values for the version of the credentials + /// + [DataMember(Order = 2)] + public string Version { get; set; } + + #endregion + } + + /// + /// Class to define ACS name space + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all contracts together.")] + [DataContract] + public class AcsNamespace + { + /// + /// Initializes a new instance of the class. + /// + /// authenticating service Details name + public AcsNamespace(UploadCertificateResponse acsDetails) + { + this.HostName = acsDetails.Properties.GlobalAcsHostName; + this.Namespace = acsDetails.Properties.GlobalAcsNamespace; + this.ResourceProviderRealm = acsDetails.Properties.GlobalAcsRPRealm; + } + + /// + /// Gets or sets Host name + /// + [DataMember(Order = 0)] + public string HostName { get; set; } + + /// + /// Gets or sets Name space + /// + [DataMember(Order = 0)] + public string Namespace { get; set; } + + /// + /// Gets or sets Resource provider realm + /// + [DataMember(Order = 0)] + public string ResourceProviderRealm { get; set; } + } + + ///// + ///// Hyper-V Replica specific protection profile Input. + ///// + //[DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")] + //public class HyperVReplicaSP1ProtectionProfileInput + //{ + // /// + // /// Gets or sets a value indicating the number of recovery points. + // /// + // [DataMember(Name = "recoveryPoints")] + // public int RecoveryPoints { get; set; } + + // /// + // /// Gets or sets a value indicating the application consistent frequency. + // /// + // [DataMember(Name = "applicationConsistentSnapshotFrequencyInHours")] + // public int ApplicationConsistentSnapshotFrequencyInHours { get; set; } + + // /// + // /// Gets or sets a value indicating whether compression has to be enabled. + // /// + // [DataMember(Name = "compressionEnabled")] + // public bool CompressionEnabled { get; set; } + + // /// + // /// Gets or sets a value indicating whether IR is online. + // /// + // [DataMember(Name = "onlineReplicationMethod")] + // public bool OnlineReplicationMethod { get; set; } + + // /// + // /// Gets or sets a value indicating the online IR start time. + // /// + // [DataMember(Name = "onlineReplicationStartTime")] + // public TimeSpan? OnlineReplicationStartTime { get; set; } + + // /// + // /// Gets or sets a value indicating the offline IR import path. + // /// + // [DataMember(Name = "offlineReplicationImportPath")] + // public string OfflineReplicationImportPath { get; set; } + + // /// + // /// Gets or sets a value indicating the offline IR export path. + // /// + // [DataMember(Name = "offlineReplicationExportPath")] + // public string OfflineReplicationExportPath { get; set; } + + // /// + // /// Gets or sets a value indicating the recovery HTTPS port. + // /// + // [DataMember(Name = "replicationPort")] + // public ushort ReplicationPort { get; set; } + + // /// + // /// Gets or sets a value indicating the authentication type. + // /// + // [DataMember(Name = "allowedAuthenticationType")] + // public ushort AllowedAuthenticationType { get; set; } + + // /// + // /// Gets or sets a value indicating whether the VM has to be auto deleted. + // /// + // [DataMember(Name = "allowReplicaDeletion")] + // public bool AllowReplicaDeletion { get; set; } + //} + + ///// + ///// Hyper-V Replica specific protection profile Input. + ///// + //[DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")] + //public class HyperVReplicaProtectionProfileInput : HyperVReplicaSP1ProtectionProfileInput + //{ + // /// + // /// Gets or sets a value indicating the replication interval. + // /// + // [DataMember(Name = "replicationFrequencyInSeconds")] + // public ushort ReplicationFrequencyInSeconds { get; set; } + //} + + ///// + ///// Hyper-V Replica specific protection profile details. + ///// + //[DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")] + //public class HyperVReplicaSP1ProtectionProfileDetails + //{ + // /// + // /// Gets or sets a value indicating the number of recovery points. + // /// + // [DataMember] + // public int RecoveryPoints { get; set; } + + // /// + // /// Gets or sets a value indicating the application consistent frequency. + // /// + // [DataMember] + // public int ApplicationConsistentSnapshotFrequencyInHours { get; set; } + + // /// + // /// Gets or sets a value indicating whether compression has to be enabled. + // /// + // [DataMember] + // public bool CompressionEnabled { get; set; } + + // /// + // /// Gets or sets a value indicating whether IR is online. + // /// + // [DataMember] + // public bool OnlineReplicationMethod { get; set; } + + // /// + // /// Gets or sets a value indicating the online IR start time. + // /// + // [DataMember] + // public TimeSpan? OnlineReplicationStartTime { get; set; } + + // /// + // /// Gets or sets a value indicating the offline IR import path. + // /// + // [DataMember] + // public string OfflineReplicationImportPath { get; set; } + + // /// + // /// Gets or sets a value indicating the offline IR export path. + // /// + // [DataMember] + // public string OfflineReplicationExportPath { get; set; } + + // /// + // /// Gets or sets a value indicating the recovery HTTPS port. + // /// + // [DataMember] + // public ushort ReplicationPort { get; set; } + + // /// + // /// Gets or sets a value indicating the authentication type. + // /// + // [DataMember] + // public ushort AllowedAuthenticationType { get; set; } + + // /// + // /// Gets or sets a value indicating whether the VM has to be auto deleted. + // /// Supported Values: String.Empty, None, OnRecoveryCloud + // /// + // [DataMember] + // public string ReplicaDeletionOption { get; set; } + //} + + ///// + ///// Hyper-V Replica Blue specific protection profile details. + ///// + //[DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")] + //public class HyperVReplicaProtectionProfileDetails : HyperVReplicaSP1ProtectionProfileDetails + //{ + // /// + // /// Gets or sets a value indicating the replication interval. + // /// + // [DataMember] + // public ushort ReplicationFrequencyInSeconds { get; set; } + //} + + /// + /// Azure Site Recovery Protection Profile HyperVReplicaProviderSettings. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related objects together.")] + public class HyperVReplicaProviderSettings + { + /// + /// Initializes a new instance of the class. + /// + public HyperVReplicaProviderSettings() + { + } + + #region Properties + + /// + /// Gets or sets Replication Method. + /// + public string ReplicationMethod { get; set; } + + /// + /// Gets or sets a value indicating whether profile can be dissociated or not. + /// + public bool CanDissociate { get; set; } + + /// + /// Gets or sets Association Details. + /// + public List AssociationDetail { get; set; } + + /// + /// Gets or sets Replication Frequency in seconds. + /// + public ushort ReplicationFrequencyInSeconds { get; set; } + + /// + /// Gets or sets Recovery Points. + /// + public int RecoveryPoints { get; set; } + + /// + /// Gets or sets Application Consistent Snapshot Frequency in hours. + /// + public int ApplicationConsistentSnapshotFrequencyInHours { get; set; } + + /// + /// Gets or sets a value indicating whether Compression is Enabled. + /// + public bool CompressionEnabled { get; set; } + + /// + /// Gets or sets the replication port. + /// + public ushort ReplicationPort { get; set; } + + /// + /// Gets or sets the allowed authentication type. + /// + public string Authentication { get; set; } + + /// + /// Gets or sets Replication Start Time. + /// + public TimeSpan? ReplicationStartTime { get; set; } + + /// + /// Gets or sets a value indicating whether Replica Deletion should be enabled. + /// + public bool AllowReplicaDeletion { get; set; } + + #endregion + } + +// /* +// /// +// /// Disk details for E2A provider. +// /// +// [DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")] +// [SuppressMessage( +// "Microsoft.StyleCop.CSharp.MaintainabilityRules", +// "SA1402:FileMayOnlyContainASingleClass", +// Justification = "Keeping all related classes together.")] +// public class AzureVmDiskDetails +// { +// /// +// /// Gets or sets the List of all Disk in VM. +// /// +// [DataMember] +// public string OsType { get; set; } + +// /// +// /// Gets or sets the Type of OS “Windows|Linux” as set. +// /// +// [DataMember] +// public List Disks { get; set; } + +// /// +// /// Gets or sets the Name of OS Disk as set. +// /// +// [DataMember] +// public string OsDisk { get; set; } + +// /// +// /// Gets or sets the VHD id. +// /// +// [DataMember] +// public string VHDId { get; set; } + +// /// +// /// Gets or sets MaxSizeMB. +// /// +// [DataMember] +// public ulong MaxSizeMB { get; set; } +// } +// */ + +// /// +// /// Replication provider specific settings. +// /// +// [DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")] +// [SuppressMessage( +// "Microsoft.StyleCop.CSharp.MaintainabilityRules", +// "SA1402:FileMayOnlyContainASingleClass", +// Justification = "Keeping all related classes together.")] +// public class ReplicationProviderSpecificSettings +// { +// /// +// /// Gets or sets Azure VM Disk details. +// /// +// [DataMember] +// public AzureVmDiskDetails AzureVMDiskDetails { get; set; } + +// /// +// /// Gets or sets VM properties. +// /// +// [DataMember] +// public VMProps VMProperties { get; set; } +// } +} + +namespace Microsoft.Azure.Portal.HybridServicesCore +{ + /// + /// The ResourceExtendedInfo which represents the xml info stored in RP. + /// + [DataContract] + public class ResourceExtendedInfo + { + #region properties + + /// + /// Gets or sets the version + /// + [DataMember(IsRequired = false)] + public string Version { get; set; } + + /// + /// Gets or sets the channel integrity key + /// + [DataMember(IsRequired = false)] + public string ChannelIntegrityKey { get; set; } + + /// + /// Gets or sets the Channel encryption key + /// + [DataMember(IsRequired = false)] + public string ChannelEncryptionKey { get; set; } + + /// + /// Gets or sets the channel encryption key thumbprint + /// + [DataMember(IsRequired = false)] + public string ChannelEncryptionKeyThumbprint { get; set; } + + /// + /// Gets or sets the portal certificate thumbprint + /// + [DataMember(IsRequired = false)] + public string PortalCertificateThumbprint { get; set; } + + /// + /// Gets or sets the algorithm used to encrypt the data. + /// + [DataMember(IsRequired = false)] + public string Algorithm { get; set; } + + /// + /// Gets or sets the tag to be sent while updating the resource extended info. + /// + [IgnoreDataMember] + public string Etag { get; set; } + + #endregion + + #region Public methods + + /// + /// Returns the Xml representation of this object. + /// + /// the xml as string + public ResourceExtendedInformationArgs Translate() + { + if (string.IsNullOrEmpty(this.Etag)) + { + this.Etag = Guid.NewGuid().ToString(); + } + + string serializedInfo = Utilities.Serialize(this); + ResourceExtendedInformationArgs extendedInfoArgs = new ResourceExtendedInformationArgs( + Constants.VaultExtendedInfoContractVersion, + serializedInfo, + this.Etag); + + return extendedInfoArgs; + } + + /// + /// Method to generate security information + /// + public void GenerateSecurityInfo() + { + this.ChannelIntegrityKey = Utilities.GenerateRandomKey(128); + this.Version = Constants.VaultSecurityInfoVersion; + this.Algorithm = CryptoAlgorithm.None.ToString(); + } + + #endregion + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Models/PSObjects.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Models/PSObjects.cs new file mode 100644 index 000000000000..38f75fe2fb11 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Models/PSObjects.cs @@ -0,0 +1,1435 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Diagnostics.CodeAnalysis; +using System.Runtime.Serialization; +using Microsoft.Azure.Management.RecoveryServices.Models; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using System.Web.Script.Serialization; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Constant definition + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related objects together.")] + public class Constants + { + /// + /// ASR vault type + /// + public const string ASRVaultType = "HyperVRecoveryManagerVault"; + + /// + /// Vault Credential version. + /// + public const string VaultCredentialVersion = "1.0"; + + /// + /// The version of Extended resource info. + /// + public const string VaultSecurityInfoVersion = "1.0"; + + /// + /// extended information version. + /// + public const string VaultExtendedInfoContractVersion = "V2014_09"; + + /// + /// A valid value for the string field Microsoft.WindowsAzure.CloudServiceManagement.resource.OperationStatus.Type + /// + public const string RdfeOperationStatusTypeCreate = "Create"; + + /// + /// A valid value for the string field Microsoft.WindowsAzure.CloudServiceManagement.resource.OperationStatus.Type + /// + public const string RdfeOperationStatusTypeDelete = "Delete"; + + /// + /// A valid value for the string field Microsoft.WindowsAzure.CloudServiceManagement.resource.OperationStatus.Result + /// + public const string RdfeOperationStatusResultSucceeded = "Succeeded"; + + /// + /// A valid value for the string field Microsoft.WindowsAzure.CloudServiceManagement.resource.OperationStatus.Failed + /// + public const string RdfeOperationStatusResultFailed = "Failed"; + + /// + /// A valid value for the string field Microsoft.WindowsAzure.CloudServiceManagement.resource.OperationStatus.InProgress + /// + public const string RdfeOperationStatusResultInProgress = "InProgress"; + + /// + /// Cloud service name prefix + /// + public const string CloudServiceNameExtensionPrefix = "CS-"; + + /// + /// Cloud service name suffix + /// + public const string CloudServiceNameExtensionSuffix = "-RecoveryServices"; + + /// + /// Schema Version of RP + /// + public const string RpSchemaVersion = "1.1"; + + /// + /// Resource Provider Namespace. + /// + public const string ResourceNamespace = "WAHyperVRecoveryManager"; + + /// + /// Represents None string value. + /// + public const string None = "None"; + + /// + /// Represents Existing string value. + /// + public const string Existing = "Existing"; + + /// + /// Represents New string value. + /// + public const string New = "New"; + + /// + /// Represents direction primary to secondary. + /// + public const string PrimaryToRecovery = "PrimaryToRecovery"; + + /// + /// Represents direction secondary to primary. + /// + public const string RecoveryToPrimary = "RecoveryToPrimary"; + + /// + /// Represents Optimize value ForDowntime. + /// + public const string ForDowntime = "ForDowntime"; + + /// + /// Represents Optimize value for Synchronization. + /// + public const string ForSynchronization = "ForSynchronization"; + + /// + /// Represents primary location. + /// + public const string PrimaryLocation = "Primary"; + + /// + /// Represents Recovery location. + /// + public const string RecoveryLocation = "Recovery"; + + /// + /// Represents HyperVReplica string constant. + /// + public const string HyperVReplica = "HyperVReplica"; + + /// + /// Represents HyperVReplica string constant. + /// + public const string HyperVReplicaAzure = "HyperVReplicaAzure"; + + /// + /// Represents San string constant. + /// + public const string San = "San"; + + /// + /// Represents HyperVReplica string constant. + /// + public const string AzureContainer = "Microsoft Azure"; + + /// + /// Represents OnlineReplicationMethod string constant. + /// + public const string OnlineReplicationMethod = "Online"; + + /// + /// Represents OfflineReplicationMethod string constant. + /// + public const string OfflineReplicationMethod = "Offline"; + + /// + /// Represents OS Windows. + /// + public const string OSWindows = "Windows"; + + /// + /// Represents OS Linux. + /// + public const string OSLinux = "Linux"; + + /// + /// Represents Enable protection. + /// + public const string EnableProtection = "Enable"; + + /// + /// Represents Disable protection. + /// + public const string DisableProtection = "Disable"; + + /// + /// Represents Direction string value. + /// + public const string Direction = "Direction"; + + /// + /// Represents RPId string value. + /// + public const string RPId = "RPId"; + + /// + /// Represents ID string value. + /// + public const string ID = "ID"; + + /// + /// Represents NetworkType string value. + /// + public const string NetworkType = "NetworkType"; + + /// + /// Represents ProtectionEntityId string value. + /// + public const string ProtectionEntityId = "ProtectionEntityId"; + + /// + /// Azure fabric Id. In E2A context Recovery Server Id is always this. + /// + public const string AzureFabricId = "21a9403c-6ec1-44f2-b744-b4e50b792387"; + + /// + /// Authentication Type as Certificate based authentication. + /// + public const string AuthenticationTypeCertificate = "Certificate"; + + /// + /// Authentication Type as Kerberos. + /// + public const string AuthenticationTypeKerberos = "Kerberos"; + + /// + /// Acceptable values of Replication Frequency in seconds (as per portal). + /// + public const string Thirty = "30"; + + /// + /// Acceptable values of Replication Frequency in seconds (as per portal). + /// + public const string ThreeHundred = "300"; + + /// + /// Acceptable values of Replication Frequency in seconds (as per portal). + /// + public const string NineHundred = "900"; + + /// + /// Replication type - async. + /// + public const string Sync = "Sync"; + + /// + /// Replication type - async. + /// + public const string Async = "Async"; + + /// + /// SourceSiteOperations - Required. + /// + public const string Required = "Required"; + + /// + /// SourceSiteOperations - NotRequired. + /// + public const string NotRequired = "NotRequired"; + } + + /// + /// Azure Site Recovery Vault Settings. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related objects together.")] + public class ASRVaultSettings + { + /// + /// Initializes a new instance of the class. + /// + public ASRVaultSettings() + { + } + + /// + /// Initializes a new instance of the class with vault + /// and Cloud Service names. + /// + /// vault Name + /// Cloud Service Name + public ASRVaultSettings(string resourceName, string cloudServiceName) + { + this.ResourceName = resourceName; + this.ResouceGroupName = cloudServiceName; + } + + #region Properties + /// + /// Gets or sets Resource Name. + /// + public string ResourceName { get; set; } + + /// + /// Gets or sets Cloud Service Name. + /// + public string ResouceGroupName { get; set; } + #endregion Properties + } + + /// + /// Azure Site Recovery Server. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related objects together.")] + public class ASRServer + { + /// + /// Initializes a new instance of the class. + /// + public ASRServer() + { + } + + /// + /// Initializes a new instance of the class with required + /// parameters. + /// + /// Server object + public ASRServer(Server server) + { + this.ID = server.Id; + this.Name = server.Name; + this.FriendlyName = server.Properties.FriendlyName; + this.LastHeartbeat = server.Properties.LastHeartbeat; + this.ProviderVersion = server.Properties.ProviderVersion; + this.ServerVersion = server.Properties.ServerVersion; + // this.Connected = server.Properties.Connected; + this.FabricObjectID = server.Properties.FabricObjectID; + this.FabricType = server.Properties.FabricType; + this.Type = server.Type; + } + + #region Properties + /// + /// Gets or sets Name of the Server. + /// + public string FriendlyName { get; set; } + + /// + /// Gets or sets Name of the Server. + /// + public string Name { get; set; } + + /// + /// Gets or sets Server ID. + /// + public string ID { get; set; } + + /// + /// Gets or sets the Type of Management entity – VMM, V-Center. + /// + public string Type { get; set; } + + /// + /// Gets or sets the type of Fabric - VMM. + /// + public string FabricType { get; set; } + + /// + /// Gets or sets the ID of the on premise fabric. + /// + public string FabricObjectID { get; set; } + + ///// + ///// Gets or sets a value indicating whether server is connected or not. + ///// + //public bool Connected { get; set; } + + /// + /// Gets or sets Last communicated time. + /// + public DateTime LastHeartbeat { get; set; } + + /// + /// Gets or sets Provider version. + /// + public string ProviderVersion { get; set; } + + /// + /// Gets or sets Server version. + /// + public string ServerVersion { get; set; } + #endregion + } + + /// + /// Azure Site Recovery Protection Container. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related objects together.")] + public class ASRProtectionContainer + { + /// + /// Initializes a new instance of the class. + /// + public ASRProtectionContainer() + { + } + + /// + /// Initializes a new instance of the class with + /// required parameters. + /// + /// Protection container object + public ASRProtectionContainer(ProtectionContainer pc) + { + if (pc.Properties.AvailableProtectionProfiles != null) + { + this.AvailableProtectionProfiles = new List(); + foreach (var profile in pc.Properties.AvailableProtectionProfiles) + { + this.AvailableProtectionProfiles.Add( + new ASRProtectionProfile(profile)); + } + } + + this.ID = pc.Id; + this.Name = pc.Name; + this.FriendlyName = pc.Properties.FriendlyName; + this.Role = pc.Properties.Role; + // this.ServerId = pc.Properties.ServerId; + this.FabricObjectId = pc.Properties.FabricObjectId; + this.FabricType = pc.Properties.FabricType; + this.Type = pc.Type; + } + + #region Properties + /// + /// Gets or sets name of the Protection container. + /// + public string FriendlyName { get; set; } + + /// + /// Gets or sets name of the Protection container. + /// + public string Name { get; set; } + + /// + /// Gets or sets Protection container ID. + /// + public string ID { get; set; } + + /// + /// Gets or sets the type e.g. VMM, HyperVSite, etc. + /// + [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed.")] + public string Type { get; set; } + + /// + /// Gets or sets Protection container's FabricObjectId. + /// + public string FabricObjectId { get; set; } + + /// + /// Gets or sets the type of Fabric - VMM. + /// + public string FabricType { get; set; } + + ///// + ///// Gets or sets Server ID. + ///// + //public string ServerId { get; set; } + + /// + /// Gets or sets a role of the protection container. + /// + public string Role { get; set; } + + /// + /// Gets or sets the list of protection profiles. + /// + public List AvailableProtectionProfiles { get; set; } + #endregion + } + + /// + /// Protection profile association details. + /// + [DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")] + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related public classes together.")] + public class ASRProtectionProfileAssociationDetails + { + /// + /// Gets or sets the PrimaryProtectionContainerId. + /// + [DataMember(Order = 1)] + public string PrimaryProtectionContainerId { get; set; } + + /// + /// Gets or sets the RecoveryProtectionContainerId. + /// + [DataMember(Order = 2)] + public string RecoveryProtectionContainerId { get; set; } + + /// + /// Gets or sets the association status. This is a string representation of the + /// enumeration type . + /// + [DataMember(Order = 3)] + public string AssociationStatus { get; set; } + } + + /// + /// Azure Site Recovery Protection Profile. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related objects together.")] + public class ASRProtectionProfile + { + /// + /// Initializes a new instance of the class. + /// + public ASRProtectionProfile() + { + } + + /// + /// Initializes a new instance of the class with + /// required parameters. + /// + /// Protection container object + public ASRProtectionProfile(ProtectionProfile profile) + { + this.ID = profile.Id; + this.Name = profile.Name; + this.FriendlyName = profile.CustomData.FriendlyName; + this.Type = profile.Type; + this.ReplicationProvider = profile.CustomData.ReplicationProvider; + + if (profile.CustomData.ReplicationProvider == Constants.HyperVReplica) + { + JavaScriptSerializer serializer = new JavaScriptSerializer(); + HyperVReplicaProtectionProfileDetails details = (HyperVReplicaProtectionProfileDetails)profile.CustomData.ReplicationProviderSettings; + + this.ReplicationProviderSettings = new ASRHyperVReplicaProtectionProfileDetails(); + this.ReplicationProviderSettings.ReplicaDeletionOption = + details.ReplicaDeletionOption; + this.ReplicationProviderSettings.ApplicationConsistentSnapshotFrequencyInHours = + details.ApplicationConsistentSnapshotFrequencyInHours; + + this.ReplicationProviderSettings.Compression= + details.Compression; + this.ReplicationProviderSettings.ReplicationFrequencyInSeconds = + details.ReplicationFrequencyInSeconds; + this.ReplicationProviderSettings.AllowedAuthenticationType = + (details.AllowedAuthenticationType == 1) ? Constants.AuthenticationTypeKerberos : Constants.AuthenticationTypeCertificate; + this.ReplicationProviderSettings.RecoveryPoints = details.RecoveryPoints; + this.ReplicationProviderSettings.InitialReplicationMethod = + (string.Compare(details.InitialReplicationMethod, "OverNetwork", StringComparison.OrdinalIgnoreCase) == 0) ? Constants.OnlineReplicationMethod : Constants.OfflineReplicationMethod; + this.ReplicationProviderSettings.ReplicationPort = details.ReplicationPort; + this.ReplicationProviderSettings.OnlineReplicationStartTime = details.OnlineReplicationStartTime; + } + } + + #region Properties + /// + /// Gets or sets friendly name of the Protection profile. + /// + public string FriendlyName { get; set; } + + /// + /// Gets or sets name of the Protection profile. + /// + public string Name { get; set; } + + /// + /// Gets or sets Protection profile ID. + /// + public string ID { get; set; } + + /// + /// Gets or sets Protection profile type. + /// + public string Type { get; set; } + + /// + /// Gets or sets Replication Type (HyperVReplica, HyperVReplicaAzure, San) + /// + public string ReplicationProvider { get; set; } + + /// + /// Gets or sets HyperVReplicaProviderSettings + /// + // public HyperVReplicaProviderSettings ReplicationProviderSettings { get; set; } + public ASRHyperVReplicaProtectionProfileDetails ReplicationProviderSettings { get; set; } + + #endregion Properties + } + + // Summary: + // HyperV Replica Protection Profile Details. + public class ASRHyperVReplicaProtectionProfileDetails + { + + // Summary: + // Optional. + public string AllowedAuthenticationType { get; set; } + // + // Summary: + // Optional. + public int ApplicationConsistentSnapshotFrequencyInHours { get; set; } + // + // Summary: + // Optional. + public string Compression { get; set; } + // + // Summary: + // Optional. + public string InitialReplicationMethod { get; set; } + // + // Summary: + // Optional. + public string OfflineReplicationExportPath { get; set; } + // + // Summary: + // Optional. + public string OfflineReplicationImportPath { get; set; } + // + // Summary: + // Optional. + public TimeSpan? OnlineReplicationStartTime { get; set; } + // + // Summary: + // Optional. + public int RecoveryPoints { get; set; } + // + // Summary: + // Optional. + public string ReplicaDeletionOption { get; set; } + // + // Summary: + // Optional. + public ushort ReplicationFrequencyInSeconds { get; set; } + // + // Summary: + // Optional. + public ushort ReplicationPort { get; set; } + } + + /// + /// Azure Site Recovery Protection Entity. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related objects together.")] + public class ASRProtectionEntity + { + /// + /// Initializes a new instance of the class. + /// + public ASRProtectionEntity() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// Protection entity object to read values from. + public ASRProtectionEntity(ProtectionEntity pe) + { + this.ID = pe.Id; + this.ProtectionContainerId = pe.Properties.ProtectionContainerId; + this.Name = pe.Name; + this.FriendlyName = pe.Properties.FriendlyName; + this.Type = pe.Type; + this.FabricObjectId = + (0 == string.Compare(this.Type, "VirtualMachine", StringComparison.OrdinalIgnoreCase)) ? + pe.Properties.FabricObjectId.ToUpper() : + pe.Properties.FabricObjectId; + this.ProtectionStatus = pe.Properties.ProtectionStatus; + this.ProtectionStateDescription = pe.Properties.ProtectionStateDescription; + // this.CanCommit = pe.CanCommit; + // this.CanFailover = pe.CanFailover; + // this.CanReverseReplicate = pe.CanReverseReplicate; + this.AllowedOperations = pe.Properties.AllowedOperations; + this.ReplicationProvider = pe.Properties.ReplicationProvider; + this.ActiveLocation = pe.Properties.ActiveLocation; + this.ReplicationHealth = pe.Properties.ReplicationHealth; + this.TestFailoverStateDescription = pe.Properties.TestFailoverStateDescription; + + /* + if (!string.IsNullOrWhiteSpace(pe.ReplicationProviderSettings)) + { + AzureVmDiskDetails diskDetails; + DataContractUtils.Deserialize( + pe.ReplicationProviderSettings, out diskDetails); + + this.Disks = diskDetails.Disks; + this.OSDiskId = diskDetails.VHDId; + this.OSDiskName = diskDetails.OsDisk; + this.OS = diskDetails.OsType; + } + */ + + if (pe.Properties.ProtectionProfile != null && + !string.IsNullOrWhiteSpace(pe.Properties.ProtectionProfile.Id)) + { + this.ProtectionProfile = new ASRProtectionProfile(pe.Properties.ProtectionProfile); + } + } + + /// + /// Initializes a new instance of the class with + /// required parameters. + /// + /// Protection Entity ID + /// Server ID + /// Protection Container ID + /// Name of the Virtual Machine + /// Virtual Machine type + /// Fabric object ID + /// Can protected or not + /// Can commit or not + /// Can failover or not + /// Can reverse replicate or not + /// Active location + /// Protection state + /// Test fail over state + /// Replication health + /// Replication provider + public ASRProtectionEntity( + string protectionEntityId, + string serverId, + string protectionContainerId, + string name, + string type, + string fabricObjectId, + string protectedOrNot, + bool canCommit, + bool canFailover, + bool canReverseReplicate, + string activeLocation, + string protectionStateDescription, + string testFailoverStateDescription, + string replicationHealth, + string replicationProvider) + { + this.ID = protectionEntityId; + // this.ServerId = serverId; + this.ProtectionContainerId = protectionContainerId; + this.Name = name; + this.Type = type; + this.FabricObjectId = + (0 == string.Compare(this.Type, "VirtualMachine", StringComparison.OrdinalIgnoreCase)) ? + fabricObjectId.ToUpper() : + fabricObjectId; + this.ProtectionStatus = protectedOrNot; + this.ProtectionStateDescription = protectionStateDescription; + // this.CanCommit = canCommit; + // this.CanFailover = canFailover; + // this.CanReverseReplicate = canReverseReplicate; + // this.AllowedActions = + this.ReplicationProvider = replicationProvider; + this.ActiveLocation = activeLocation; + this.ReplicationHealth = replicationHealth; + this.TestFailoverStateDescription = testFailoverStateDescription; + } + + /// + /// Gets or sets Friendly Name of the Protection entity. + /// + public string FriendlyName { get; set; } + + /// + /// Gets or sets Name of the Protection entity. + /// + public string Name { get; set; } + + /// + /// Gets or sets Protection entity ID. + /// + public string ID { get; set; } + + /// + /// Gets or sets type of the Protection entity. + /// + public string Type { get; set; } + + /// + /// Gets or sets fabric object ID. + /// + public string FabricObjectId { get; set; } + + /// + /// Gets or sets Protection container ID. + /// + public string ProtectionContainerId { get; set; } + + ///// + ///// Gets or sets Server ID. + ///// + //public string ServerId { get; set; } + + /// + /// Gets or sets a value indicating whether it is protected or not. + /// + public string ProtectionStatus { get; set; } + + ///// + ///// Gets or sets a value indicating whether it can be committed or not. + ///// + //public bool CanCommit { get; set; } + + ///// + ///// Gets or sets a value indicating whether it can be failed over or not. + ///// + //public bool CanFailover { get; set; } + + ///// + ///// Gets or sets a value indicating whether it can be reverse replicated or not. + ///// + //public bool CanReverseReplicate { get; set; } + + /// + /// Gets or sets a value that lists allowed operations. + /// + public IList AllowedOperations { get; set; } + + /// + /// Gets or sets a active location of protection entity. + /// + public string ActiveLocation { get; set; } + + /// + /// Gets or sets protection state. + /// + public string ProtectionStateDescription { get; set; } + + /// + /// Gets or sets Replication health. + /// + public string ReplicationHealth { get; set; } + + /// + /// Gets or sets test failover state. + /// + public string TestFailoverStateDescription { get; set; } + + /// + /// Gets or sets ProtectionProfile. + /// + public ASRProtectionProfile ProtectionProfile { get; set; } + + ///// + ///// Gets or sets OSDiskVHDId. + ///// + //public string OSDiskId { get; set; } + + ///// + ///// Gets or sets OS DiskName. + ///// + //public string OSDiskName { get; set; } + + ///// + ///// Gets or sets OS. + ///// + //public string OS { get; set; } + + ///// + ///// Gets or sets OS. + ///// + //public List Disks { get; set; } + + /// + /// Gets or sets Replication provider. + /// + public string ReplicationProvider { get; set; } + } + + /// + /// Task of the Job. + /// + public class ASRTask + { + /// + /// Initializes a new instance of the class. + /// + public ASRTask() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// Task details to load values from. + public ASRTask(AsrTask task) + { + this.ID = task.Id; + this.EndTime = task.EndTime; + this.Name = task.Name; + this.StartTime = task.StartTime; + this.State = task.State; + this.StateDescription = task.StateDescription; + } + + /// + /// Gets or sets the task name. + /// + public string Name { get; set; } + + /// + /// Gets or sets Job ID. + /// + public string ID { get; set; } + + /// + /// Gets or sets the Status. + /// + public string State { get; set; } + + /// + /// Gets or sets the State description, which tells the exact internal state. + /// + public string StateDescription { get; set; } + + /// + /// Gets or sets the start time. + /// + public DateTime StartTime { get; set; } + + /// + /// Gets or sets the end time. + /// + public DateTime EndTime { get; set; } + } + + /// + /// Azure Site Recovery Job. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related objects together.")] + public class ASRJob + { + /// + /// Initializes a new instance of the class. + /// + public ASRJob() + { + } + + /// + /// Initializes a new instance of the class with required parameters. + /// + /// ASR Job object + public ASRJob(Job job) + { + this.ID = job.Id; + this.Type = job.Type; + this.JobType = job.Properties.ScenarioName; + this.DisplayName = job.Properties.DisplayName; + this.ClientRequestId = job.Properties.ActivityId; + this.State = job.Properties.State; + this.StateDescription = job.Properties.StateDescription; + this.EndTime = job.Properties.EndTime; + this.StartTime = job.Properties.StartTime; + this.Name = job.Name; + this.TargetObjectId = job.Properties.TargetObjectId; + this.TargetObjectName = job.Properties.TargetObjectName; + if (job.Properties.AllowedActions != null && job.Properties.AllowedActions.Count > 0) + { + this.AllowedActions = new List(); + foreach (var action in job.Properties.AllowedActions) + { + this.AllowedActions.Add(action); + } + } + + if (!string.IsNullOrEmpty(job.Properties.TargetObjectId)) + { + this.TargetObjectType = job.Properties.TargetObjectType; + } + + this.Tasks = new List(); + foreach (var task in job.Properties.Tasks) + { + this.Tasks.Add(new ASRTask(task)); + } + + this.Errors = new List(); + + foreach (var error in job.Properties.Errors) + { + ASRErrorDetails errorDetails = new ASRErrorDetails(); + errorDetails.TaskId = error.TaskId; + errorDetails.ServiceErrorDetails = new ASRServiceError(error.ServiceErrorDetails); + errorDetails.ProviderErrorDetails = new ASRProviderError(error.ProviderErrorDetails); + this.Errors.Add(errorDetails); + } + } + + #region Properties + /// + /// Gets or sets Job display name. + /// + public string Name { get; set; } + + /// + /// Gets or sets Job ID. + /// + public string ID { get; set; } + + /// + /// Gets or sets type. + /// + public string Type { get; set; } + + /// + /// Gets or sets Job display name. + /// + public string JobType { get; set; } + + /// + /// Gets or sets Job display name. + /// + public string DisplayName { get; set; } + + /// + /// Gets or sets Activity ID. + /// + public string ClientRequestId { get; set; } + + /// + /// Gets or sets State of the Job. + /// + public string State { get; set; } + + /// + /// Gets or sets StateDescription of the Job. + /// + public string StateDescription { get; set; } + + /// + /// Gets or sets Start timestamp. + /// + public DateTimeOffset? StartTime { get; set; } + + /// + /// Gets or sets End timestamp. + /// + public DateTimeOffset? EndTime { get; set; } + + /// + /// Gets or sets TargetObjectId. + /// + public string TargetObjectId { get; set; } + + /// + /// Gets or sets TargetObjectType. + /// + public string TargetObjectType { get; set; } + + /// + /// Gets or sets End timestamp. + /// + public string TargetObjectName { get; set; } + + /// + /// Gets or sets list of allowed actions. + /// + public List AllowedActions { get; set; } + + /// + /// Gets or sets list of tasks. + /// + public List Tasks { get; set; } + + /// + /// Gets or sets list of Errors. + /// + public List Errors { get; set; } + #endregion + } + + /// + /// Azure Site Recovery Vault. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related objects together.")] + public class ASRVault + { + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public ASRVault() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// vault object + public ASRVault(Vault vault) + { + this.ID = vault.Id; + this.Name = vault.Name; + this.Type = vault.Type; + this.Location = vault.Location; + this.ResouceGroupName = PSRecoveryServicesClient.GetResourceGroup(vault.Id); + this.SubscriptionId = PSRecoveryServicesClient.GetSubscriptionId(vault.Id); + this.Properties = new ASRVaultProperties(); + this.Properties.ProvisioningState = vault.Properties.ProvisioningState; + } + + /// + /// Initializes a new instance of the class. + /// + /// vault object + public ASRVault(VaultCreateResponse vault) + { + this.ID = vault.Id; + this.Name = vault.Name; + this.Type = vault.Type; + this.Location = vault.Location; + this.ResouceGroupName = PSRecoveryServicesClient.GetResourceGroup(vault.Id); + this.SubscriptionId = PSRecoveryServicesClient.GetSubscriptionId(vault.Id); + this.Properties = new ASRVaultProperties(); + this.Properties.ProvisioningState = vault.Properties.ProvisioningState; + } + + #endregion + + #region Properties + /// + /// Gets or sets Vault Name. + /// + public string Name { get; set; } + + /// + /// Gets or sets Vault ID. + /// + public string ID { get; set; } + + /// + /// Gets or sets type. + /// + public string Type { get; set; } + + /// + /// Gets or sets location. + /// + public string Location { get; set; } + + /// + /// Gets or sets Resouce group name. + /// + public string ResouceGroupName { get; set; } + + /// + /// Gets or sets Subscription. + /// + public string SubscriptionId { get; set; } + + /// + /// Gets or sets Properties. + /// + public ASRVaultProperties Properties { get; set; } + + #endregion + } + + /// + /// Azure Site Recovery Vault properties. + /// + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related objects together.")] + public class ASRVaultProperties + { + #region Properties + + /// + /// Gets or sets Provisioning State. + /// + public string ProvisioningState { get; set; } + + #endregion + } + + /// + /// This class contains the error details per object. + /// + public class ASRErrorDetails + { + /// + /// Gets or sets the Service error details. + /// + public ASRServiceError ServiceErrorDetails { get; set; } + + /// + /// Gets or sets the Provider error details. + /// + public ASRProviderError ProviderErrorDetails { get; set; } + + /// + /// Gets or sets the Id of the task. + /// + public string TaskId { get; set; } + } + + /// + /// This class contains the ASR error details per object. + /// + public class ASRServiceError : Error + { + /// + /// Initializes a new instance of the class with required parameters. + /// + public ASRServiceError() + { + } + + /// + /// Initializes a new instance of the class with required parameters. + /// + /// ServiceError object + public ASRServiceError(ServiceError serviceError) + : base(serviceError) + { + } + } + + /// + /// Class to define the output of the vault settings file generation. + /// + public class VaultSettingsFilePath + { + #region Constructor + + /// + /// Initializes a new instance of the class + /// + public VaultSettingsFilePath() + { + } + + #endregion + + #region Properties + + /// + /// Gets or sets the path of generated credential file. + /// + public string FilePath { get; set; } + + #endregion + } + + /// + /// Class to define the output object for the vault operations. + /// + public class VaultOperationOutput + { + #region Constructor + + /// + /// Initializes a new instance of the class + /// + public VaultOperationOutput() + { + } + + #endregion + + #region Properties + + /// + /// Gets or sets the operation tracking id of the operation performed. + /// + public string Response { get; set; } + + #endregion + } + + /// + /// This class contains the provider error details per object. + /// + public class ASRProviderError + { + /// + /// Initializes a new instance of the class with required parameters. + /// + public ASRProviderError() + { + } + + /// + /// Initializes a new instance of the class with required parameters. + /// + /// ProviderError object + public ASRProviderError(ProviderError error) + { + this.AffectedObjects = error.AffectedObjects; + this.CreationTimeUtc = error.CreationTimeUtc; + this.ErrorCode = error.ErrorCode; + this.ErrorId = error.ErrorId; + this.ErrorLevel = error.ErrorLevel; + this.ErrorMessage = error.ErrorMessage; + this.WorkflowId = error.WorkflowId; + } + + /// + /// Gets or sets the Error code. + /// + public int ErrorCode { get; set; } + + /// + /// Gets or sets the Error message + /// + public string ErrorMessage { get; set; } + + /// + /// Gets or sets the Provider error Id + /// + public string ErrorId { get; set; } + + /// + /// Gets or sets Workflow Id. + /// + public string WorkflowId { get; set; } + + /// + /// Gets or sets the AffectedObjects. + /// + public IDictionary AffectedObjects { get; set; } + + /// + /// Gets or sets the Time of the error creation. + /// + public DateTime CreationTimeUtc { get; set; } + + /// + /// Gets or sets the Error level. + /// + public string ErrorLevel { get; set; } + } + + /// + /// Disk details. + /// + [DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")] + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related classes together.")] + public class VirtualHardDisk + { + /// + /// Gets or sets the VHD id. + /// + [DataMember] + public string Id { get; set; } + + /// + /// Gets or sets the name. + /// + [DataMember] + public string Name { get; set; } + } + + /// + /// Partial details of a NIC of a VM. + /// + [DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")] + [SuppressMessage( + "Microsoft.StyleCop.CSharp.MaintainabilityRules", + "SA1402:FileMayOnlyContainASingleClass", + Justification = "Keeping all related classes together.")] + public class VMNic + { + /// + /// Gets or sets ID of the NIC. + /// + [DataMember] + public string NicId { get; set; } + + /// + /// Gets or sets Name of the VM subnet. + /// + [DataMember] + public string VMSubnetName { get; set; } + + /// + /// Gets or sets Name of the VM network. + /// + [DataMember] + public string VMNetworkName { get; set; } + + /// + /// Gets or sets Id of the recovery VM Network. + /// + [DataMember] + public string RecoveryVMNetworkId { get; set; } + + /// + /// Gets or sets the name of the recovery VM subnet. + /// + [DataMember] + public string RecoveryVMSubnetName { get; set; } + + /// + /// Gets or sets the static IP address of the replica NIC. + /// + [DataMember] + public string RecoveryNicStaticIPAddress { get; set; } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Models/PSParameterSets.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Models/PSParameterSets.cs new file mode 100644 index 000000000000..a5a6d131c667 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Models/PSParameterSets.cs @@ -0,0 +1,207 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Azure.Commands.SiteRecovery +{ + /// + /// Parameter Sets used for Azure Site Recovery commands. + /// + internal static class ASRParameterSets + { + /// + /// When only RP Object is passed to the command. + /// + internal const string ByRPObject = "ByRPObject"; + + /// + /// When only Object is passed to the command. + /// + internal const string ByObject = "ByObject"; + + /// + /// When only PE Object is passed to the command. + /// + internal const string ByPEObject = "ByPEObject"; + + /// + /// When only RP Object with E2A provider is passed to the command. + /// + internal const string ByRPObjectE2A = "ByRPObjectE2A"; + + /// + /// When only PE Object with E2A provider is passed to the failback command. + /// + internal const string ByPEObjectE2AFailback = "ByPEObjectE2AFailback"; + + /// + /// When only RP Object with E2A provider is passed to the failback command. + /// + internal const string ByRPObjectE2AFailback = "ByRPObjectE2AFailback"; + + /// + /// When only PE Object with E2A provider is passed to the command. + /// + internal const string ByPEObjectE2A = "ByPEObjectE2A"; + + /// + /// When only PE Object is passed along with logical network ID to the command. + /// + internal const string ByPEObjectWithLogicalNetworkID = "ByPEObjectWithLogicalNetworkID"; + + /// + /// When only RP Object is passed along with VM network ID to the command. + /// + internal const string ByRPObjectWithVMNetworkID = "ByRPObjectWithVMNetworkID"; + + /// + /// When only RP Id is passed along with VM network ID to the command. + /// + internal const string ByRPIdWithVMNetworkID = "ByRPIdWithVMNetworkID"; + + /// + /// When only RP Object is passed along with VM network to the command. + /// + internal const string ByRPObjectWithVMNetwork = "ByRPObjectWithVMNetwork"; + + /// + /// When only RP Id is passed along with VM network to the command. + /// + internal const string ByRPIdWithVMNetwork = "ByRPIdWithVMNetwork"; + + /// + /// When only PE Object is passed along with VM network ID to the command. + /// + internal const string ByPEObjectWithVMNetworkID = "ByPEObjectWithVMNetworkID"; + + /// + /// When only PE Object is passed along with VM network to the command. + /// + internal const string ByPEObjectWithVMNetwork = "ByPEObjectWithVMNetwork"; + + /// + /// When only PC and PE ids are passed to the command. + /// + internal const string ByPEId = "ByPEId"; + + /// + /// When only PC and PE ids are passed along with logical network ID to the command. + /// + internal const string ByPEIdWithLogicalNetworkID = "ByPEIdWithLogicalNetworkID"; + + /// + /// When only RP object is passed along with logical network ID to the command. + /// + internal const string ByRPObjectWithLogicalNetworkID = "ByRPObjectWithLogicalNetworkID"; + + /// + /// When only RP Id is passed along with logical network ID to the command. + /// + internal const string ByRPIdWithLogicalNetworkID = "ByRPIdWithLogicalNetworkID"; + + /// + /// When only PC and PE ids are passed along with VM network ID to the command. + /// + internal const string ByPEIdWithVMNetworkID = "ByPEIdWithVMNetworkID"; + + /// + /// When only PC and PE ids are passed along with VM network to the command. + /// + internal const string ByPEIdWithVMNetwork = "ByPEIdWithVMNetwork"; + + /// + /// When only ID is passed to the command. + /// + internal const string ById = "ById"; + + /// + /// When only RP ID is passed to the command. + /// + internal const string ByRPId = "ByRPId"; + + /// + /// When only Name is passed to the command. + /// + internal const string ByName = "ByName"; + + /// + /// When only Name is passed to the command. + /// + internal const string ByFriendlyName = "ByFriendlyName"; + + /// + /// When nothing is passed to the command. + /// + internal const string Default = "Default"; + + /// + /// When group of IDs are passed to the command. + /// + internal const string ByIDs = "ByIDs"; + + /// + /// When Object and ID are passed to the command. + /// + internal const string ByObjectWithId = "ByObjectWithId"; + + /// + /// When Object and Name are passed to the command. + /// + internal const string ByObjectWithName = "ByObjectWithName"; + + /// + /// When Object and Name are passed to the command. + /// + internal const string ByObjectWithFriendlyName = "ByObjectWithFriendlyName"; + + /// + /// When group of IDs and ID are passed to the command. + /// + internal const string ByIDsWithId = "ByIDsWithId"; + + /// + /// When group of IDs and Name are passed to the command. + /// + internal const string ByIDsWithName = "ByIDsWithName"; + + /// + /// When parameters are passed to the command. + /// + internal const string ByParam = "ByParam"; + + /// + /// Mapping between Enterprise to Enterprise. + /// + internal const string EnterpriseToEnterprise = "EnterpriseToEnterprise"; + + /// + /// Mapping between Enterprise to Azure. + /// + internal const string EnterpriseToAzure = "EnterpriseToAzure"; + + /// + /// Mapping between Enterprise to Enterprise San. + /// + internal const string EnterpriseToEnterpriseSan = "EnterpriseToEnterpriseSan"; + + /// + /// For Enable replication group parameter set. + /// + internal const string EnableReplicationGroup = "EnableReplicationGroup"; + + /// + /// For Disable replication group parameter set. + /// + internal const string DisableReplicationGroup = "DisableReplicationGroup"; + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/AssemblyInfo.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..5babfe1bda3a --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft Azure Powershell")] +[assembly: AssemblyCopyright("Copyright © Microsoft")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 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)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("666ec982-0673-4d9f-8f31-da7534c183bb")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/Resources.Designer.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..339d73e7dc55 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/Resources.Designer.cs @@ -0,0 +1,529 @@ +//------------------------------------------------------------------------------ +// +// 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.Azure.Commands.SiteRecovery.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.Azure.Commands.SiteRecovery.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 Please provide required VM properties to update. + /// + internal static string ArgumentsMissingForUpdateVmProperties { + get { + return ResourceManager.GetString("ArgumentsMissingForUpdateVmProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AzureVMNetwork {0} is not associated with the Subscription {1}. + /// + internal static string AzureVMNetworkIsNotAssociatedWithTheSubscription { + get { + return ResourceManager.GetString("AzureVMNetworkIsNotAssociatedWithTheSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation Failed. + ///Message: {0} + ///Possible Causes: {1} + ///Recommended Action: {2} + ///ClientRequestId: {3}. + /// + internal static string CloudExceptionDetails { + get { + return ResourceManager.GetString("CloudExceptionDetails", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cloud Service name mentioned is either null or empty. + /// + internal static string CloudServiceNameNullOrEmpty { + get { + return ResourceManager.GetString("CloudServiceNameNullOrEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure want to disable protection on {0}. + /// + internal static string DisableProtectionWarning { + get { + return ResourceManager.GetString("DisableProtectionWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}s protection. + /// + internal static string DisableProtectionWhatIfMessage { + get { + return ResourceManager.GetString("DisableProtectionWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Calls using ID based parameter {0} will not be supported from next release. Please use its corresponding full object parameter instead.. + /// + internal static string IDBasedParamUsageNotSupportedFromNextRelease { + get { + return ResourceManager.GetString("IDBasedParamUsageNotSupportedFromNextRelease", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replication Provider {0} entered invalid for the current set of parameters.. + /// + internal static string IncorrectReplicationProvider { + get { + return ResourceManager.GetString("IncorrectReplicationProvider", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vault information (Name: {0}, Location: {1}) is not correct. + /// + internal static string InCorrectVaultInformation { + get { + return ResourceManager.GetString("InCorrectVaultInformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation failed. + ///{0}. + /// + internal static string InvalidCloudExceptionErrorMessage { + get { + return ResourceManager.GetString("InvalidCloudExceptionErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replication Frequency {0} is invalid. + /// + internal static string InvalidReplicationFrequency { + get { + return ResourceManager.GetString("InvalidReplicationFrequency", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource is not associted with the selected Cloud Service. + /// + internal static string InvalidResource { + get { + return ResourceManager.GetString("InvalidResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource Group is not associated with the selected Subscription. + /// + internal static string InvalidResourceGroup { + get { + return ResourceManager.GetString("InvalidResourceGroup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to XML is malformed or file is empty, exception details: {0}. + /// + internal static string InvalidXml { + get { + return ResourceManager.GetString("InvalidXml", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} will be a mandatory paramter from next release.. + /// + internal static string MandatoryParamFromNextRelease { + get { + return ResourceManager.GetString("MandatoryParamFromNextRelease", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vault Key value is missing. Please import Vault Settings and verify the same. + /// + internal static string MissingChannelIntergrityKey { + get { + return ResourceManager.GetString("MissingChannelIntergrityKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vault Settings are missing. Please import Vault Settings and verify the same. + /// + internal static string MissingVaultSettings { + get { + return ResourceManager.GetString("MissingVaultSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide both Source Nic and Recovery Target to update. + /// + internal static string NetworkArgumentsMissingForUpdateVmProperties { + get { + return ResourceManager.GetString("NetworkArgumentsMissingForUpdateVmProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creates a new in-memory protection profile association object.. + /// + internal static string NewProtectionProfileObjectWhatIfMessage { + get { + return ResourceManager.GetString("NewProtectionProfileObjectWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RecoveryServices client is null, please check Resource, Cloud Service information in Vault Settings. + /// + internal static string NullRecoveryServicesClient { + get { + return ResourceManager.GetString("NullRecoveryServicesClient", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Protection Container {0} is not associated with the Vault {1}. + /// + internal static string ProtectionContainerNotFound { + get { + return ResourceManager.GetString("ProtectionContainerNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Protection entity {0} is already disabled. + /// + internal static string ProtectionEntityAlreadyDisabled { + get { + return ResourceManager.GetString("ProtectionEntityAlreadyDisabled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Protection entity {0} is already enabled. + /// + internal static string ProtectionEntityAlreadyEnabled { + get { + return ResourceManager.GetString("ProtectionEntityAlreadyEnabled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Protection Entity {0} is not associated with Protection Container {1}. + /// + internal static string ProtectionEntityNotFound { + get { + return ResourceManager.GetString("ProtectionEntityNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Protection Entity {0} is not protected.. + /// + internal static string ProtectionEntityNotProtected { + get { + return ResourceManager.GetString("ProtectionEntityNotProtected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RecoveryPlan {0} is not associated with the Vault {1}. + /// + internal static string RecoveryPlanNotFound { + get { + return ResourceManager.GetString("RecoveryPlanNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure want to remove Recovery Plan {0}. + /// + internal static string RemoveRPWarning { + get { + return ResourceManager.GetString("RemoveRPWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Recovery Plan. + /// + internal static string RemoveRPWhatIfMessage { + get { + return ResourceManager.GetString("RemoveRPWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove Site {0}. + /// + internal static string RemoveSiteWarning { + get { + return ResourceManager.GetString("RemoveSiteWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removes Site. + /// + internal static string RemoveSiteWhatIfMessage { + get { + return ResourceManager.GetString("RemoveSiteWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove Vault {0}. + /// + internal static string RemoveVaultWarning { + get { + return ResourceManager.GetString("RemoveVaultWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removes Vault. + /// + internal static string RemoveVaultWhatIfMessage { + get { + return ResourceManager.GetString("RemoveVaultWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replication Start Time span value cannot be greater then 24 hours.. + /// + internal static string ReplicationStartTimeInvalid { + get { + return ResourceManager.GetString("ReplicationStartTimeInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource name mentioned is either null or empty. + /// + internal static string ResourceNameNullOrEmpty { + get { + return ResourceManager.GetString("ResourceNameNullOrEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Server {0} is not associated with the Vault {1}. + /// + internal static string ServerNotFound { + get { + return ResourceManager.GetString("ServerNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Site name {0} is not valid. Please try again with the correct site details.. + /// + internal static string SiteDetailsNotValid { + get { + return ResourceManager.GetString("SiteDetailsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please enter the storage account name details in the protection profile.. + /// + internal static string StorageAccountNameIsNotValid { + get { + return ResourceManager.GetString("StorageAccountNameIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Subscription or Storage account couldn’t be validated. For failovers to be successful, the Subscription should belong to your account, the Storage account to the Subscription and Storage account location must be the same as location of your Vault.. + /// + internal static string StorageAccountValidationUnsuccessful { + get { + return ResourceManager.GetString("StorageAccountValidationUnsuccessful", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Storage account given is in a different location as compared to the current vault. + ///Please provide a storage account with the same location as that of the vault.. + /// + internal static string StorageIsNotInTheSameLocationAsVault { + get { + return ResourceManager.GetString("StorageIsNotInTheSameLocationAsVault", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please enter the subscription ID details.. + /// + internal static string SubscriptionIdIsNotValid { + get { + return ResourceManager.GetString("SubscriptionIdIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription {0} is not associated with the account. + /// + internal static string SubscriptionIsNotAssociatedWithTheAccount { + get { + return ResourceManager.GetString("SubscriptionIsNotAssociatedWithTheAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not validate the storage account and subscription given. + ///Are you sure you want to continue {0}?. + /// + internal static string ValidationUnsuccessfulWarning { + get { + return ResourceManager.GetString("ValidationUnsuccessfulWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vault {0} cannot be deleted as it contains registered servers. Unregister them and then retry the operation.. + /// + internal static string VaultCannotBeDeleted { + get { + return ResourceManager.GetString("VaultCannotBeDeleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vault has been created. + /// + internal static string VaultCreationSuccessMessage { + get { + return ResourceManager.GetString("VaultCreationSuccessMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vault has been deleted. + /// + internal static string VaultDeletionSuccessMessage { + get { + return ResourceManager.GetString("VaultDeletionSuccessMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vault {0} is not associated with the given subscription.. + /// + internal static string VaultNotFound { + get { + return ResourceManager.GetString("VaultNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vault settings file not found, please pass the file downloaded from portal. + /// + internal static string VaultSettingFileNotFound { + get { + return ResourceManager.GetString("VaultSettingFileNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot generate vault settings file for this vault. Download it from the Azure Portal.. + /// + internal static string VaultSettingsGenerationUnSupported { + get { + return ResourceManager.GetString("VaultSettingsGenerationUnSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Virtual Machine Group {0} is not associated with Protection Container {1}. + /// + internal static string VirtualMachineGroupNotFound { + get { + return ResourceManager.GetString("VirtualMachineGroupNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Virtual Machine {0} is not associated with Protection Container {1}. + /// + internal static string VirtualMachineNotFound { + get { + return ResourceManager.GetString("VirtualMachineNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Waiting for completion. + /// + internal static string WaitingForCompletion { + get { + return ResourceManager.GetString("WaitingForCompletion", resourceCulture); + } + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/Resources.resx b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/Resources.resx new file mode 100644 index 000000000000..efae6ac8868c --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/Resources.resx @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Operation Failed. +Message: {0} +Possible Causes: {1} +Recommended Action: {2} +ClientRequestId: {3} + + + Cloud Service name mentioned is either null or empty + + + Operation failed. +{0} + + + Resource Group is not associated with the selected Subscription + + + Resource is not associted with the selected Cloud Service + + + XML is malformed or file is empty, exception details: {0} + + + Vault Settings are missing. Please import Vault Settings and verify the same + + + RecoveryServices client is null, please check Resource, Cloud Service information in Vault Settings + + + Protection Container {0} is not associated with the Vault {1} + + + RecoveryPlan {0} is not associated with the Vault {1} + + + Resource name mentioned is either null or empty + + + Server {0} is not associated with the Vault {1} + + + Vault settings file not found, please pass the file downloaded from portal + + + Virtual Machine {0} is not associated with Protection Container {1} + + + Virtual Machine Group {0} is not associated with Protection Container {1} + + + Protection Entity {0} is not associated with Protection Container {1} + + + Protection Entity {0} is not protected. + + + Vault Key value is missing. Please import Vault Settings and verify the same + + + Waiting for completion + + + Are you sure want to disable protection on {0} + + + {0}s protection + + + Are you sure want to remove Recovery Plan {0} + + + Removing Recovery Plan + + + Subscription {0} is not associated with the account + + + Protection entity {0} is already disabled + + + Protection entity {0} is already enabled + + + AzureVMNetwork {0} is not associated with the Subscription {1} + + + Cannot generate vault settings file for this vault. Download it from the Azure Portal. + + + Vault has been created + + + Replication Start Time span value cannot be greater then 24 hours. + + + Please enter the storage account name details in the protection profile. + + + Please enter the subscription ID details. + + + Replication Provider {0} entered invalid for the current set of parameters. + + + Please provide required VM properties to update + + + Please provide both Source Nic and Recovery Target to update + + + {0} will be a mandatory paramter from next release. + + + Calls using ID based parameter {0} will not be supported from next release. Please use its corresponding full object parameter instead. + + + Replication Frequency {0} is invalid + + + Vault {0} is not associated with the given subscription. + + + Vault information (Name: {0}, Location: {1}) is not correct + + + Creates a new in-memory protection profile association object. + + + Could not validate the storage account and subscription given. +Are you sure you want to continue {0}? + + + Storage account given is in a different location as compared to the current vault. +Please provide a storage account with the same location as that of the vault. + + + The Subscription or Storage account couldn’t be validated. For failovers to be successful, the Subscription should belong to your account, the Storage account to the Subscription and Storage account location must be the same as location of your Vault. + + + Are you sure you want to remove Site {0} + + + Removes Site + + + Are you sure you want to remove Vault {0} + + + Removes Vault + + + Site name {0} is not valid. Please try again with the correct site details. + + + Vault has been deleted + + + Vault {0} cannot be deleted as it contains registered servers. Unregister them and then retry the operation. + + \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionContainer/GetAzureSiteRecoveryProtectionContainer.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionContainer/GetAzureSiteRecoveryProtectionContainer.cs new file mode 100644 index 000000000000..e733a363b6e4 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionContainer/GetAzureSiteRecoveryProtectionContainer.cs @@ -0,0 +1,143 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Management.Automation; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Retrieves Azure Site Recovery Protection Container. + /// + [Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryProtectionContainer", DefaultParameterSetName = ASRParameterSets.Default)] + [OutputType(typeof(IEnumerable))] + public class GetAzureSiteRecoveryProtectionContainer : SiteRecoveryCmdletBase + { + #region Parameters + /// + /// Gets or sets ID of the Protection Container. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + /// + /// Gets or sets name of the Protection Container. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByFriendlyName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FriendlyName { get; set; } + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByFriendlyName: + this.GetByFriendlyName(); + break; + case ASRParameterSets.ByName: + this.GetByName(); + break; + case ASRParameterSets.Default: + this.GetByDefault(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Queries by Friendly name. + /// + private void GetByFriendlyName() + { + ProtectionContainerListResponse protectionContainerListResponse = + RecoveryServicesClient.GetAzureSiteRecoveryProtectionContainer(); + + bool found = false; + foreach ( + ProtectionContainer protectionContainer in + protectionContainerListResponse.ProtectionContainers) + { + if (0 == string.Compare(this.FriendlyName, protectionContainer.Properties.FriendlyName, true)) + { + this.WriteProtectionContainer(protectionContainer); + found = true; + } + } + + if (!found) + { + throw new InvalidOperationException( + string.Format( + Properties.Resources.ProtectionContainerNotFound, + this.FriendlyName, + PSRecoveryServicesClient.asrVaultCreds.ResourceName)); + } + } + + /// + /// Queries by Name. + /// + private void GetByName() + { + ProtectionContainerResponse protectionContainerResponse = + RecoveryServicesClient.GetAzureSiteRecoveryProtectionContainer(this.Name); + + this.WriteProtectionContainer(protectionContainerResponse.ProtectionContainer); + } + + /// + /// Queries all, by default. + /// + private void GetByDefault() + { + ProtectionContainerListResponse protectionContainerListResponse = + RecoveryServicesClient.GetAzureSiteRecoveryProtectionContainer(); + + this.WriteProtectionContainers(protectionContainerListResponse.ProtectionContainers); + } + + /// + /// Writes Protection Containers. + /// + /// List of Protection Containers + private void WriteProtectionContainers(IList protectionContainers) + { + this.WriteObject(protectionContainers.Select(pc => new ASRProtectionContainer(pc)), true); + } + + /// + /// Write Protection Container. + /// + /// Protection Container + private void WriteProtectionContainer(ProtectionContainer protectionContainer) + { + this.WriteObject(new ASRProtectionContainer(protectionContainer)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/GetAzureSiteRecoveryProtectionEntity.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/GetAzureSiteRecoveryProtectionEntity.cs new file mode 100644 index 000000000000..536457160936 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/GetAzureSiteRecoveryProtectionEntity.cs @@ -0,0 +1,154 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Management.Automation; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Retrieves Azure Site Recovery Protection Entity. + /// + [Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryProtectionEntity", DefaultParameterSetName = ASRParameterSets.ByObject)] + [OutputType(typeof(IEnumerable))] + public class GetAzureSiteRecoveryProtectionEntity : SiteRecoveryCmdletBase + { + #region Parameters + /// + /// Gets or sets Name of the Protection Entity. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByObjectWithName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + /// + /// Gets or sets friendly name of the Protection Entity. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByObjectWithFriendlyName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FriendlyName { get; set; } + + /// + /// Gets or sets Server Object. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByObject, Mandatory = true, ValueFromPipeline = true)] + [Parameter(ParameterSetName = ASRParameterSets.ByObjectWithName, Mandatory = true)] + [Parameter(ParameterSetName = ASRParameterSets.ByObjectWithFriendlyName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionContainer ProtectionContainer { get; set; } + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByObject: + this.GetAll(); + break; + case ASRParameterSets.ByObjectWithName: + this.GetByName(); + break; + case ASRParameterSets.ByObjectWithFriendlyName: + this.GetByFriendlyName(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Queries by friendly name. + /// + private void GetByFriendlyName() + { + ProtectionEntityListResponse protectionEntityListResponse = + RecoveryServicesClient.GetAzureSiteRecoveryProtectionEntity( + this.ProtectionContainer.Name); + + bool found = false; + foreach (ProtectionEntity pe in protectionEntityListResponse.ProtectionEntities) + { + if (0 == string.Compare(this.FriendlyName, pe.Properties.FriendlyName, true)) + { + this.WriteProtectionEntity(pe); + found = true; + } + } + + if (!found) + { + throw new InvalidOperationException( + string.Format( + Properties.Resources.ProtectionEntityNotFound, + this.FriendlyName, + this.ProtectionContainer.FriendlyName)); + } + } + + /// + /// Queries by Name. + /// + private void GetByName() + { + ProtectionEntityResponse protectionEntityResponse = + RecoveryServicesClient.GetAzureSiteRecoveryProtectionEntity( + this.ProtectionContainer.Name, + this.Name); + + this.WriteProtectionEntity(protectionEntityResponse.ProtectionEntity); + } + + /// + /// Queries all Protection Entities under given Protection Container. + /// + private void GetAll() + { + ProtectionEntityListResponse protectionEntityListResponse = + RecoveryServicesClient.GetAzureSiteRecoveryProtectionEntity( + this.ProtectionContainer.Name); + + this.WriteProtectionEntities(protectionEntityListResponse.ProtectionEntities); + } + + /// + /// Writes Protection Entities. + /// + /// Protection Entities + private void WriteProtectionEntities(IList protectionEntities) + { + this.WriteObject(protectionEntities.Select(pe => new ASRProtectionEntity(pe)), true); + } + + /// + /// Writes Protection Entity. + /// + /// Protection Entity + private void WriteProtectionEntity(ProtectionEntity pe) + { + this.WriteObject(new ASRProtectionEntity(pe)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/SetAzureSiteRecoveryProtectionEntity.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/SetAzureSiteRecoveryProtectionEntity.cs new file mode 100644 index 000000000000..847570f4c423 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/SetAzureSiteRecoveryProtectionEntity.cs @@ -0,0 +1,150 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Azure.Management.SiteRecovery.Models; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Set Protection Entity protection state. + /// + [Cmdlet(VerbsCommon.Set, "AzureSiteRecoveryProtectionEntity", DefaultParameterSetName = ASRParameterSets.ByPEObject, SupportsShouldProcess = true)] + [OutputType(typeof(ASRJob))] + public class SetAzureSiteRecoveryProtectionEntity : SiteRecoveryCmdletBase + { + #region Parameters + /// + /// Job response. + /// + private LongRunningOperationResponse response = null; + + /// + /// Protection Status of the entity. + /// + private bool alreadyEnabled = false; + + /// + /// Holds either Name (if object is passed) or ID (if IDs are passed) of the PE. + /// + private string targetNameOrId = string.Empty; + + /// + /// Gets or sets Protection Entity Object. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByPEObject, Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionEntity ProtectionEntity { get; set; } + + /// + /// Gets or sets Protection to set, either enable or disable. + /// + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + [ValidateSet( + Constants.EnableProtection, + Constants.DisableProtection)] + public string Protection { get; set; } + + /// + /// Gets or sets switch parameter. On passing, command waits till completion. + /// + [Parameter] + public SwitchParameter WaitForCompletion { get; set; } + + /// + /// Gets or sets switch parameter. On passing, command does not ask for confirmation. + /// + [Parameter] + public SwitchParameter Force { get; set; } + + JobResponse jobResponse = null; + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByPEObject: + this.targetNameOrId = this.ProtectionEntity.FriendlyName; + break; + } + + this.ConfirmAction( + this.Force.IsPresent || 0 != string.CompareOrdinal(this.Protection, Constants.DisableProtection), + string.Format(Properties.Resources.DisableProtectionWarning, this.targetNameOrId), + string.Format(Properties.Resources.DisableProtectionWhatIfMessage, this.Protection), + this.targetNameOrId, + () => + { + try + { + // ADD SOME VALIDATIONS + + if (this.Protection == Constants.EnableProtection) + { + EnableProtectionInput input = new EnableProtectionInput(); + + this.response = + RecoveryServicesClient.EnableProtection( + this.ProtectionEntity.ProtectionContainerId, + this.ProtectionEntity.Name, + input); + } + else + { + DisableProtectionInput input = new DisableProtectionInput(); + + this.response = + RecoveryServicesClient.DisableProtection( + this.ProtectionEntity.ProtectionContainerId, + this.ProtectionEntity.Name, + input); + } + + jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + WriteObject(new ASRJob(jobResponse.Job)); + + if (this.WaitForCompletion.IsPresent) + { + this.WaitForJobCompletion(this.jobResponse.Job.Name); + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + }); + } + + /// + /// Writes Job. + /// + /// JOB object + private void WriteJob(Microsoft.Azure.Management.SiteRecovery.Models.Job job) + { + this.WriteObject(new ASRJob(job)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryCommitFailoverJob.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryCommitFailoverJob.cs new file mode 100644 index 000000000000..9bf5c2095fee --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryCommitFailoverJob.cs @@ -0,0 +1,124 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Diagnostics; +using System.Management.Automation; +using System.Threading; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Used to initiate a commit operation. + /// + [Cmdlet(VerbsLifecycle.Start, "AzureSiteRecoveryCommitFailoverJob", DefaultParameterSetName = ASRParameterSets.ByPEObject)] + [OutputType(typeof(ASRJob))] + public class StartAzureSiteRecoveryCommitFailoverJob : SiteRecoveryCmdletBase + { + /// + /// Gets or sets ID of the PE. + /// + public string protectionEntityId; + + /// + /// Gets or sets ID of the Protection Container. + /// + public string protectionContainerId; + + #region Parameters + /// + /// Gets or sets Protection Entity object. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByPEObject, Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionEntity ProtectionEntity { get; set; } + + /// + /// Gets or sets Failover direction for the recovery plan. + /// + [Parameter(Mandatory = false)] + [ValidateSet( + Constants.PrimaryToRecovery, + Constants.RecoveryToPrimary)] + public string Direction { get; set; } + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByPEObject: + this.protectionEntityId = this.ProtectionEntity.Name; + this.protectionContainerId = this.ProtectionEntity.ProtectionContainerId; + this.SetPECommit(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Start PE Commit. + /// + private void SetPECommit() + { + var request = new CommitFailoverRequest(); + + if (this.ProtectionEntity == null) + { + var pe = RecoveryServicesClient.GetAzureSiteRecoveryProtectionEntity( + this.protectionContainerId, + this.protectionEntityId); + this.ProtectionEntity = new ASRProtectionEntity(pe.ProtectionEntity); + + this.ValidateUsageById( + this.ProtectionEntity.ReplicationProvider, + Constants.ProtectionEntityId); + } + + request.ReplicationProvider = this.ProtectionEntity.ReplicationProvider; + request.ReplicationProviderSettings = string.Empty; + request.FailoverDirection = this.Direction; + + //if (this.ProtectionEntity.ActiveLocation == Constants.PrimaryLocation) + //{ + // request.FailoverDirection = Constants.RecoveryToPrimary; + //} + //else + //{ + // request.FailoverDirection = Constants.PrimaryToRecovery; + //} + + LongRunningOperationResponse response = RecoveryServicesClient.StartAzureSiteRecoveryCommitFailover( + this.protectionContainerId, + this.protectionEntityId, + request); + + JobResponse jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + WriteObject(new ASRJob(jobResponse.Job)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryPlannedFailoverJob.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryPlannedFailoverJob.cs new file mode 100644 index 000000000000..ae72f7c02df6 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryPlannedFailoverJob.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.Management.Automation; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Used to initiate a failover operation. + /// + [Cmdlet(VerbsLifecycle.Start, "AzureSiteRecoveryPlannedFailoverJob", DefaultParameterSetName = ASRParameterSets.ByPEObject)] + [OutputType(typeof(ASRJob))] + public class StartAzureSiteRecoveryPlannedFailoverJob : SiteRecoveryCmdletBase + { + /// + /// Gets or sets ID of the PE. + /// + public string protectionEntityId; + + /// + /// Gets or sets ID of the Protection Container. + /// + public string protectionContainerId; + + #region Parameters + /// + /// Gets or sets Protection Entity object. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByPEObject, Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionEntity ProtectionEntity { get; set; } + + /// + /// Gets or sets Failover direction for the recovery plan. + /// + [Parameter(Mandatory = true)] + [ValidateSet( + Constants.PrimaryToRecovery, + Constants.RecoveryToPrimary)] + public string Direction { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByPEObject: + this.protectionEntityId = this.ProtectionEntity.Name; + this.protectionContainerId = this.ProtectionEntity.ProtectionContainerId; + this.StartPEPlannedFailover(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Starts PE Planned failover. + /// + private void StartPEPlannedFailover() + { + var request = new PlannedFailoverRequest(); + + if (this.ProtectionEntity == null) + { + var pe = RecoveryServicesClient.GetAzureSiteRecoveryProtectionEntity( + this.protectionContainerId, + this.protectionEntityId); + this.ProtectionEntity = new ASRProtectionEntity(pe.ProtectionEntity); + + this.ValidateUsageById(this.ProtectionEntity.ReplicationProvider, Constants.ProtectionEntityId); + } + + request.ReplicationProviderSettings = string.Empty; + + request.ReplicationProvider = this.ProtectionEntity.ReplicationProvider; + request.FailoverDirection = this.Direction; + + LongRunningOperationResponse response = + RecoveryServicesClient.StartAzureSiteRecoveryPlannedFailover( + this.protectionContainerId, + this.protectionEntityId, + request); + + JobResponse jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + WriteObject(new ASRJob(jobResponse.Job)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryTestFailoverJob.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryTestFailoverJob.cs new file mode 100644 index 000000000000..1ad68a8014ef --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryTestFailoverJob.cs @@ -0,0 +1,137 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Azure.Portal.RecoveryServices.Models.Common; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Used to initiate a commit operation. + /// + [Cmdlet(VerbsLifecycle.Start, "AzureSiteRecoveryTestFailoverJob", DefaultParameterSetName = ASRParameterSets.ByPEObject)] + [OutputType(typeof(ASRJob))] + public class StartAzureSiteRecoveryTestFailoverJob : SiteRecoveryCmdletBase + { + #region Parameters + + /// + /// Network ID. + /// + private string networkId = string.Empty; + + /// + /// Network Type (Logical network or VM network). + /// + private string networkType = string.Empty; + + /// + /// Gets or sets failover direction for the recovery plan. + /// + [Parameter(Mandatory = true)] + [ValidateSet( + Constants.PrimaryToRecovery, + Constants.RecoveryToPrimary)] + public string Direction { get; set; } + + /// + /// Gets or sets Protection Entity object. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByPEObject, Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionEntity ProtectionEntity { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByPEObject: + this.networkType = "DisconnectedVMNetworkTypeForTestFailover"; + this.UpdateRequiredParametersAndStartFailover(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Starts PE Test failover. + /// + private void StartPETestFailover() + { + var request = new TestFailoverRequest(); + + if (this.ProtectionEntity == null) + { + var pe = RecoveryServicesClient.GetAzureSiteRecoveryProtectionEntity( + this.ProtectionEntity.ProtectionContainerId, + this.ProtectionEntity.Name); + this.ProtectionEntity = new ASRProtectionEntity(pe.ProtectionEntity); + + /* this.ValidateUsageById( + this.ProtectionEntity.ReplicationProvider, + Constants.ProtectionEntityId); */ + } + + request.ReplicationProviderSettings = string.Empty; + + request.ReplicationProvider = this.ProtectionEntity.ReplicationProvider; + request.FailoverDirection = this.Direction; + + request.NetworkID = this.networkId; + request.NetworkType = this.networkType; + + LongRunningOperationResponse response = + RecoveryServicesClient.StartAzureSiteRecoveryTestFailover( + this.ProtectionEntity.ProtectionContainerId, + this.ProtectionEntity.Name, + request); + + JobResponse jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + WriteObject(new ASRJob(jobResponse.Job)); + } + + /// + /// Updates required parameters and starts test failover. + /// + private void UpdateRequiredParametersAndStartFailover() + { + /* if (!this.ProtectionEntity.Protected) + { + throw new InvalidOperationException( + string.Format( + Properties.Resources.ProtectionEntityNotProtected, + this.ProtectionEntity.Name)); + } */ + + this.StartPETestFailover(); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryUnPlannedFailoverJob.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryUnPlannedFailoverJob.cs new file mode 100644 index 000000000000..f3c8c29301b3 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/StartAzureSiteRecoveryUnPlannedFailoverJob.cs @@ -0,0 +1,125 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Diagnostics; +using System.Management.Automation; +using System.Threading; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Used to initiate a failover operation. + /// + [Cmdlet(VerbsLifecycle.Start, "AzureSiteRecoveryUnplannedFailoverJob", DefaultParameterSetName = ASRParameterSets.ByPEObject)] + [OutputType(typeof(ASRJob))] + public class StartAzureSiteRecoveryUnplannedFailoverJob : SiteRecoveryCmdletBase + { + /// + /// Gets or sets ID of the PE. + /// + public string protectionEntityId; + + /// + /// Gets or sets ID of the Protection Container. + /// + public string protectionContainerId; + + #region Parameters + + /// + /// Gets or sets Protection Entity object. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByPEObject, Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionEntity ProtectionEntity { get; set; } + + /// + /// Gets or sets Failover direction for the recovery plan. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByPEObject, Mandatory = true)] + [ValidateSet( + Constants.PrimaryToRecovery, + Constants.RecoveryToPrimary)] + public string Direction { get; set; } + + /// + /// Gets or sets switch parameter. This is required to PerformSourceSideActions. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByPEObject, Mandatory = false)] + public SwitchParameter PerformSourceSideActions { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByPEObject: + this.protectionEntityId = this.ProtectionEntity.Name; + this.protectionContainerId = this.ProtectionEntity.ProtectionContainerId; + this.StartPEUnplannedFailover(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Starts PE Unplanned failover. + /// + private void StartPEUnplannedFailover() + { + var request = new UnplannedFailoverRequest(); + if (this.ProtectionEntity == null) + { + var pe = RecoveryServicesClient.GetAzureSiteRecoveryProtectionEntity( + this.protectionContainerId, + this.protectionEntityId); + this.ProtectionEntity = new ASRProtectionEntity(pe.ProtectionEntity); + + this.ValidateUsageById( + this.ProtectionEntity.ReplicationProvider, + Constants.ProtectionEntityId); + } + + request.ReplicationProviderSettings = string.Empty; + + request.ReplicationProvider = this.ProtectionEntity.ReplicationProvider; + request.FailoverDirection = this.Direction; + request.SourceSiteOperations = this.PerformSourceSideActions ? Constants.Required : Constants.NotRequired; + LongRunningOperationResponse response = + RecoveryServicesClient.StartAzureSiteRecoveryUnplannedFailover( + this.protectionContainerId, + this.protectionEntityId, + request); + + JobResponse jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + WriteObject(new ASRJob(jobResponse.Job)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/UpdateAzureSiteRecoveryProtectionDirection.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/UpdateAzureSiteRecoveryProtectionDirection.cs new file mode 100644 index 000000000000..8bf1665b3463 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionEntity/UpdateAzureSiteRecoveryProtectionDirection.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.Management.Automation; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using Microsoft.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Used to initiate a recovery protection operation. + /// + [Cmdlet(VerbsData.Update, "AzureSiteRecoveryProtectionDirection", DefaultParameterSetName = ASRParameterSets.ByPEObject)] + [OutputType(typeof(ASRJob))] + public class UpdateAzureSiteRecoveryProtection : SiteRecoveryCmdletBase + { + /// + /// Gets or sets ID of the PE. + /// + public string protectionEntityId; + + /// + /// Gets or sets ID of the Protection Container. + /// + public string protectionContainerId; + + #region Parameters + /// + /// Gets or sets Protection Entity object. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByPEObject, Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionEntity ProtectionEntity { get; set; } + + /// + /// Gets or sets Failover direction for the recovery plan. + /// + [Parameter(Mandatory = true)] + [ValidateSet( + Constants.PrimaryToRecovery, + Constants.RecoveryToPrimary)] + public string Direction { get; set; } + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByPEObject: + this.protectionEntityId = this.ProtectionEntity.Name; + this.protectionContainerId = this.ProtectionEntity.ProtectionContainerId; + this.SetPEReprotect(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Set PE protection. + /// + private void SetPEReprotect() + { + var request = new ReprotectRequest(); + + if (this.ProtectionEntity == null) + { + var pe = RecoveryServicesClient.GetAzureSiteRecoveryProtectionEntity( + this.protectionContainerId, + this.protectionEntityId); + this.ProtectionEntity = new ASRProtectionEntity(pe.ProtectionEntity); + + this.ValidateUsageById( + this.ProtectionEntity.ReplicationProvider, + this.protectionEntityId); + } + + request.ReplicationProviderSettings = string.Empty; + + request.ReplicationProvider = this.ProtectionEntity.ReplicationProvider; + request.FailoverDirection = this.Direction; + + LongRunningOperationResponse response = RecoveryServicesClient.StartAzureSiteRecoveryReprotection( + this.protectionContainerId, + this.protectionEntityId, + request); + + JobResponse jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + WriteObject(new ASRJob(jobResponse.Job)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/GetAzureSiteRecoveryProtectionProfile.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/GetAzureSiteRecoveryProtectionProfile.cs new file mode 100644 index 000000000000..0366d7d3811e --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/GetAzureSiteRecoveryProtectionProfile.cs @@ -0,0 +1,130 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Management.Automation; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Retrieves Azure Site Recovery Server. + /// + [Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryProtectionProfile", DefaultParameterSetName = ASRParameterSets.Default)] + [OutputType(typeof(IEnumerable))] + public class GetAzureSiteRecoveryProtectionProfile : SiteRecoveryCmdletBase + { + #region Parameters + /// + /// Gets or sets ID of the Server. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + /// + /// Gets or sets name of the Server. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByFriendlyName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FriendlyName { get; set; } + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByFriendlyName: + this.GetByFriendlyName(); + break; + case ASRParameterSets.ByName: + this.GetByName(); + break; + case ASRParameterSets.Default: + this.GetAll(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Queries by Friendly name. + /// + private void GetByFriendlyName() + { + ProtectionProfileListResponse profileListResponse = + RecoveryServicesClient.GetAzureSiteRecoveryProtectionProfile(); + + foreach (ProtectionProfile profile in profileListResponse.ProtectionProfiles) + { + if (0 == string.Compare(this.FriendlyName, profile.CustomData.FriendlyName, true)) + { + this.WriteProfile(profile); + } + } + } + + /// + /// Queries by Name. + /// + private void GetByName() + { + ProtectionProfileResponse profileResponse = + RecoveryServicesClient.GetAzureSiteRecoveryProtectionProfile(this.Name); + + this.WriteProfile(profileResponse.ProtectionProfile); + } + + /// + /// Queries all / by default. + /// + private void GetAll() + { + ProtectionProfileListResponse profileListResponse = + RecoveryServicesClient.GetAzureSiteRecoveryProtectionProfile(); + + this.WriteProfiles(profileListResponse.ProtectionProfiles); + } + + /// + /// Write Protection profiles. + /// + /// List of Profiles + private void WriteProfiles(IList profiles) + { + this.WriteObject(profiles.Select(p => new ASRProtectionProfile(p)), true); + } + + /// + /// Write Profile. + /// + /// Profile object + private void WriteProfile(ProtectionProfile profile) + { + this.WriteObject(new ASRProtectionProfile(profile)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/NewAzureSiteRecoveryProtectionProfile.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/NewAzureSiteRecoveryProtectionProfile.cs new file mode 100644 index 000000000000..dd8cd5bed180 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/NewAzureSiteRecoveryProtectionProfile.cs @@ -0,0 +1,198 @@ +// ---------------------------------------------------------------------------------- +// +// 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.ComponentModel; +using System.Management.Automation; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using Microsoft.WindowsAzure.Commands.Common.Properties; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Creates Azure Site Recovery Protection Profile object in memory. + /// + [Cmdlet(VerbsCommon.New, "AzureSiteRecoveryProtectionProfile")] + public class NewAzureSiteRecoveryProtectionProfile : SiteRecoveryCmdletBase + { + /// + /// Holds Name (if passed) of the protection profile object. + /// + private string targetName = string.Empty; + + #region Parameters + + /// + /// Gets or sets Name of the Protection Profile. + /// + [Parameter] + public string Name { get; set; } + + /// + /// Gets or sets Replication Provider of the Protection Profile. + /// + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + [ValidateSet( + Constants.HyperVReplica)] + public string ReplicationProvider { get; set; } + + /// + /// Gets or sets a value for Replication Method of the Protection Profile. + /// + [Parameter] + [ValidateNotNullOrEmpty] + [ValidateSet( + Constants.OnlineReplicationMethod, + Constants.OfflineReplicationMethod)] + public string ReplicationMethod { get; set; } + + /// + /// Gets or sets Replication Frequency of the Protection Profile in seconds. + /// + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + [ValidateSet( + Constants.Thirty, + Constants.ThreeHundred, + Constants.NineHundred)] + public string ReplicationFrequencyInSeconds { get; set; } + + /// + /// Gets or sets Recovery Points of the Protection Profile. + /// + [Parameter] + [ValidateNotNullOrEmpty] + [DefaultValue(0)] + public int RecoveryPoints { get; set; } + + /// + /// Gets or sets Application Consistent Snapshot Frequency of the Protection Profile in hours. + /// + [Parameter] + [ValidateNotNullOrEmpty] + [DefaultValue(0)] + public int ApplicationConsistentSnapshotFrequencyInHours { get; set; } + + /// + /// Gets or sets a value indicating whether Compression needs to be Enabled on the Protection Profile. + /// + [Parameter] + [DefaultValue(false)] + public SwitchParameter CompressionEnabled { get; set; } + + /// + /// Gets or sets the Replication Port of the Protection Profile. + /// + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public ushort ReplicationPort { get; set; } + + /// + /// Gets or sets the Replication Port of the Protection Profile. + /// + [Parameter] + [ValidateNotNullOrEmpty] + [ValidateSet( + Constants.AuthenticationTypeCertificate, + Constants.AuthenticationTypeKerberos)] + public string Authentication { get; set; } + + /// + /// Gets or sets Replication Start time of the Protection Profile. + /// + [Parameter] + [ValidateNotNullOrEmpty] + public TimeSpan? ReplicationStartTime { get; set; } + + /// + /// Gets or sets a value indicating whether Replica should be Deleted on + /// disabling protection of a protection entity protected by the Protection Profile. + /// + [Parameter] + [DefaultValue(false)] + public SwitchParameter AllowReplicaDeletion { get; set; } + + /// + /// Gets or sets switch parameter. On passing, command does not ask for confirmation. + /// + [Parameter] + public SwitchParameter Force { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + this.EnterpriseToEnterpriseProtectionProfileObject(); + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Creates an E2E Protection Profile object + /// + private void EnterpriseToEnterpriseProtectionProfileObject() + { + if (string.Compare(this.ReplicationProvider, Constants.HyperVReplica, StringComparison.OrdinalIgnoreCase) != 0) + { + throw new InvalidOperationException( + string.Format( + Properties.Resources.IncorrectReplicationProvider, + this.ReplicationProvider)); + } + + PSRecoveryServicesClient.ValidateReplicationStartTime(this.ReplicationStartTime); + + ushort replicationFrequencyInSeconds = PSRecoveryServicesClient.ConvertReplicationFrequencyToUshort(this.ReplicationFrequencyInSeconds); + + HyperVReplicaProtectionProfileInput hyperVReplicaProtectionProfileInput + = new HyperVReplicaProtectionProfileInput() + { + ApplicationConsistentSnapshotFrequencyInHours = this.ApplicationConsistentSnapshotFrequencyInHours, + ReplicationFrequencyInSeconds = replicationFrequencyInSeconds, + OnlineReplicationStartTime = this.ReplicationStartTime, + Compression = this.CompressionEnabled == true ? "Enable" : "Disable", + InitialReplicationMethod = (string.Compare(this.ReplicationMethod, Constants.OnlineReplicationMethod, StringComparison.OrdinalIgnoreCase) == 0) ? "OverNetwork" : "Offline", + RecoveryPoints = this.RecoveryPoints, + ReplicationPort = this.ReplicationPort, + ReplicaDeletion = this.AllowReplicaDeletion == true ? "Required" : "NotRequired", + AllowedAuthenticationType = (ushort)((string.Compare(this.Authentication, Constants.AuthenticationTypeKerberos, StringComparison.OrdinalIgnoreCase) == 0) ? 1 : 2) + }; + + CreateProtectionProfileInput createProtectionProfileInput = new CreateProtectionProfileInput(); + createProtectionProfileInput.Name = this.Name; + createProtectionProfileInput.ReplicationProvider = this.ReplicationProvider; + createProtectionProfileInput.ReplicationProviderSettings = hyperVReplicaProtectionProfileInput; + + LongRunningOperationResponse response = + RecoveryServicesClient.CreateProtectionProfile(createProtectionProfileInput); + + JobResponse jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + WriteObject(new ASRJob(jobResponse.Job)); + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/RemoveAzureSiteRecoveryProtectionProfile.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/RemoveAzureSiteRecoveryProtectionProfile.cs new file mode 100644 index 000000000000..110444e94cfe --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/RemoveAzureSiteRecoveryProtectionProfile.cs @@ -0,0 +1,62 @@ +// ---------------------------------------------------------------------------------- +// +// 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.ComponentModel; +using System.Management.Automation; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using Microsoft.WindowsAzure.Commands.Common.Properties; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Creates Azure Site Recovery Protection Profile object in memory. + /// + [Cmdlet(VerbsCommon.Remove, "AzureSiteRecoveryProtectionProfile")] + public class RemoveAzureSiteRecoveryProtectionProfile : SiteRecoveryCmdletBase + { + #region Parameters + + /// + /// Gets or sets Name of the Protection Profile. + /// + [Parameter(Mandatory = true)] + public ASRProtectionProfile ProtectionProfile { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + LongRunningOperationResponse response = RecoveryServicesClient.DeleteProtectionProfile(this.ProtectionProfile.Name); + + JobResponse jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + WriteObject(new ASRJob(jobResponse.Job)); + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/StartAzureSiteRecoveryProtectionProfileAssociationJob.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/StartAzureSiteRecoveryProtectionProfileAssociationJob.cs new file mode 100644 index 000000000000..64dbc5d48bde --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/StartAzureSiteRecoveryProtectionProfileAssociationJob.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.Management.Automation; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Adds Azure Site Recovery Protection Profile settings to a Protection Container. + /// + [Cmdlet(VerbsLifecycle.Start, "AzureSiteRecoveryProtectionProfileAssociationJob")] + // [OutputType(typeof(ASRJob))] + public class StartAzureSiteRecoveryProtectionProfileAssociationJob : SiteRecoveryCmdletBase + { + #region Parameters + + /// + /// Gets or sets Protection Profile object. + /// + [Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionProfile ProtectionProfile { get; set; } + + /// + /// Gets or sets Protection Container to be applied the Protection Profile settings on. + /// + [Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionContainer PrimaryProtectionContainer { get; set; } + + /// + /// Gets or sets Recovery Protection Container to be applied the Protection Profile settings on. + /// + [Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionContainer RecoveryProtectionContainer { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + this.EnterpriseToEnterpriseAssociation(); + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Associates protection profile with enterprise based protection containers + /// + private void EnterpriseToEnterpriseAssociation() + { + if (string.Compare( + this.ProtectionProfile.ReplicationProvider, + Constants.HyperVReplica, + StringComparison.OrdinalIgnoreCase) != 0 && + string.Compare( + this.ProtectionProfile.ReplicationProvider, + Constants.San, + StringComparison.OrdinalIgnoreCase) != 0) + { + throw new InvalidOperationException( + string.Format( + Properties.Resources.IncorrectReplicationProvider, + this.ProtectionProfile.ReplicationProvider)); + } + + ProtectionProfileAssociationInput protectionProfileAssociationInput = + new ProtectionProfileAssociationInput( + this.PrimaryProtectionContainer.Name, + this.RecoveryProtectionContainer.Name); + + LongRunningOperationResponse response = RecoveryServicesClient.AssociateAzureSiteRecoveryProtectionProfile( + this.ProtectionProfile.Name, + protectionProfileAssociationInput); + + JobResponse jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + this.WriteObject(new ASRJob(jobResponse.Job)); + } + + ///// + ///// Writes Job + ///// + ///// Job object + //private void WriteJob(Microsoft.WindowsAzure.Management.SiteRecovery.Models.Job job) + //{ + // this.WriteObject(new ASRJob(job)); + //} + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/StartAzureSiteRecoveryProtectionProfileDissociationJob.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/StartAzureSiteRecoveryProtectionProfileDissociationJob.cs new file mode 100644 index 000000000000..f75667c55354 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/ProtectionProfile/StartAzureSiteRecoveryProtectionProfileDissociationJob.cs @@ -0,0 +1,90 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Azure.Management.SiteRecovery.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Adds Azure Site Recovery Protection Profile settings to a Protection Container. + /// + [Cmdlet(VerbsLifecycle.Start, "AzureSiteRecoveryProtectionProfileDissociationJob")] + // [OutputType(typeof(ASRJob))] + public class StartAzureSiteRecoveryProtectionProfileDissociationJob : SiteRecoveryCmdletBase + { + /// + /// Job response. + /// + private LongRunningOperationResponse response = null; + + #region Parameters + + /// + /// Gets or sets Protection Profile object. + /// + [Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionProfile ProtectionProfile { get; set; } + + /// + /// Gets or sets Protection Container to be removed the Protection Profile settings off. + /// + [Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionContainer PrimaryProtectionContainer { get; set; } + + /// + /// Gets or sets Protection Container to be removed the Protection Profile settings off. + /// + [Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = true)] + [ValidateNotNullOrEmpty] + public ASRProtectionContainer RecoveryProtectionContainer { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + string recoveryContainerId = string.Empty; + recoveryContainerId = this.RecoveryProtectionContainer.ID; + + DisassociateProtectionProfileInput disassociateProtectionProfileInput = new DisassociateProtectionProfileInput(); + disassociateProtectionProfileInput.PrimaryProtectionContainerId = this.PrimaryProtectionContainer.Name; + disassociateProtectionProfileInput.RecoveryProtectionContainerId = this.RecoveryProtectionContainer.Name; + disassociateProtectionProfileInput.Name = this.ProtectionProfile.Name; + disassociateProtectionProfileInput.ReplicationProviderSettings = string.Empty; + + this.response = RecoveryServicesClient.DissociateAzureSiteRecoveryProtectionProfile( + this.ProtectionProfile.Name, + disassociateProtectionProfileInput); + + JobResponse jobResponse = + RecoveryServicesClient + .GetAzureSiteRecoveryJobDetails(PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); + + WriteObject(new ASRJob(jobResponse.Job)); + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Server/GetAzureSiteRecoveryServer.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Server/GetAzureSiteRecoveryServer.cs new file mode 100644 index 000000000000..adeaac994fe0 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Server/GetAzureSiteRecoveryServer.cs @@ -0,0 +1,141 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Management.Automation; +using Microsoft.Azure.Management.SiteRecovery.Models; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Retrieves Azure Site Recovery Server. + /// + [Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryServer", DefaultParameterSetName = ASRParameterSets.Default)] + [OutputType(typeof(IEnumerable))] + public class GetAzureSiteRecoveryServer : SiteRecoveryCmdletBase + { + #region Parameters + /// + /// Gets or sets ID of the Server. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + /// + /// Gets or sets name of the Server. + /// + [Parameter(ParameterSetName = ASRParameterSets.ByFriendlyName, Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FriendlyName { get; set; } + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + switch (this.ParameterSetName) + { + case ASRParameterSets.ByName: + this.GetByName(); + break; + case ASRParameterSets.ByFriendlyName: + this.GetByFriendlyName(); + break; + case ASRParameterSets.Default: + this.GetAll(); + break; + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Queries by friendly name. + /// + private void GetByFriendlyName() + { + ServerListResponse serverListResponse = + RecoveryServicesClient.GetAzureSiteRecoveryServer(); + + bool found = false; + foreach (Server server in serverListResponse.Servers) + { + if (0 == string.Compare(this.FriendlyName, server.Properties.FriendlyName, true)) + { + this.WriteServer(server); + found = true; + } + } + + if (!found) + { + throw new InvalidOperationException( + string.Format( + Properties.Resources.ServerNotFound, + this.FriendlyName, + PSRecoveryServicesClient.asrVaultCreds.ResourceName)); + } + } + + /// + /// Queries by name. + /// + private void GetByName() + { + ServerResponse serverResponse = + RecoveryServicesClient.GetAzureSiteRecoveryServer(this.Name); + + this.WriteServer(serverResponse.Server); + } + + /// + /// Queries all / by default. + /// + private void GetAll() + { + ServerListResponse serverListResponse = + RecoveryServicesClient.GetAzureSiteRecoveryServer(); + + this.WriteServers(serverListResponse.Servers); + } + + /// + /// Write Servers. + /// + /// List of Servers + private void WriteServers(IList servers) + { + this.WriteObject(servers.Select(s => new ASRServer(s)), true); + } + + /// + /// Write Server. + /// + /// Server object + private void WriteServer(Server server) + { + this.WriteObject(new ASRServer(server)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Utilities/CertUtils.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Utilities/CertUtils.cs new file mode 100644 index 000000000000..b92b010c6295 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Utilities/CertUtils.cs @@ -0,0 +1,225 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Security.Cryptography; +using Security.Cryptography.X509Certificates; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Class to provide methods to manage the certificates. + /// + public static class CertUtils + { + /// + /// Enhancement provider + /// + private const string MsEnhancedProv = "Microsoft Enhanced Cryptographic Provider v1.0"; + + /// + /// Client Authentication Value + /// + private const string OIDClientAuthValue = "1.3.6.1.5.5.7.3.2"; + + /// + /// Client Authentication Friendly name + /// + private const string OIDClientAuthFriendlyName = "Client Authentication"; + + /// + /// Key size + /// + private const int KeySize2048 = 2048; + + /// + /// default issuer name + /// + private const string DefaultIssuer = "CN=Windows Azure Tools"; + + /// + /// default password. + /// + private const string DefaultPassword = ""; + + /// + /// Method to generate a self signed certificate + /// + /// number of hours for which the certificate is valid. + /// subscriptionId in question + /// prefix for the certificate name + /// issuer for the certificate + /// certificate password + /// certificate as an object + public static X509Certificate2 CreateSelfSignedCertificate( + int validForHours, + string subscriptionId, + string certificateNamePrefix, + string issuer = DefaultIssuer, + string password = DefaultPassword) + { + string friendlyName = GenerateCertFriendlyName(subscriptionId, certificateNamePrefix); + DateTime startTime = DateTime.UtcNow.AddMinutes(-10); + DateTime endTime = DateTime.UtcNow.AddHours(validForHours); + + var key = Create2048RsaKey(); + + var creationParams = new X509CertificateCreationParameters(new X500DistinguishedName(issuer)) + { + TakeOwnershipOfKey = true, + StartTime = startTime, + EndTime = endTime + }; + + //// adding client authentication, -eku = 1.3.6.1.5.5.7.3.2, + //// This is mandatory for the upload to be successful + OidCollection oidCollection = new OidCollection(); + oidCollection.Add(new Oid(OIDClientAuthValue, OIDClientAuthFriendlyName)); + creationParams.Extensions.Add(new X509EnhancedKeyUsageExtension(oidCollection, false)); + + // Documentation of CreateSelfSignedCertificate states: + // If creationParameters have TakeOwnershipOfKey set to true, the certificate + // generated will own the key and the input CngKey will be disposed to ensure + // that the caller doesn't accidentally use it beyond its lifetime (which is + // now controlled by the certificate object). + // We don't dispose it ourselves in this case. + var cert = key.CreateSelfSignedCertificate(creationParams); + key = null; + cert.FriendlyName = friendlyName; + + // X509 certificate needs PersistKeySet flag set. + // Reload a new X509Certificate2 instance from exported bytes in order to set the PersistKeySet flag. + var bytes = cert.Export(X509ContentType.Pfx, password); + + // PfxValidation is not done here because these are newly created certs and assumed valid. + return NewX509Certificate2(bytes, password, X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable, shouldValidatePfx: false); + } + + /// + /// Provides a similar API call to new X509Certificate(byte[],string,X509KeyStorageFlags) + /// + /// The bytes that represent the certificate + /// The certificate private password + /// The certificate loading options + /// Flag to indicate if file should validated. Set to true if the rawData is retrieved from an untrusted source. + /// An instance of the X509Certificate + public static X509Certificate2 NewX509Certificate2(byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags, bool shouldValidatePfx) + { + string temporaryFileName = Path.GetTempFileName(); + + try + { + X509ContentType contentType = X509Certificate2.GetCertContentType(rawData); + File.WriteAllBytes(temporaryFileName, rawData); + return new X509Certificate2(temporaryFileName, password, keyStorageFlags); + } + finally + { + try + { + File.Delete(temporaryFileName); + } + catch (Exception) + { + // Not deleting the file is fine + } + } + } + + /// + /// Method to get the Certificate's base 64 encoded string + /// + /// Certificate File Name + /// Base 64 encoded string of the certificate + public static string GetCertInBase64EncodedForm(string certFileName) + { + FileStream fileStream = null; + byte[] data = null; + string certInBase64EncodedForm = null; + + try + { + fileStream = new FileStream(certFileName, FileMode.Open, FileAccess.Read); + + // If the file size is more than 1MB, fail the call - this is just to avoid Dos Attacks + if (fileStream.Length > 1048576) + { + throw new Exception("The Certficate size exceeds 1MB. Please provide a file whose size is utmost 1 MB"); + } + + int size = (int)fileStream.Length; + data = new byte[size]; + size = fileStream.Read(data, 0, size); + + // Check if the file is a valid certificate before sending it to service + X509Certificate2 x509 = new X509Certificate2(); + x509.Import(data); + if (string.IsNullOrEmpty(x509.Thumbprint)) + { + throw new Exception("The thumbprint of Certificate is null or empty"); + } + + certInBase64EncodedForm = Convert.ToBase64String(data); + } + catch (Exception e) + { + certInBase64EncodedForm = null; + throw new ArgumentException(e.Message, certFileName, e); + } + finally + { + if (null != fileStream) + { + fileStream.Close(); + } + } + + return certInBase64EncodedForm; + } + + /// + /// Generates friendly name + /// + /// subscription id + /// prefix, likely resource name + /// friendly name + private static string GenerateCertFriendlyName(string subscriptionId, string prefix = "") + { + return string.Format("{0}{1}-{2}-vaultcredentials", prefix, subscriptionId, DateTime.Now.ToString("M-d-yyyy")); + } + + /// + /// Windows Azure Service Management API requires 2048bit RSA keys. + /// The private key needs to be exportable so we can save it for sharing with team members. + /// + /// A 2048 bit RSA key + private static CngKey Create2048RsaKey() + { + var keyCreationParameters = new CngKeyCreationParameters + { + ExportPolicy = CngExportPolicies.AllowExport, + KeyCreationOptions = CngKeyCreationOptions.None, + KeyUsage = CngKeyUsages.AllUsages, + Provider = new CngProvider(MsEnhancedProv) + }; + + keyCreationParameters.Parameters.Add(new CngProperty("Length", BitConverter.GetBytes(KeySize2048), CngPropertyOptions.None)); + + return CngKey.Create(CngAlgorithm2.Rsa, null, keyCreationParameters); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Utilities/Security.Cryptography.dll b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Utilities/Security.Cryptography.dll new file mode 100644 index 000000000000..d19198541fe0 Binary files /dev/null and b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Utilities/Security.Cryptography.dll differ diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Utilities/Utilities.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Utilities/Utilities.cs new file mode 100644 index 000000000000..1b57691b5c43 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Utilities/Utilities.cs @@ -0,0 +1,169 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Diagnostics.CodeAnalysis; +using System.IO; +using System.Runtime.Serialization; +using System.Security.Cryptography; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Class to define Utility methods + /// + public static class Utilities + { + /// + /// Serialize the T as xml using DataContract Serializer + /// + /// the type name + /// the T object. + /// the serialized object. + [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed.")] + public static string Serialize(T value) + { + if (value == null) + { + return null; + } + + string serializedValue; + + using (MemoryStream memoryStream = new MemoryStream()) + using (StreamReader reader = new StreamReader(memoryStream)) + { + DataContractSerializer serializer = new DataContractSerializer(typeof(T)); + serializer.WriteObject(memoryStream, value); + memoryStream.Position = 0; + serializedValue = reader.ReadToEnd(); + } + + return serializedValue; + } + + /// + /// Deserialize the xml as T + /// + /// the type name + /// the xml as string + /// the equivalent T + [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed.")] + public static T Deserialize(string xml) + { + if (string.IsNullOrEmpty(xml)) + { + return default(T); + } + + using (Stream stream = new MemoryStream()) + { + byte[] data = System.Text.Encoding.UTF8.GetBytes(xml); + stream.Write(data, 0, data.Length); + stream.Position = 0; + DataContractSerializer deserializer = new DataContractSerializer(typeof(T)); + return (T)deserializer.ReadObject(stream); + } + } + + /// + /// Method to write content to a file. + /// + /// Class to be serialized + /// content to be written to the file + /// the path where the file is to be created + /// name of the file to be created + /// file path with file name as string + public static string WriteToFile(T fileContent, string filePath, string fileName) + { + string fullFileName = Path.Combine(filePath, fileName); + using (System.IO.StreamWriter file = new System.IO.StreamWriter(@fullFileName, false)) + { + string contentToWrite = Serialize(fileContent); + file.WriteLine(contentToWrite); + } + + return fullFileName; + } + + /// + /// Imports Azure Site Recovery Vault settings. + /// + /// ASR Vault credentials + public static void UpdateVaultSettings(ASRVaultCreds asrVaultCreds) + { + object updateVaultSettingsOneAtATime = new object(); + lock (updateVaultSettingsOneAtATime) + { + PSRecoveryServicesClient.asrVaultCreds.ResourceName = + asrVaultCreds.ResourceName; + PSRecoveryServicesClient.asrVaultCreds.ResourceGroupName = + asrVaultCreds.ResourceGroupName; + PSRecoveryServicesClient.asrVaultCreds.ChannelIntegrityKey = + asrVaultCreds.ChannelIntegrityKey; + } + } + + /// + /// method to return the Downloads path for the current user. + /// + /// path as string. + public static string GetDefaultPath() + { + string path = Path.GetTempPath(); + return path; + } + + /// + /// Generate cryptographically random key of given bit size. + /// + /// size of the key to be generated + /// the key + public static string GenerateRandomKey(int size) + { + byte[] key = new byte[(int)size / 8]; + RNGCryptoServiceProvider crypto = new RNGCryptoServiceProvider(); + crypto.GetBytes(key); + return Convert.ToBase64String(key); + } + + /// + /// Returns the cloud id given a container id. + /// + /// Protection Container Id + /// Cloud Id object + public static void GetCloudIdFromContainerId(string protectionContainerId, out string cloudId) + { + // The first part before '_' is server id. Rest will be cloud id. + var index = protectionContainerId.IndexOf('_'); + + if (index != -1) + { + try + { + cloudId = protectionContainerId.Substring(index + 1, protectionContainerId.Length - index - 1); + } + catch + { + cloudId = null; + } + } + else + { + cloudId = null; + } + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/GetAzureSiteRecoveryVault.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/GetAzureSiteRecoveryVault.cs new file mode 100644 index 000000000000..9665c0f792f7 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/GetAzureSiteRecoveryVault.cs @@ -0,0 +1,113 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Management.Automation; +using Microsoft.Azure.Management.RecoveryServices.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Retrieves Azure Site Recovery Vault. + /// + [Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryVault")] + [OutputType(typeof(List))] + public class GetAzureSiteRecoveryVaults : SiteRecoveryCmdletBase + { + #region Parameters + /// + /// Gets or sets Resouce Group name. + /// + [Parameter] + public string ResouceGroupName { get; set; } + + /// + /// Gets or sets Resouce Name. + /// + [Parameter] + public string Name { get; set; } + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + if (string.IsNullOrEmpty(this.ResouceGroupName)) + { + this.GetVaultsUnderAllResouceGroups(); + } + else + { + this.GetVaultsUnderResouceGroup(); + } + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + + /// + /// Get vaults under a resouce group. + /// + private void GetVaultsUnderResouceGroup() + { + VaultListResponse vaultListResponse = + RecoveryServicesClient.GetVaultsInResouceGroup(this.ResouceGroupName); + + this.WriteVaults(vaultListResponse.Vaults); + } + + /// + /// Get vaults under all resouce group. + /// + private void GetVaultsUnderAllResouceGroups() + { + foreach (var resourceGroup in RecoveryServicesClient.GetResouceGroups().ResourceGroups) + { + VaultListResponse vaultListResponse = + RecoveryServicesClient.GetVaultsInResouceGroup(resourceGroup.Name); + + this.WriteVaults(vaultListResponse.Vaults); + } + } + + /// + /// Write Vaults. + /// + /// List of Vaults + private void WriteVaults(IList vaults) + { + if (string.IsNullOrEmpty(this.Name)) + { + this.WriteObject(vaults.Select(v => new ASRVault(v)), true); + } + else + { + foreach (Vault vault in vaults) + { + if (0 == string.Compare(this.Name, vault.Name, true)) + { + this.WriteObject(new ASRVault(vault)); + } + } + } + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/GetAzureSiteRecoveryVaultSettings.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/GetAzureSiteRecoveryVaultSettings.cs new file mode 100644 index 000000000000..aca434d18ad7 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/GetAzureSiteRecoveryVaultSettings.cs @@ -0,0 +1,40 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Management.Automation; +using Microsoft.WindowsAzure.Commands.Utilities.Common; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Retrieves Azure Site Recovery Vault Settings. + /// + [Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryVaultSettings")] + [OutputType(typeof(ASRVaultSettings))] + public class GetAzureSiteRecoveryVaultSettings : SiteRecoveryCmdletBase + { + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + this.WriteObject(new ASRVaultSettings( + PSRecoveryServicesClient.asrVaultCreds.ResourceName, + PSRecoveryServicesClient.asrVaultCreds.ResourceGroupName)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/GetAzureSiteRecoveryVaultSettingsFile.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/GetAzureSiteRecoveryVaultSettingsFile.cs new file mode 100644 index 000000000000..34173d261fce --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/GetAzureSiteRecoveryVaultSettingsFile.cs @@ -0,0 +1,112 @@ +// ---------------------------------------------------------------------------------- +// +// 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 System.Security.Cryptography.X509Certificates; +using Microsoft.Azure.Common.Authentication.Models; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Retrieves Azure Site Recovery Vault Settings File. + /// + [Cmdlet(VerbsCommon.Get, "AzureSiteRecoveryVaultSettingsFile", DefaultParameterSetName = ASRParameterSets.ByParam)] + [OutputType(typeof(VaultSettingsFilePath))] + public class GetAzureSiteRecoveryVaultSettingsFile : SiteRecoveryCmdletBase + { + /// + /// Expiry in hours for generated certificate. + /// + private const int VaultCertificateExpiryInHoursForHRM = 120; + + #region Parameters + + /// + /// Gets or sets vault Object. + /// + [Parameter(Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRVault Vault { get; set; } + + /// + /// Gets or sets the path where the credential file is to be generated + /// + [Parameter] + public string Path { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + this.GetVaultSettingsFile(); + } + catch (AggregateException aggregateEx) + { + // if an exception is thrown from a task, it will be wrapped in AggregateException + // and propagated to the main thread. Just throwing the first exception in the list. + Exception exception = aggregateEx.InnerExceptions.First(); + this.HandleException(exception); + } + } + + /// + /// Method to execute the command + /// + private void GetVaultSettingsFile() + { + AzureSubscription subscription = this.Profile.Context.Subscription; + + // Generate certificate + X509Certificate2 cert = CertUtils.CreateSelfSignedCertificate(VaultCertificateExpiryInHoursForHRM, subscription.Id.ToString(), this.Vault.Name); + + // Generate file. + ASRVaultCreds vaultCreds = RecoveryServicesClient.GenerateVaultCredential( + cert, + this.Vault); + + string filePath = string.IsNullOrEmpty(this.Path) ? Utilities.GetDefaultPath() : this.Path; + string fileName = this.GenerateFileName(); + + // write the content to a file. + VaultSettingsFilePath output = new VaultSettingsFilePath() + { + FilePath = Utilities.WriteToFile(vaultCreds, filePath, fileName) + }; + + // print the path to the user. + this.WriteObject(output, true); + } + + /// + /// Method to generate the file name + /// + /// file name as string. + private string GenerateFileName() + { + string fileName; + string format = "yyyy-MM-ddTHH-mm-ss"; + fileName = string.Format("{0}_{1}.VaultCredentials", this.Vault.Name, DateTime.UtcNow.ToString(format)); + + return fileName; + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/ImportAzureSiteRecoveryVaultSettingsFile.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/ImportAzureSiteRecoveryVaultSettingsFile.cs new file mode 100644 index 000000000000..a93eab4f0018 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/ImportAzureSiteRecoveryVaultSettingsFile.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; +using System.IO; +using System.Management.Automation; +using System.Runtime.Serialization; +using System.Xml; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; +using Properties = Microsoft.Azure.Commands.SiteRecovery.Properties; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Imports Azure Site Recovery Vault Settings. + /// + [Cmdlet(VerbsData.Import, "AzureSiteRecoveryVaultSettingsFile")] + [OutputType(typeof(ASRVaultSettings))] + public class ImportAzureSiteRecoveryVaultSettingsFile : SiteRecoveryCmdletBase + { + #region Parameters + /// + /// Gets or sets path to the Azure site Recovery Vault Settings file. This file can be + /// downloaded from Azure site recovery Vault portal and stored locally. + /// + [Parameter( + Position = 0, + Mandatory = true, + HelpMessage = "AzureSiteRecovery vault settings file path", + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Path { get; set; } + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + this.WriteVerbose("Vault Settings File path: " + this.Path); + + ASRVaultCreds asrVaultCreds = null; + if (File.Exists(this.Path)) + { + try + { + var serializer = new DataContractSerializer(typeof(ASRVaultCreds)); + using (var s = new FileStream( + this.Path, + FileMode.Open, + FileAccess.Read, + FileShare.Read)) + { + asrVaultCreds = (ASRVaultCreds)serializer.ReadObject(s); + } + } + catch (XmlException xmlException) + { + throw new XmlException( + string.Format(Properties.Resources.InvalidXml, xmlException)); + } + catch (SerializationException serializationException) + { + throw new SerializationException( + string.Format(Properties.Resources.InvalidXml, serializationException)); + } + } + else + { + throw new FileNotFoundException( + Properties.Resources.VaultSettingFileNotFound, + this.Path); + } + + // Validate required parameters taken from the Vault settings file. + if (string.IsNullOrEmpty(asrVaultCreds.ResourceName)) + { + throw new ArgumentException( + Properties.Resources.ResourceNameNullOrEmpty, + asrVaultCreds.ResourceName); + } + + if (string.IsNullOrEmpty(asrVaultCreds.ResourceGroupName)) + { + throw new ArgumentException( + Properties.Resources.CloudServiceNameNullOrEmpty, + asrVaultCreds.ResourceGroupName); + } + + try + { + RecoveryServicesClient.ValidateVaultSettings( + asrVaultCreds.ResourceName, + asrVaultCreds.ResourceGroupName); + + Utilities.UpdateVaultSettings(asrVaultCreds); + this.WriteObject(new ASRVaultSettings( + asrVaultCreds.ResourceName, + asrVaultCreds.ResourceGroupName)); + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/NewAzureSiteRecoveryVault.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/NewAzureSiteRecoveryVault.cs new file mode 100644 index 000000000000..e37a3e159903 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/NewAzureSiteRecoveryVault.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 System; +using System.Management.Automation; +using System.Net; +using Microsoft.Azure.Commands.SiteRecovery.Properties; +using Microsoft.Azure.Management.RecoveryServices.Models; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Used to initiate a vault create operation. + /// + [Cmdlet(VerbsCommon.New, "AzureSiteRecoveryVault")] + public class CreateAzureSiteRecoveryVault : SiteRecoveryCmdletBase + { + #region Parameters + + /// + /// Gets or sets the vault name + /// + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + /// + /// Gets or sets the resouce group name + /// + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ResouceGroupName { get; set; } + + /// + /// Gets or sets the location of the vault + /// + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Location { get; set; } + + #endregion + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + try + { + VaultCreateArgs vaultCreateArgs = new VaultCreateArgs(); + vaultCreateArgs.Location = this.Location; + vaultCreateArgs.Properties = new VaultProperties(); + vaultCreateArgs.Properties.Sku = new VaultSku(); + vaultCreateArgs.Properties.Sku.Name = "standard"; + + VaultCreateResponse response = RecoveryServicesClient.CreateVault(this.ResouceGroupName, this.Name, vaultCreateArgs); + + this.WriteObject(new ASRVault(response)); + } + catch (Exception exception) + { + this.HandleException(exception); + } + } + } +} diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/SetAzureSiteRecoveryVaultSettings.cs b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/SetAzureSiteRecoveryVaultSettings.cs new file mode 100644 index 000000000000..2a4f1c6885e2 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Vault/SetAzureSiteRecoveryVaultSettings.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 System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Microsoft.Azure.Portal.RecoveryServices.Models.Common; + +namespace Microsoft.Azure.Commands.SiteRecovery +{ + /// + /// Retrieves Azure Site Recovery Vault Settings. + /// + [Cmdlet(VerbsCommon.Set, "AzureSiteRecoveryVaultSettings")] + [OutputType(typeof(ASRVaultSettings))] + public class SetAzureSiteRecoveryVaultSettings : SiteRecoveryCmdletBase + { + #region Parameters + + /// + /// Gets or sets vault Object. + /// + [Parameter(Mandatory = true, ValueFromPipeline = true)] + [ValidateNotNullOrEmpty] + public ASRVault Vault { get; set; } + + #endregion Parameters + + /// + /// ProcessRecord of the command. + /// + public override void ExecuteCmdlet() + { + // Validate the Vault + RecoveryServicesClient.ValidateVaultSettings( + this.Vault.Name, + this.Vault.ResouceGroupName); + + // Change the vault context + ASRVaultCreds vaultCreds = RecoveryServicesClient.ChangeVaultContext(this.Vault); + + this.WriteObject(new ASRVaultSettings( + PSRecoveryServicesClient.asrVaultCreds.ResourceName, + PSRecoveryServicesClient.asrVaultCreds.ResourceGroupName)); + } + } +} \ No newline at end of file diff --git a/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/packages.config b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/packages.config new file mode 100644 index 000000000000..c99d5a9fdd26 --- /dev/null +++ b/src/ResourceManager/SiteRecovery/Commands.SiteRecovery/packages.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file