Пример #1
0
        public static JobDto[] Run_a_Job(ReleaseDto release)
        {
            JobDto[] jobs = null;
            try
            {
                string token           = Get_Token();
                string processName     = release.ProcessKey;
                string environmentName = release.EnvironmentName;

                var robots      = OrchestratorAPIHelper.GetListOfRobots(token);
                var matchRobots = OrchestratorAPIHelper.GetRobots(robots, environmentName);

                List <int> robotIds = new List <int>();
                foreach (var robot in matchRobots)
                {
                    robotIds.Add(robot.Id);
                }

                jobs = OrchestratorAPIHelper.ExecuteRobot(token, release.Key, robotIds.ToArray());
            }
            catch (Exception e)
            {
                throw e;
            }

            return(jobs);
        }
Пример #2
0
        public static RobotDto[] Fetch_all_Robots()
        {
            string token  = Get_Token();
            var    robots = OrchestratorAPIHelper.GetListOfRobots(token);

            return(robots);
        }
Пример #3
0
        public static RobotDto[] Fetch_all_Robots_by_Environment(string environmentName)
        {
            string token       = Get_Token();
            var    robots      = OrchestratorAPIHelper.GetListOfRobots(token);
            var    matchRobots = OrchestratorAPIHelper.GetRobots(robots, environmentName);

            return(matchRobots);
        }