private void ProcessUpdateSchedules() { if (BackupSchedulesToUpdate != null && BackupSchedulesToUpdate.Length > 0) { schedulesToUpdate = new List <BackupScheduleUpdateRequest>(); foreach (var updateSchedule in BackupSchedulesToUpdate) { BackupScheduleUpdateRequest updateschedule = (BackupScheduleUpdateRequest)updateSchedule.BaseObject; schedulesToUpdate.Add(updateschedule); } } updateConfig.BackupSchedulesToBeUpdated = schedulesToUpdate; }
public override void ExecuteCmdlet() { try { BackupScheduleUpdateRequest updateScheduleObject = new BackupScheduleUpdateRequest(); updateScheduleObject.BackupType = (BackupType)Enum.Parse(typeof(BackupType), BackupType); updateScheduleObject.Status = Enabled ? ScheduleStatus.Enabled : ScheduleStatus.Disabled; updateScheduleObject.RetentionCount = RetentionCount; updateScheduleObject.StartTime = StartFromDateTime; updateScheduleObject.Recurrence = new ScheduleRecurrence(); updateScheduleObject.Recurrence.RecurrenceType = (RecurrenceType)Enum.Parse(typeof(RecurrenceType), RecurrenceType); updateScheduleObject.Recurrence.RecurrenceValue = RecurrenceValue; updateScheduleObject.Id = Id; StorSimpleClient.ValidateBackupScheduleUpdateRequest(updateScheduleObject); WriteObject(updateScheduleObject); } catch (Exception exception) { this.HandleException(exception); } }
public void ValidateBackupScheduleUpdateRequest(BackupScheduleUpdateRequest updateScheduleObject) { updateScheduleObject.StartTime = GetValidStartTime(updateScheduleObject.StartTime); ValidateRetentionCount(updateScheduleObject.RetentionCount); ValidateRecurrenceValue(updateScheduleObject.Recurrence.RecurrenceValue); }