예제 #1
0
 protected override void ProcessRecord()
 {
     ProcessImpl(
         (filter, top, skip) => Api.ProcessSchedules.GetProcessSchedules(filter: filter, top: top, skip: skip, count: false),
         id => Api.ProcessSchedules.GetById(id),
         dto => ProcessSchedule.FromDto(dto));
 }
예제 #2
0
 protected override void ProcessRecord()
 {
     ProcessImpl(
         filter => Api.ProcessSchedules.GetProcessSchedules(filter: filter).Value,
         id => Api.ProcessSchedules.GetById(id),
         dto => ProcessSchedule.FromDto(dto));
 }
예제 #3
0
 protected override void ProcessRecord()
 {
     if (Supports(OrchestratorProtocolVersion.V19_10))
     {
         ProcessImpl(
             (filter, top, skip) => HandleHttpResponseException(() => Api_19_10.ProcessSchedules.GetProcessSchedulesWithHttpMessagesAsync(filter: filter, top: top, skip: skip, count: false)),
             id => HandleHttpResponseException(() => Api_19_10.ProcessSchedules.GetByIdWithHttpMessagesAsync(id)),
             dto => ProcessSchedule.FromDto(dto));
     }
     else
     {
         ProcessImpl(
             (filter, top, skip) => Api.ProcessSchedules.GetProcessSchedules(filter: filter, top: top, skip: skip, count: false),
             id => Api.ProcessSchedules.GetById(id),
             dto => ProcessSchedule.FromDto(dto));
     }
 }
        private void AddQueueSchedule()
        {
            var dto = new ProcessSchedule201910Dto
            {
                Name = Name,
                QueueDefinitionId           = Queue.Id,
                ReleaseId                   = Process.Id,
                ItemsActivationThreshold    = ItemsActivationThreshold,
                ItemsPerJobActivationTarget = ItemsPerJobActivationTarget,
                MaxJobsForActivation        = MaxJobsForActivation,
                TimeZoneId                  = TimeZoneId,
                StartProcessCron            = StartProcessCron,
                StartProcessCronDetails     = "{\"type\": 5, \"advancedCronExpression\":\"" + StartProcessCron + "\"}",
                StartStrategy               = -1,
            };

            var schedule = HandleHttpResponseException(() => Api_19_10.ProcessSchedules.PostWithHttpMessagesAsync(dto));

            WriteObject(ProcessSchedule.FromDto(schedule));
        }
예제 #5
0
        protected override void ProcessRecord()
        {
            var dto = new ProcessScheduleDto
            {
                Name                    = Name,
                StartProcessCron        = StartProcessCron,
                StartProcessCronDetails = "{\"type\": 5, \"advancedCronExpression\":\"" + StartProcessCron + "\"}",
                ReleaseId               = Process.Id,
                TimeZoneId              = TimeZoneId
            };

            if (StopAfterMinutes.HasValue)
            {
                dto.StopProcessExpression = TimeSpan.FromMinutes(StopAfterMinutes.Value).TotalSeconds.ToString();
                dto.StopStrategy          = (ProcessScheduleDtoStopStrategy)Enum.Parse(typeof(ProcessScheduleDtoStopStrategy), StopStrategy);
            }

            if (ParameterSetName == AllRobotsSet)
            {
                dto.StartStrategy = -1;
            }
            else if (ParameterSetName == RobotCountSet)
            {
                dto.StartStrategy = RobotCount;
            }
            else if (ParameterSetName == SpecificRobotsSet)
            {
                dto.StartStrategy  = 0;
                dto.ExecutorRobots = Robots.Select(r => new RobotExecutorDto
                {
                    Id = r.Id
                }).ToList();
            }

            var schedule = HandleHttpOperationException(() => Api.ProcessSchedules.Post(dto));

            WriteObject(ProcessSchedule.FromDto(schedule));
        }