Skip to content

Commit afc44c7

Browse files
committed
Merge branch 'dev' into neha-dev
2 parents 2d14377 + f0dde96 commit afc44c7

File tree

44 files changed

+1682
-93
lines changed

Some content is hidden

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

44 files changed

+1682
-93
lines changed

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/ScenarioTests/RecoveryServicesTestsBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ private SiteRecoveryManagementClient GetSiteRecoveryManagementClient()
132132
return new SiteRecoveryManagementClient(
133133
asrVaultCreds.CloudServiceName,
134134
asrVaultCreds.ResourceName,
135-
(SubscriptionCloudCredentials)environment.Credentials,
136-
AzureSession.CurrentContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement)).WithHandler(HttpMockServer.CreateInstance());
135+
RecoveryServicesMgmtClient.Credentials,
136+
RecoveryServicesMgmtClient.BaseUri).WithHandler(HttpMockServer.CreateInstance());
137137
}
138138

139139
private static bool IgnoreCertificateErrorHandler

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<TargetFrameworkProfile />
1515
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
1616
<RestorePackages>true</RestorePackages>
17+
<StyleCopOverrideSettingsFile>Settings.StyleCop</StyleCopOverrideSettingsFile>
18+
<BuildToolsStyleCopVersion>4.7.44.0</BuildToolsStyleCopVersion>
1719
</PropertyGroup>
1820
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1921
<DebugSymbols>true</DebugSymbols>
@@ -28,10 +30,12 @@
2830
<CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>
2931
<RunCodeAnalysis>true</RunCodeAnalysis>
3032
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
33+
<StyleCopEnabled>True</StyleCopEnabled>
34+
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
3135
</PropertyGroup>
3236
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3337
<OutputPath>..\..\..\Package\Release\ServiceManagement\Azure\RecoveryServices</OutputPath>
34-
<DefineConstants>TRACE;SIGN</DefineConstants>
38+
<DefineConstants>TRACE;SIGN;CODE_ANALYSIS</DefineConstants>
3539
<Optimize>true</Optimize>
3640
<DebugType>pdbonly</DebugType>
3741
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -65,7 +69,7 @@
6569
</Reference>
6670
<Reference Include="Microsoft.WindowsAzure.Management.SiteRecovery, Version=0.9.0.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
6771
<SpecificVersion>False</SpecificVersion>
68-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RecoveryServices.0.1.1-preview\lib\net40\Microsoft.WindowsAzure.Management.SiteRecovery.dll</HintPath>
72+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RecoveryServices.0.2.2-preview\lib\net40\Microsoft.WindowsAzure.Management.SiteRecovery.dll</HintPath>
6973
</Reference>
7074
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
7175
<SpecificVersion>False</SpecificVersion>
@@ -97,6 +101,8 @@
97101
<Reference Include="System.Xml" />
98102
</ItemGroup>
99103
<ItemGroup>
104+
<Compile Include="lib\PSStorageObjects.cs" />
105+
<Compile Include="lib\PSNetworkObjects.cs" />
100106
<Compile Include="lib\PSContracts.cs" />
101107
<Compile Include="lib\PSObjects.cs" />
102108
<Compile Include="lib\PSParameterSets.cs" />
@@ -106,6 +112,10 @@
106112
<DesignTime>True</DesignTime>
107113
<DependentUpon>Resources.resx</DependentUpon>
108114
</Compile>
115+
<Compile Include="PSRecoveryServicesClient\PSRecoveryServicesStorageClient.cs" />
116+
<Compile Include="PSRecoveryServicesClient\PSRecoveryServicesStorageMappingClient.cs" />
117+
<Compile Include="PSRecoveryServicesClient\PSRecoveryServicesNetworkMappingClient.cs" />
118+
<Compile Include="PSRecoveryServicesClient\PSRecoveryServicesNetworkClient.cs" />
109119
<Compile Include="PSRecoveryServicesClient\PSRecoveryServicesVMGroupClient.cs" />
110120
<Compile Include="PSRecoveryServicesClient\PSRecoveryServicesPEClient.cs" />
111121
<Compile Include="PSRecoveryServicesClient\PSRecoveryServicesClient.cs">
@@ -118,6 +128,14 @@
118128
<Compile Include="PSRecoveryServicesClient\PSRecoveryServicesVMClient.cs" />
119129
<Compile Include="RecoveryServicesCmdletBase.cs" />
120130
<Compile Include="Properties\AssemblyInfo.cs" />
131+
<Compile Include="Service\GetAzureSiteRecoveryStorage.cs" />
132+
<Compile Include="Service\GetAzureSiteRecoveryStorageMapping.cs" />
133+
<Compile Include="Service\NewAzureSiteRecoveryStorageMapping.cs" />
134+
<Compile Include="Service\RemoveAzureSiteRecoveryStorageMapping.cs" />
135+
<Compile Include="Service\RemoveAzureSiteRecoveryNetworkMapping.cs" />
136+
<Compile Include="Service\NewAzureSiteRecoveryNetworkMapping.cs" />
137+
<Compile Include="Service\GetAzureSiteRecoveryNetworkMapping.cs" />
138+
<Compile Include="Service\GetAzureSiteRecoveryNetwork.cs" />
121139
<Compile Include="Service\CreateAzureSiteRecoveryRecoveryPlan.cs" />
122140
<Compile Include="Service\GetAzureSiteRecoveryRecoveryPlanFile.cs" />
123141
<Compile Include="Service\RemoveAzureSiteRecoveryRecoveryPlan.cs" />
@@ -176,6 +194,10 @@
176194
<Error Condition="!Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="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=317567." HelpKeyword="BCLBUILD2001" />
177195
<Error Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
178196
</Target>
197+
<Import Project="..\..\..\packages\BuildTools.StyleCop.4.7.49.0\tools\StyleCop.targets" Condition="Exists('..\..\..\packages\BuildTools.StyleCop.4.7.49.0\tools\StyleCop.targets')" />
198+
<Target Name="_________packages_BuildTools_StyleCop_4_7_49_0_tools_StyleCop_targets" Condition="$(StyleCopOutputFile)==''" BeforeTargets="BeforeBuild">
199+
<Error Text="BuildTools_StyleCop - the BuildTools_StyleCop package has not been restored.&#xD;&#xA;If you are running this from an IDE, make sure NuGet Package Restore has been enabled, then reload the solution and re-run the build.&#xD;&#xA;If you are running this from the command line, run the build again.&#xD;&#xA;If this is a CI server, you may want to make sure NuGet Package Restore runs before your build with:&#xD;&#xA; msbuild solution.sln /t:restorepackages" />
200+
</Target>
179201
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
180202
Other similar extension points exist, see Microsoft.Common.targets.
181203
<Target Name="BeforeBuild">

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/PSRecoveryServicesClient/PSRecoveryServicesClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public string GenerateAgentAuthenticationHeader(string clientRequestId)
187187
/// <returns>Custom request headers</returns>
188188
public CustomRequestHeaders GetRequestHeaders()
189189
{
190-
this.ClientRequestId = Guid.NewGuid().ToString() + "-" + DateTime.Now.ToString("yyyy-mm-dd HH:mm:ssZ") + "-P";
190+
this.ClientRequestId = Guid.NewGuid().ToString() + "-" + DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ssZ") + "-P";
191191

192192
return new CustomRequestHeaders()
193193
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using Microsoft.WindowsAzure;
17+
using Microsoft.WindowsAzure.Management.SiteRecovery;
18+
using Microsoft.WindowsAzure.Management.SiteRecovery.Models;
19+
20+
namespace Microsoft.Azure.Commands.RecoveryServices
21+
{
22+
/// <summary>
23+
/// Recovery services convenience client.
24+
/// </summary>
25+
public partial class PSRecoveryServicesClient
26+
{
27+
/// <summary>
28+
/// Gets Azure Site Recovery Networks.
29+
/// </summary>
30+
/// <param name="serverId">Server ID</param>
31+
/// <returns>Network list response</returns>
32+
public NetworkListResponse GetAzureSiteRecoveryNetworks(string serverId)
33+
{
34+
return this.GetSiteRecoveryClient().Networks.List(serverId, this.GetRequestHeaders());
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)