Skip to content

Commit 39d1421

Browse files
author
Samuel Anudeep
committed
Merge pull request #215 from MabOneSdk/dev1
Checkin acceptance tests
2 parents ec548d3 + e68ceaa commit 39d1421

File tree

21 files changed

+222
-125
lines changed

21 files changed

+222
-125
lines changed

src/ResourceManager/RecoveryServices.Backup/Cmdlets/ProtectionPolicy/SetAzureRmRecoveryServicesPolicy.cs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,29 @@ public override void ExecuteCmdlet()
6969
}, HydraAdapter);
7070

7171
IPsBackupProvider psBackupProvider = providerManager.GetProviderInstance(Policy.WorkloadType,
72-
Policy.BackupManagementType);
73-
// now convert hydraPolicy to PSObject
74-
WriteObject(psBackupProvider.ModifyPolicy());
72+
Policy.BackupManagementType);
73+
ProtectionPolicyResponse policyResponse = psBackupProvider.ModifyPolicy();
74+
75+
if(policyResponse.StatusCode == System.Net.HttpStatusCode.Accepted)
76+
{
77+
// Track OperationStatus URL for operation completion
78+
BackUpOperationStatusResponse operationResponse = WaitForOperationCompletionUsingStatusLink(
79+
policyResponse.AzureAsyncOperation,
80+
HydraAdapter.GetProtectionPolicyOperationStatusByURL);
81+
82+
if(operationResponse.OperationStatus.Status == OperationStatusValues.Failed.ToString())
83+
{
84+
// if operation failed, then trace warning/error
85+
}
86+
87+
// get list of jobIds and return jobResponses
88+
WriteObject(GetJobObject(((OperationStatusJobsExtendedInfo)operationResponse.OperationStatus.Properties).JobIds));
89+
}
90+
else
91+
{
92+
// Hydra will return OK if NO datasources are associated with this policy
93+
// just trace and return
94+
}
7595
});
7696
}
7797
}

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Commands.RecoveryServices.Backup.Helpers.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
<Compile Include="Properties\AssemblyInfo.cs" />
6161
</ItemGroup>
6262
<ItemGroup>
63+
<ProjectReference Include="..\..\..\Common\Commands.Common\Commands.Common.csproj">
64+
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
65+
<Name>Commands.Common</Name>
66+
</ProjectReference>
6367
<ProjectReference Include="..\Commands.RecoveryServices.Backup.Logger\Commands.RecoveryServices.Backup.Logger.csproj">
6468
<Project>{5e675749-6139-464a-904c-59c0ffdfec82}</Project>
6569
<Name>Commands.RecoveryServices.Backup.Logger</Name>

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Properties/AssemblyInfo.cs

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

15+
using System;
1516
using System.Reflection;
1617
using System.Runtime.CompilerServices;
1718
using System.Runtime.InteropServices;
1819

1920
// General Information about an assembly is controlled through the following
2021
// set of attributes. Change these attribute values to modify the information
2122
// associated with an assembly.
22-
[assembly: AssemblyTitle("Helpers")]
23-
[assembly: AssemblyDescription("")]
24-
[assembly: AssemblyConfiguration("")]
25-
[assembly: AssemblyCompany("")]
26-
[assembly: AssemblyProduct("Helpers")]
27-
[assembly: AssemblyCopyright("Copyright © 2016")]
28-
[assembly: AssemblyTrademark("")]
29-
[assembly: AssemblyCulture("")]
23+
[assembly: AssemblyTitle("Microsoft Azure Powershell")]
24+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
25+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
26+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
3027

3128
// Setting ComVisible to false makes the types in this assembly not visible
3229
// to COM components. If you need to access a type in this assembly from
3330
// COM, set the ComVisible attribute to true on that type.
3431
[assembly: ComVisible(false)]
35-
36-
// The following GUID is for the ID of the typelib if this project is exposed to COM
37-
[assembly: Guid("80e5eb92-c776-4e6a-af93-712e23965e2a")]
32+
[assembly: CLSCompliant(false)]
3833

3934
// Version information for an assembly consists of the following four values:
4035
//

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.HydraAdapter/BMSAPIs/PolicyAPIs.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public ProtectionPolicyListResponse ListProtectionPolicy(
5757
BmsAdapter.CmdletCancellationToken).Result;
5858
}
5959

60-
// TBD for other operations
60+
public BackUpOperationStatusResponse GetProtectionPolicyOperationStatusByURL(string url)
61+
{
62+
return BmsAdapter.Client.ProtectionPolicy.GetOperationStatusByURLAsync(
63+
url,
64+
BmsAdapter.GetCustomRequestHeaders(),
65+
BmsAdapter.CmdletCancellationToken).Result;
66+
}
6167
}
6268
}

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.HydraAdapter/Commands.RecoveryServices.Backup.HydraAdapter.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
<Project>{d3804b64-c0d3-48f8-82ec-1f632f833c9e}</Project>
7777
<Name>Commands.Common.Authentication</Name>
7878
</ProjectReference>
79+
<ProjectReference Include="..\..\..\Common\Commands.Common\Commands.Common.csproj">
80+
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
81+
<Name>Commands.Common</Name>
82+
</ProjectReference>
7983
<ProjectReference Include="..\Commands.RecoveryServices.Backup.Models\Commands.RecoveryServices.Backup.Models.csproj">
8084
<Project>{30b92759-50b3-494e-b9f0-ec9a2ce9d57b}</Project>
8185
<Name>Commands.RecoveryServices.Backup.Models</Name>

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.HydraAdapter/Properties/AssemblyInfo.cs

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

15+
using System;
1516
using System.Reflection;
1617
using System.Runtime.CompilerServices;
1718
using System.Runtime.InteropServices;
1819

1920
// General Information about an assembly is controlled through the following
2021
// set of attributes. Change these attribute values to modify the information
2122
// associated with an assembly.
22-
[assembly: AssemblyTitle("Adapter")]
23-
[assembly: AssemblyDescription("")]
24-
[assembly: AssemblyConfiguration("")]
25-
[assembly: AssemblyCompany("")]
26-
[assembly: AssemblyProduct("Adapter")]
27-
[assembly: AssemblyCopyright("Copyright © 2016")]
28-
[assembly: AssemblyTrademark("")]
29-
[assembly: AssemblyCulture("")]
23+
[assembly: AssemblyTitle("Microsoft Azure Powershell")]
24+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
25+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
26+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
3027

3128
// Setting ComVisible to false makes the types in this assembly not visible
3229
// to COM components. If you need to access a type in this assembly from
3330
// COM, set the ComVisible attribute to true on that type.
3431
[assembly: ComVisible(false)]
35-
36-
// The following GUID is for the ID of the typelib if this project is exposed to COM
37-
[assembly: Guid("ad1e4b97-f782-4fd0-b2bf-14472c362306")]
32+
[assembly: CLSCompliant(false)]
3833

3934
// Version information for an assembly consists of the following four values:
4035
//

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Logger/Commands.RecoveryServices.Backup.Logger.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
<Compile Include="Logger.cs" />
4343
<Compile Include="Properties\AssemblyInfo.cs" />
4444
</ItemGroup>
45+
<ItemGroup>
46+
<ProjectReference Include="..\..\..\Common\Commands.Common\Commands.Common.csproj">
47+
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
48+
<Name>Commands.Common</Name>
49+
</ProjectReference>
50+
</ItemGroup>
4551
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
4652
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
4753
Other similar extension points exist, see Microsoft.Common.targets.

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Logger/Properties/AssemblyInfo.cs

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

15+
using System;
1516
using System.Reflection;
1617
using System.Runtime.CompilerServices;
1718
using System.Runtime.InteropServices;
1819

1920
// General Information about an assembly is controlled through the following
2021
// set of attributes. Change these attribute values to modify the information
2122
// associated with an assembly.
22-
[assembly: AssemblyTitle("Commands.RecoveryServices.Backup.Logger")]
23-
[assembly: AssemblyDescription("")]
24-
[assembly: AssemblyConfiguration("")]
25-
[assembly: AssemblyCompany("")]
26-
[assembly: AssemblyProduct("Commands.RecoveryServices.Backup.Logger")]
27-
[assembly: AssemblyCopyright("Copyright © 2016")]
28-
[assembly: AssemblyTrademark("")]
29-
[assembly: AssemblyCulture("")]
23+
[assembly: AssemblyTitle("Microsoft Azure Powershell")]
24+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
25+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
26+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
3027

3128
// Setting ComVisible to false makes the types in this assembly not visible
3229
// to COM components. If you need to access a type in this assembly from
3330
// COM, set the ComVisible attribute to true on that type.
3431
[assembly: ComVisible(false)]
35-
36-
// The following GUID is for the ID of the typelib if this project is exposed to COM
37-
[assembly: Guid("cac38a0e-a5a2-4473-b2a9-e6f6f49ca63d")]
32+
[assembly: CLSCompliant(false)]
3833

3934
// Version information for an assembly consists of the following four values:
4035
//

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/Commands.RecoveryServices.Backup.Models.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@
6666
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
6767
</EmbeddedResource>
6868
</ItemGroup>
69+
<ItemGroup>
70+
<ProjectReference Include="..\..\..\Common\Commands.Common\Commands.Common.csproj">
71+
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
72+
<Name>Commands.Common</Name>
73+
</ProjectReference>
74+
</ItemGroup>
6975
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
7076
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
7177
Other similar extension points exist, see Microsoft.Common.targets.

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/Properties/AssemblyInfo.cs

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

15+
using System;
1516
using System.Reflection;
1617
using System.Runtime.CompilerServices;
1718
using System.Runtime.InteropServices;
1819

1920
// General Information about an assembly is controlled through the following
2021
// set of attributes. Change these attribute values to modify the information
2122
// associated with an assembly.
22-
[assembly: AssemblyTitle("Models")]
23-
[assembly: AssemblyDescription("")]
24-
[assembly: AssemblyConfiguration("")]
25-
[assembly: AssemblyCompany("")]
26-
[assembly: AssemblyProduct("Models")]
27-
[assembly: AssemblyCopyright("Copyright © 2016")]
28-
[assembly: AssemblyTrademark("")]
29-
[assembly: AssemblyCulture("")]
23+
[assembly: AssemblyTitle("Microsoft Azure Powershell")]
24+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
25+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
26+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
3027

3128
// Setting ComVisible to false makes the types in this assembly not visible
3229
// to COM components. If you need to access a type in this assembly from
3330
// COM, set the ComVisible attribute to true on that type.
3431
[assembly: ComVisible(false)]
35-
36-
// The following GUID is for the ID of the typelib if this project is exposed to COM
37-
[assembly: Guid("c26540c5-042f-4727-ad18-56342944e821")]
32+
[assembly: CLSCompliant(false)]
3833

3934
// Version information for an assembly consists of the following four values:
4035
//

0 commit comments

Comments
 (0)