public AzureRMBackupJob(AzureRMBackupVault vault, Mgmt.CSMJobProperties serviceJob, string jobName) : base(vault) { this.InstanceId = jobName; this.WorkloadType = AzureBackupJobHelper.GetTypeForPS(serviceJob.WorkloadType); this.WorkloadName = serviceJob.EntityFriendlyName; this.Operation = serviceJob.Operation; this.Status = serviceJob.Status; this.Duration = serviceJob.Duration; this.StartTime = serviceJob.StartTimestamp; this.EndTime = serviceJob.EndTimestamp; this.ErrorDetails = new List<ErrorInfo>(); if (serviceJob.ErrorDetails != null) { foreach (Mgmt.CSMJobErrorInfo error in serviceJob.ErrorDetails) { this.ErrorDetails.Add(new ErrorInfo(error)); } } this.IsRetriable = this.IsCancellable = false; if (serviceJob.ActionsInfo != null) { for (int i = 0; i < serviceJob.ActionsInfo.Count; i++) { if (serviceJob.ActionsInfo[i] == Mgmt.JobSupportedAction.Cancellable) this.IsCancellable = true; else if (serviceJob.ActionsInfo[i] == Mgmt.JobSupportedAction.Retriable) this.IsRetriable = true; } } }
public ErrorInfo(Mgmt.CSMJobErrorInfo serviceErrorInfo) { this.ErrorCode = serviceErrorInfo.ErrorCode; this.ErrorMessage = serviceErrorInfo.ErrorString; this.Recommendations = new List<string>(); foreach(string recommendation in serviceErrorInfo.Recommendations) { this.Recommendations.Add(recommendation); } }
// Not adding other fields because service is not filling them today. public AzureBackupJobSubTask(Mgmt.CSMJobTaskDetails serviceTask) { this.Name = serviceTask.TaskId; this.Status = serviceTask.Status; }
public AzureRMBackupJobDetails(AzureRMBackupVault vault, Mgmt.CSMJobDetailedProperties serviceJobProperties, string jobName) : base(vault, serviceJobProperties, jobName) { if (serviceJobProperties.PropertyBag != null) this.Properties = new Dictionary<string, string>(serviceJobProperties.PropertyBag); else this.Properties = new Dictionary<string, string>(); this.SubTasks = new List<AzureBackupJobSubTask>(); if(serviceJobProperties.TasksList != null) { foreach (Mgmt.CSMJobTaskDetails serviceSubTask in serviceJobProperties.TasksList) { this.SubTasks.Add(new AzureBackupJobSubTask(serviceSubTask)); } } }