Beispiel #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);
        }
 public Task <List <TaskAgent> > GetAgentsAsync(int agentPoolId, string agentName = null)
 {
     CheckConnection();
     return(_taskAgentClient.GetAgentsAsync(agentPoolId, agentName, false));
 }