diff --git a/src/Docker.DotNet/Endpoints/ContainerOperations.cs b/src/Docker.DotNet/Endpoints/ContainerOperations.cs index 9fad6cad..6f797152 100644 --- a/src/Docker.DotNet/Endpoints/ContainerOperations.cs +++ b/src/Docker.DotNet/Endpoints/ContainerOperations.cs @@ -64,6 +64,22 @@ internal ContainerOperations(DockerClient client) return await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"containers/{id}/json", cancellationToken).ConfigureAwait(false); } + public async Task InspectContainerAsync(string id, ContainerInspectParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + if (string.IsNullOrEmpty(id)) + { + throw new ArgumentNullException(nameof(id)); + } + + if (parameters == null) + { + throw new ArgumentNullException(nameof(parameters)); + } + + IQueryString queryString = new QueryString(parameters); + return await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"containers/{id}/json", queryString, cancellationToken).ConfigureAwait(false); + } + public async Task ListProcessesAsync(string id, ContainerListProcessesParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { if (string.IsNullOrEmpty(id)) diff --git a/src/Docker.DotNet/Endpoints/IContainerOperations.cs b/src/Docker.DotNet/Endpoints/IContainerOperations.cs index 52acc010..cb21bc3f 100644 --- a/src/Docker.DotNet/Endpoints/IContainerOperations.cs +++ b/src/Docker.DotNet/Endpoints/IContainerOperations.cs @@ -43,6 +43,20 @@ public interface IContainerOperations /// The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. Task InspectContainerAsync(string id, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves low-level information about a container with additional options. + /// + /// The ID or name of the container. + /// Specifics of how to perform the operation, such as whether to include size information. + /// When triggered, the operation will stop at the next available time, if possible. + /// A that resolves to a , which holds details about the container. + /// The corresponding commands in the Docker CLI are docker inspect --size and docker container inspect --size. + /// No such container was found. + /// One or more of the inputs was . + /// the daemon experienced an error. + /// The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + Task InspectContainerAsync(string id, ContainerInspectParameters parameters, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Retrieves a list of processes running within the container. ///