Esempio n. 1
0
        private async Task <IEnumerable <Agent> > GetAllAgentsForInstance(TaskAgentHttpClient client, ILogger logger)
        {
            IEnumerable <Agent> allAgents = new List <Agent>();
            var pools = await client.GetAgentPoolsAsync();

            foreach (var p in pools.Where(x => x.IsHosted == false))
            {
                var agentsInPool = await client.GetAgentsAsync(p.Id, includeCapabilities : true);

                var convertedAgents = agentsInPool.Select(x => new Agent(x, p.Id));

                allAgents = allAgents.Concat(convertedAgents);
            }

            return(allAgents);
        }
        //-----------------------------------------------------------------
        // Configuration
        //-----------------------------------------------------------------

        public Task <List <TaskAgentPool> > GetAgentPoolsAsync(string agentPoolName, TaskAgentPoolType poolType = TaskAgentPoolType.Automation)
        {
            CheckConnection();
            return(_taskAgentClient.GetAgentPoolsAsync(agentPoolName, poolType: poolType));
        }
Esempio n. 3
0
        //-----------------------------------------------------------------
        // Configuration
        //-----------------------------------------------------------------

        public Task <List <TaskAgentPool> > GetAgentPoolsAsync(string agentPoolName = null, TaskAgentPoolType poolType = TaskAgentPoolType.Automation)
        {
            CheckConnection(RunnerConnectionType.Generic);
            return(_genericTaskAgentClient.GetAgentPoolsAsync(agentPoolName, poolType: poolType));
        }
Esempio n. 4
0
        //-----------------------------------------------------------------
        // Configuration
        //-----------------------------------------------------------------

        public Task <List <TaskAgentPool> > GetAgentPoolsAsync(string agentPoolName)
        {
            CheckConnection();
            return(_taskAgentClient.GetAgentPoolsAsync(agentPoolName));
        }