/// <summary>
 /// Returns a list of running containers, ex: docker ps
 /// </summary>
 /// <returns></returns>
 public async Task<IList<ContainerListResponse>> DockerGetContainers()
 {
     var containerParams = new ListContainersParameters();
     containerParams.All = false;
     
     var response = await client.Containers.ListContainersAsync(containerParams);
     return response; 
 }
        /// <summary>
        /// Returns information about containers for a given host with option to show stopped containers, ex:docker ps -a
        /// </summary>
        /// <param name="all">if true, returns stopped containers</param>
        /// <returns></returns>
        public async Task <IList <ContainerListResponse> > DockerGetContainers(bool all)
        {
            var containerParams = new ListContainersParameters();

            containerParams.All = all;

            var response = await client.Containers.ListContainersAsync(containerParams);

            return(response);
        }
Exemplo n.º 3
0
        public async Task<IList<ContainerListResponse>> ListContainersAsync(ListContainersParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            string path = "containers/json";
            IQueryString queryParameters = new QueryString<ListContainersParameters>(parameters);
            DockerApiResponse response = await this.Client.MakeRequestAsync(this.Client.NoErrorHandlers, HttpMethod.Get, path, queryParameters);
            return this.Client.JsonSerializer.DeserializeObject<ContainerListResponse[]>(response.Body);
        }
Exemplo n.º 4
0
        public async Task <IList <ContainerListResponse> > ListContainersAsync(ListContainersParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            string            path            = "containers/json";
            IQueryString      queryParameters = new QueryString <ListContainersParameters>(parameters);
            DockerApiResponse response        = await this.Client.MakeRequestAsync(this.Client.NoErrorHandlers, HttpMethod.Get, path, queryParameters).ConfigureAwait(false);

            return(this.Client.JsonSerializer.DeserializeObject <ContainerListResponse[]>(response.Body));
        }