Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Docker.DotNet/Endpoints/ContainerOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ internal ContainerOperations(DockerClient client)
return await _client.MakeRequestAsync<ContainerInspectResponse>(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"containers/{id}/json", cancellationToken).ConfigureAwait(false);
}

public async Task<ContainerInspectResponse> 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<ContainerInspectParameters>(parameters);
return await _client.MakeRequestAsync<ContainerInspectResponse>(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"containers/{id}/json", queryString, cancellationToken).ConfigureAwait(false);
}

public async Task<ContainerProcessesResponse> ListProcessesAsync(string id, ContainerListProcessesParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
{
if (string.IsNullOrEmpty(id))
Expand Down
14 changes: 14 additions & 0 deletions src/Docker.DotNet/Endpoints/IContainerOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ public interface IContainerOperations
/// <exception cref="HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.</exception>
Task<ContainerInspectResponse> InspectContainerAsync(string id, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Retrieves low-level information about a container with additional options.
/// </summary>
/// <param name="id">The ID or name of the container.</param>
/// <param name="parameters">Specifics of how to perform the operation, such as whether to include size information.</param>
/// <param name="cancellationToken">When triggered, the operation will stop at the next available time, if possible.</param>
/// <returns>A <see cref="Task{TResult}"/> that resolves to a <see cref="ContainerInspectResponse"/>, which holds details about the container.</returns>
/// <remarks>The corresponding commands in the Docker CLI are <c>docker inspect --size</c> and <c>docker container inspect --size</c>.</remarks>
/// <exception cref="DockerContainerNotFoundException">No such container was found.</exception>
/// <exception cref="ArgumentNullException">One or more of the inputs was <see langword="null"/>.</exception>
/// <exception cref="DockerApiException">the daemon experienced an error.</exception>
/// <exception cref="HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.</exception>
Task<ContainerInspectResponse> InspectContainerAsync(string id, ContainerInspectParameters parameters, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Retrieves a list of processes running within the container.
/// </summary>
Expand Down
Loading