-
Notifications
You must be signed in to change notification settings - Fork 403
Open
Labels
Description
This is to start a discussion about a possible enhancement to the project.
The library already does a great job of exposing the Docker REST API to .NET consumers on a 1:1 basis of .NET methods to REST calls, and doing all the heavy lifting for transport and streaming and such. I think the next step is to provide a layer on top of that excellent foundation, to expose the functionality in a way that's more idiomatically .NET. The goal would be to provide a low barrier to entry to access Docker via .NET--even for people who are new to Docker.
Three examples to get us started:
ContainerOperations.AttachContainerAsyncneeds to know whether the container was started with TTY. It has no way to get that without either doing an extra REST call (which doesn't fit the 1:1 mapping philosophy) or getting it from the caller (which puts a burden on the caller). In the proposed layer, theAttachAsyncwould use two calls to the lower layer--one to get the TTY value and one toContainerOperations.AttachContainerAsync.ImagesListParameters.Filtersis of typeIDictionary<string, IDictionary<string, bool>>because that's the best mapping to the REST API. Someone not familiar with the REST API will have trouble figuring out how to use that. And since the class is generated code, there's no XML documentation onFiltersto help. In the proposed layer, the options class for ListAsync would have members such asbool? Danglingandstring[]? NameFilter, with documentation.- The return value from
ContainerOperations.InspectContainerAsyncgives information about the container, but not nested data such as the image's name or details of the associated volumes. In the proposed layer,InspectAsyncwould return a rich object. The consumer would be able to use, for example,container.Image.Nameorcontainer.Volume.Where(volume => !volume.MountPoint.IsReadOnly). (This requires several REST calls, but I'm assuming that consumers generally aren't optimizing for speed. If they are, they can still use the lower layer for more control.)
Thoughts?
shoterFedererer