public IList <ImagesListResponse> GetAllImagesByIp(string ip) { var client = _pools.GetPoolByIp(ip).Get(); IList <ImagesListResponse> images = client.Images.ListImagesAsync(new ImagesListParameters()).Result; return(images); }
public ReturnContainersById GetAllById(string userId) { List <Server> servers = _serverService.GetAll(userId); var res = new ReturnContainersById() { Servers = new List <Server>(), Containers = new List <IList <ContainerListResponse> >() }; foreach (var i in servers) { var client = _pools.GetPoolByIp(i.Ip).Get(); ContainersListParameters p = new ContainersListParameters() { All = true }; var containers = client.Containers.ListContainersAsync(p).GetAwaiter().GetResult(); res.Servers.Add(i); res.Containers.Add(containers); } return(res); }