コード例 #1
0
ファイル: AutomationClient.cs プロジェクト: elvg/ASCTest
        private Schedule UpdateScheduleHelper(string automationAccountName,
                                              AutomationManagement.Models.Schedule schedule, bool?isEnabled, string description)
        {
            if (isEnabled.HasValue)
            {
                schedule.Properties.IsEnabled = isEnabled.Value;
            }

            if (description != null)
            {
                schedule.Properties.Description = description;
            }

            var scheduleUpdateParameters = new AutomationManagement.Models.ScheduleUpdateParameters
            {
                Name       = schedule.Name,
                Properties = new AutomationManagement.Models.ScheduleUpdateProperties
                {
                    Description = schedule.Properties.Description,
                    IsEnabled   = schedule.Properties.IsEnabled
                }
            };

            this.automationManagementClient.Schedules.Update(
                automationAccountName,
                scheduleUpdateParameters);

            return(this.GetSchedule(automationAccountName, schedule.Name));
        }
コード例 #2
0
        private Schedule UpdateScheduleHelper(string automationAccountName, AutomationManagement.Models.Schedule schedule, bool?isEnabled, string description)
        {
            // StartTime and ExpiryTime need to specified as Utc
            schedule.StartTime  = DateTime.SpecifyKind(schedule.StartTime, DateTimeKind.Utc);
            schedule.ExpiryTime = DateTime.SpecifyKind(schedule.ExpiryTime, DateTimeKind.Utc);

            if (isEnabled.HasValue)
            {
                schedule.IsEnabled = isEnabled.Value;
            }

            if (description != null)
            {
                schedule.Description = description;
            }

            var scheduleUpdateParameters = new AutomationManagement.Models.ScheduleUpdateParameters
            {
                Schedule =
                    schedule
            };

            this.automationManagementClient.Schedules.Update(
                automationAccountName,
                scheduleUpdateParameters);

            var scheduleId = new Guid(schedule.Id);

            return(this.GetSchedule(automationAccountName, scheduleId));
        }
コード例 #3
0
        private Schedule UpdateScheduleHelper(string automationAccountName,
            string scheduleName, bool? isEnabled, string description)
        {
            var scheduleUpdateParameters = new AutomationManagement.Models.ScheduleUpdateParameters
            {
                Name = scheduleName,
                Properties = new AutomationManagement.Models.ScheduleUpdateProperties
                {
                    Description = description,
                    IsEnabled = isEnabled
                }
            };

            this.automationManagementClient.Schedules.Update(
                automationAccountName,
                scheduleUpdateParameters);

            return this.GetSchedule(automationAccountName, scheduleName);
        }
コード例 #4
0
        private Schedule UpdateScheduleHelper(string automationAccountName, AutomationManagement.Models.Schedule schedule, bool? isEnabled, string description)
        {
            // StartTime and ExpiryTime need to specified as Utc
            schedule.StartTime = DateTime.SpecifyKind(schedule.StartTime, DateTimeKind.Utc);
            schedule.ExpiryTime = DateTime.SpecifyKind(schedule.ExpiryTime, DateTimeKind.Utc);

            if (isEnabled.HasValue)
            {
                schedule.IsEnabled = isEnabled.Value;
            }

            if (description != null)
            {
                schedule.Description = description;
            }

            var scheduleUpdateParameters = new AutomationManagement.Models.ScheduleUpdateParameters
            {
                Schedule =
                    schedule
            };

            this.automationManagementClient.Schedules.Update(
                automationAccountName,
                scheduleUpdateParameters);

            var scheduleId = new Guid(schedule.Id);
            return this.GetSchedule(automationAccountName, scheduleId);
        }