Skip to content

Commit 199ef63

Browse files
author
dragonfly91
committed
Renamed all occurences of Hydra to ServiceClient
1 parent 9b6f12e commit 199ef63

File tree

53 files changed

+352
-354
lines changed

Some content is hidden

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

53 files changed

+352
-354
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,14 @@
5757
<Compile Include="Conversions\SchedulePolicyConversions.cs" />
5858
<Compile Include="Conversions\RetentionPolicyConversions.cs" />
5959
<Compile Include="Conversions\ConversionHelpers.cs" />
60-
<Compile Include="HydraHelpers.cs" />
60+
<Compile Include="ServiceClientHelpers.cs" />
6161
<Compile Include="Properties\AssemblyInfo.cs" />
6262
</ItemGroup>
6363
<ItemGroup>
6464
<ProjectReference Include="..\..\..\Common\Commands.Common\Commands.Common.csproj">
6565
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
6666
<Name>Commands.Common</Name>
6767
</ProjectReference>
68-
<ProjectReference Include="..\Commands.RecoveryServices.Backup.HydraAdapter\Commands.RecoveryServices.Backup.HydraAdapter.csproj">
69-
<Project>{b758fec1-35c1-4f93-a954-66dd33f6e0ec}</Project>
70-
<Name>Commands.RecoveryServices.Backup.HydraAdapter</Name>
71-
</ProjectReference>
7268
<ProjectReference Include="..\Commands.RecoveryServices.Backup.Logger\Commands.RecoveryServices.Backup.Logger.csproj">
7369
<Project>{5e675749-6139-464a-904c-59c0ffdfec82}</Project>
7470
<Name>Commands.RecoveryServices.Backup.Logger</Name>

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,32 +93,32 @@ public static List<AzureRmRecoveryServicesBackupEngineBase> GetBackupEngineModel
9393
#endregion
9494

9595
#region policy
96-
public static AzureRmRecoveryServicesBackupPolicyBase GetPolicyModel(ProtectionPolicyResource hydraResponse)
96+
public static AzureRmRecoveryServicesBackupPolicyBase GetPolicyModel(ProtectionPolicyResource serviceClientResponse)
9797
{
9898
AzureRmRecoveryServicesBackupPolicyBase policyModel = null;
9999

100-
if (hydraResponse == null || hydraResponse.Properties == null)
100+
if (serviceClientResponse == null || serviceClientResponse.Properties == null)
101101
{
102-
Logger.Instance.WriteDebug("Policy Hydra response is Null/Empty");
103-
throw new ArgumentException(Resources.EmptyHydraResponseException);
102+
Logger.Instance.WriteDebug("Policy Service Client response is Null/Empty");
103+
throw new ArgumentException(Resources.EmptyServiceClientResponseException);
104104
}
105105

106-
if (hydraResponse.Properties.GetType() == typeof(AzureIaaSVMProtectionPolicy))
106+
if (serviceClientResponse.Properties.GetType() == typeof(AzureIaaSVMProtectionPolicy))
107107
{
108-
if (((AzureIaaSVMProtectionPolicy)hydraResponse.Properties).RetentionPolicy.GetType() !=
108+
if (((AzureIaaSVMProtectionPolicy)serviceClientResponse.Properties).RetentionPolicy.GetType() !=
109109
typeof(LongTermRetentionPolicy))
110110
{
111111
Logger.Instance.WriteDebug("Unknown RetentionPolicy object received: " +
112-
((AzureIaaSVMProtectionPolicy)hydraResponse.Properties).RetentionPolicy.GetType());
112+
((AzureIaaSVMProtectionPolicy)serviceClientResponse.Properties).RetentionPolicy.GetType());
113113
Logger.Instance.WriteWarning(Resources.UpdateToNewAzurePowershellWarning);
114114
return null;
115115
}
116116

117-
if (((AzureIaaSVMProtectionPolicy)hydraResponse.Properties).SchedulePolicy.GetType() !=
117+
if (((AzureIaaSVMProtectionPolicy)serviceClientResponse.Properties).SchedulePolicy.GetType() !=
118118
typeof(SimpleSchedulePolicy))
119119
{
120120
Logger.Instance.WriteDebug("Unknown SchedulePolicy object received: " +
121-
((AzureIaaSVMProtectionPolicy)hydraResponse.Properties).SchedulePolicy.GetType());
121+
((AzureIaaSVMProtectionPolicy)serviceClientResponse.Properties).SchedulePolicy.GetType());
122122
Logger.Instance.WriteWarning(Resources.UpdateToNewAzurePowershellWarning);
123123
return null;
124124
}
@@ -128,31 +128,31 @@ public static AzureRmRecoveryServicesBackupPolicyBase GetPolicyModel(ProtectionP
128128
iaasPolicyModel.WorkloadType = Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.WorkloadType.AzureVM;
129129
iaasPolicyModel.BackupManagementType = Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.BackupManagementType.AzureVM;
130130
iaasPolicyModel.RetentionPolicy = PolicyHelpers.GetPSLongTermRetentionPolicy((LongTermRetentionPolicy)
131-
((AzureIaaSVMProtectionPolicy)hydraResponse.Properties).RetentionPolicy);
131+
((AzureIaaSVMProtectionPolicy)serviceClientResponse.Properties).RetentionPolicy);
132132
iaasPolicyModel.SchedulePolicy = PolicyHelpers.GetPSSimpleSchedulePolicy((SimpleSchedulePolicy)
133-
((AzureIaaSVMProtectionPolicy)hydraResponse.Properties).SchedulePolicy);
133+
((AzureIaaSVMProtectionPolicy)serviceClientResponse.Properties).SchedulePolicy);
134134
}
135135
else
136136
{
137137
// we will enter this case when service supports new workload and customer
138138
// still using old version of azure powershell. Trace warning message, ignore and return
139139
Logger.Instance.WriteDebug("Unknown Policy object received: " +
140-
hydraResponse.Properties.GetType());
140+
serviceClientResponse.Properties.GetType());
141141
Logger.Instance.WriteWarning(Resources.UpdateToNewAzurePowershellWarning);
142142
return null;
143143
}
144144

145-
policyModel.Name = hydraResponse.Name;
146-
policyModel.Id = hydraResponse.Id;
145+
policyModel.Name = serviceClientResponse.Name;
146+
policyModel.Id = serviceClientResponse.Id;
147147

148148
return policyModel;
149149
}
150150

151151
public static List<AzureRmRecoveryServicesBackupPolicyBase> GetPolicyModelList(
152-
ProtectionPolicyListResponse hydraListResponse)
152+
ProtectionPolicyListResponse serviceClientListResponse)
153153
{
154-
if (hydraListResponse == null || hydraListResponse.ItemList == null ||
155-
hydraListResponse.ItemList.Value == null || hydraListResponse.ItemList.Value.Count == 0)
154+
if (serviceClientListResponse == null || serviceClientListResponse.ItemList == null ||
155+
serviceClientListResponse.ItemList.Value == null || serviceClientListResponse.ItemList.Value.Count == 0)
156156
{
157157
Logger.Instance.WriteDebug("Received empty list of policies from service");
158158
return null;
@@ -161,7 +161,7 @@ public static List<AzureRmRecoveryServicesBackupPolicyBase> GetPolicyModelList(
161161
List<AzureRmRecoveryServicesBackupPolicyBase> policyModels = new List<AzureRmRecoveryServicesBackupPolicyBase>();
162162
AzureRmRecoveryServicesBackupPolicyBase policyModel = null;
163163

164-
foreach (ProtectionPolicyResource resource in hydraListResponse.ItemList.Value)
164+
foreach (ProtectionPolicyResource resource in serviceClientListResponse.ItemList.Value)
165165
{
166166
policyModel = GetPolicyModel(resource);
167167
if (policyModel != null)

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Conversions/JobConversions.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,43 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers
2222
{
2323
public class JobConversions
2424
{
25-
#region Hydra to PS convertors
25+
#region ServiceClient to PS convertors
2626

2727
/// <summary>
2828
/// This function returns either job object or job details object based on
29-
/// what hydra object contains.
30-
/// To elaborate, if hydra job's ExtendedInfo is filled then this function will
29+
/// what ServiceClient object contains.
30+
/// To elaborate, if ServiceClient job's ExtendedInfo is filled then this function will
3131
/// return a job details object. Otherwise it will return a job object.
3232
/// </summary>
33-
/// <param name="hydraJob"></param>
33+
/// <param name="ServiceClientJob"></param>
3434
/// <returns></returns>
35-
public static CmdletModel.AzureRmRecoveryServicesBackupJobBase GetPSJob(JobResponse hydraJob)
35+
public static CmdletModel.AzureRmRecoveryServicesBackupJobBase GetPSJob(JobResponse serviceClientJob)
3636
{
37-
return GetPSJob(hydraJob.Item);
37+
return GetPSJob(serviceClientJob.Item);
3838
}
3939

40-
public static CmdletModel.AzureRmRecoveryServicesBackupJobBase GetPSJob(JobResource hydraJob)
40+
public static CmdletModel.AzureRmRecoveryServicesBackupJobBase GetPSJob(JobResource serviceClientJob)
4141
{
4242
CmdletModel.AzureRmRecoveryServicesBackupJobBase response = null;
4343

44-
// hydra doesn't initialize Properties if the type of job is not known to current version of hydra.
45-
if (hydraJob.Properties == null)
44+
// ServiceClient doesn't initialize Properties if the type of job is not known to current version of ServiceClient.
45+
if (serviceClientJob.Properties == null)
4646
{
4747
Logger.Instance.WriteWarning(Resources.UnsupportedJobWarning);
4848
}
49-
else if (hydraJob.Properties.GetType() == typeof(AzureIaaSVMJob))
49+
else if (serviceClientJob.Properties.GetType() == typeof(AzureIaaSVMJob))
5050
{
51-
response = GetPSAzureVmJob(hydraJob);
51+
response = GetPSAzureVmJob(serviceClientJob);
5252
}
5353

5454
return response;
5555
}
5656

57-
public static void AddHydraJobsToPSList(JobListResponse hydraJobs, List<CmdletModel.AzureRmRecoveryServicesBackupJobBase> psJobs, ref int jobsCount)
57+
public static void AddServiceClientJobsToPSList(JobListResponse serviceClientJobs, List<CmdletModel.AzureRmRecoveryServicesBackupJobBase> psJobs, ref int jobsCount)
5858
{
59-
if (hydraJobs.ItemList != null && hydraJobs.ItemList.Value != null)
59+
if (serviceClientJobs.ItemList != null && serviceClientJobs.ItemList.Value != null)
6060
{
61-
foreach (var job in hydraJobs.ItemList.Value)
61+
foreach (var job in serviceClientJobs.ItemList.Value)
6262
{
6363
CmdletModel.AzureRmRecoveryServicesBackupJobBase convertedJob = GetPSJob(job);
6464
if (convertedJob != null)
@@ -72,11 +72,11 @@ public static void AddHydraJobsToPSList(JobListResponse hydraJobs, List<CmdletMo
7272

7373
#region AzureVm job private helpers
7474

75-
private static CmdletModel.AzureRmRecoveryServicesBackupAzureVmJob GetPSAzureVmJob(JobResource hydraJob)
75+
private static CmdletModel.AzureRmRecoveryServicesBackupAzureVmJob GetPSAzureVmJob(JobResource serviceClientJob)
7676
{
7777
CmdletModel.AzureRmRecoveryServicesBackupAzureVmJob response;
7878

79-
AzureIaaSVMJob vmJob = hydraJob.Properties as AzureIaaSVMJob;
79+
AzureIaaSVMJob vmJob = serviceClientJob.Properties as AzureIaaSVMJob;
8080

8181
if (vmJob.ExtendedInfo != null)
8282
{
@@ -87,7 +87,7 @@ private static CmdletModel.AzureRmRecoveryServicesBackupAzureVmJob GetPSAzureVmJ
8787
response = new CmdletModel.AzureRmRecoveryServicesBackupAzureVmJob();
8888
}
8989

90-
response.JobId = GetLastIdFromFullId(hydraJob.Id);
90+
response.JobId = GetLastIdFromFullId(serviceClientJob.Id);
9191
response.StartTime = vmJob.StartTime;
9292
response.EndTime = vmJob.EndTime;
9393
response.Duration = vmJob.Duration;
@@ -140,15 +140,15 @@ private static CmdletModel.AzureRmRecoveryServicesBackupAzureVmJob GetPSAzureVmJ
140140
return response;
141141
}
142142

143-
private static CmdletModel.AzureRmRecoveryServicesBackupAzureVmJobErrorInfo GetPSAzureVmErrorInfo(AzureIaaSVMErrorInfo hydraError)
143+
private static CmdletModel.AzureRmRecoveryServicesBackupAzureVmJobErrorInfo GetPSAzureVmErrorInfo(AzureIaaSVMErrorInfo serviceClientError)
144144
{
145145
CmdletModel.AzureRmRecoveryServicesBackupAzureVmJobErrorInfo psErrorInfo = new CmdletModel.AzureRmRecoveryServicesBackupAzureVmJobErrorInfo();
146-
psErrorInfo.ErrorCode = hydraError.ErrorCode;
147-
psErrorInfo.ErrorMessage = hydraError.ErrorString;
148-
if (hydraError.Recommendations != null)
146+
psErrorInfo.ErrorCode = serviceClientError.ErrorCode;
147+
psErrorInfo.ErrorMessage = serviceClientError.ErrorString;
148+
if (serviceClientError.Recommendations != null)
149149
{
150150
psErrorInfo.Recommendations = new List<string>();
151-
psErrorInfo.Recommendations.AddRange(hydraError.Recommendations);
151+
psErrorInfo.Recommendations.AddRange(serviceClientError.Recommendations);
152152
}
153153

154154
return psErrorInfo;

0 commit comments

Comments
 (0)