Esempio n. 1
0
        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;
                }
            }
        }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
        // Not adding other fields because service is not filling them today.

        public AzureBackupJobSubTask(Mgmt.CSMJobTaskDetails serviceTask)
        {
            this.Name = serviceTask.TaskId;
            this.Status = serviceTask.Status;
        }
Esempio n. 4
0
        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));
                }
            }
        }