예제 #1
0
 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);
     }
 }
예제 #3
0
 public void ValidateBackupScheduleUpdateRequest(BackupScheduleUpdateRequest updateScheduleObject)
 {
     updateScheduleObject.StartTime = GetValidStartTime(updateScheduleObject.StartTime);
     ValidateRetentionCount(updateScheduleObject.RetentionCount);
     ValidateRecurrenceValue(updateScheduleObject.Recurrence.RecurrenceValue);
 }