@@ -22,43 +22,43 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers
22
22
{
23
23
public class JobConversions
24
24
{
25
- #region Hydra to PS convertors
25
+ #region ServiceClient to PS convertors
26
26
27
27
/// <summary>
28
28
/// 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
31
31
/// return a job details object. Otherwise it will return a job object.
32
32
/// </summary>
33
- /// <param name="hydraJob "></param>
33
+ /// <param name="ServiceClientJob "></param>
34
34
/// <returns></returns>
35
- public static CmdletModel . AzureRmRecoveryServicesBackupJobBase GetPSJob ( JobResponse hydraJob )
35
+ public static CmdletModel . AzureRmRecoveryServicesBackupJobBase GetPSJob ( JobResponse serviceClientJob )
36
36
{
37
- return GetPSJob ( hydraJob . Item ) ;
37
+ return GetPSJob ( serviceClientJob . Item ) ;
38
38
}
39
39
40
- public static CmdletModel . AzureRmRecoveryServicesBackupJobBase GetPSJob ( JobResource hydraJob )
40
+ public static CmdletModel . AzureRmRecoveryServicesBackupJobBase GetPSJob ( JobResource serviceClientJob )
41
41
{
42
42
CmdletModel . AzureRmRecoveryServicesBackupJobBase response = null ;
43
43
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 )
46
46
{
47
47
Logger . Instance . WriteWarning ( Resources . UnsupportedJobWarning ) ;
48
48
}
49
- else if ( hydraJob . Properties . GetType ( ) == typeof ( AzureIaaSVMJob ) )
49
+ else if ( serviceClientJob . Properties . GetType ( ) == typeof ( AzureIaaSVMJob ) )
50
50
{
51
- response = GetPSAzureVmJob ( hydraJob ) ;
51
+ response = GetPSAzureVmJob ( serviceClientJob ) ;
52
52
}
53
53
54
54
return response ;
55
55
}
56
56
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 )
58
58
{
59
- if ( hydraJobs . ItemList != null && hydraJobs . ItemList . Value != null )
59
+ if ( serviceClientJobs . ItemList != null && serviceClientJobs . ItemList . Value != null )
60
60
{
61
- foreach ( var job in hydraJobs . ItemList . Value )
61
+ foreach ( var job in serviceClientJobs . ItemList . Value )
62
62
{
63
63
CmdletModel . AzureRmRecoveryServicesBackupJobBase convertedJob = GetPSJob ( job ) ;
64
64
if ( convertedJob != null )
@@ -72,11 +72,11 @@ public static void AddHydraJobsToPSList(JobListResponse hydraJobs, List<CmdletMo
72
72
73
73
#region AzureVm job private helpers
74
74
75
- private static CmdletModel . AzureRmRecoveryServicesBackupAzureVmJob GetPSAzureVmJob ( JobResource hydraJob )
75
+ private static CmdletModel . AzureRmRecoveryServicesBackupAzureVmJob GetPSAzureVmJob ( JobResource serviceClientJob )
76
76
{
77
77
CmdletModel . AzureRmRecoveryServicesBackupAzureVmJob response ;
78
78
79
- AzureIaaSVMJob vmJob = hydraJob . Properties as AzureIaaSVMJob ;
79
+ AzureIaaSVMJob vmJob = serviceClientJob . Properties as AzureIaaSVMJob ;
80
80
81
81
if ( vmJob . ExtendedInfo != null )
82
82
{
@@ -87,7 +87,7 @@ private static CmdletModel.AzureRmRecoveryServicesBackupAzureVmJob GetPSAzureVmJ
87
87
response = new CmdletModel . AzureRmRecoveryServicesBackupAzureVmJob ( ) ;
88
88
}
89
89
90
- response . JobId = GetLastIdFromFullId ( hydraJob . Id ) ;
90
+ response . JobId = GetLastIdFromFullId ( serviceClientJob . Id ) ;
91
91
response . StartTime = vmJob . StartTime ;
92
92
response . EndTime = vmJob . EndTime ;
93
93
response . Duration = vmJob . Duration ;
@@ -140,15 +140,15 @@ private static CmdletModel.AzureRmRecoveryServicesBackupAzureVmJob GetPSAzureVmJ
140
140
return response ;
141
141
}
142
142
143
- private static CmdletModel . AzureRmRecoveryServicesBackupAzureVmJobErrorInfo GetPSAzureVmErrorInfo ( AzureIaaSVMErrorInfo hydraError )
143
+ private static CmdletModel . AzureRmRecoveryServicesBackupAzureVmJobErrorInfo GetPSAzureVmErrorInfo ( AzureIaaSVMErrorInfo serviceClientError )
144
144
{
145
145
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 )
149
149
{
150
150
psErrorInfo . Recommendations = new List < string > ( ) ;
151
- psErrorInfo . Recommendations . AddRange ( hydraError . Recommendations ) ;
151
+ psErrorInfo . Recommendations . AddRange ( serviceClientError . Recommendations ) ;
152
152
}
153
153
154
154
return psErrorInfo ;
0 commit comments