pachadotdev / analogsea

Digital Ocean R client
https://pacha.dev/analogsea/
Apache License 2.0
155 stars 24 forks source link

Ideas for revamped docklet API #80

Open wch opened 10 years ago

wch commented 10 years ago

Right now, the docklet_* functions are basically wrappers for droplet_ssh that put "docker" as the first argument in the command. I suggest changing it so that a "docklet" (or some other name) is an object which refers to a specific docker container running on a droplet. You might have some functions like:

Also, there would be some functions that operate on the docker system as a whole:

And so on.

Now that I think of it some more, maybe this should be spun out into a separate package so that it could be used with other systems besides Digital Ocean - and even control local docker installations, in their various flavors (i.e., docker and boot2docker).

Thoughts?

sckott commented 10 years ago

@wch I agree on the re-worked API and the separate package. @hadley ?

On the docklet API, I think that makes sense because we've made the droplet_* functions work on individual droplets, whereas with docklet_* functions you need to pass an image name to them, where there can be many within a droplet.

wch commented 10 years ago

I got started here: https://github.com/wch/harbor. If you guys want to be added to the repo, just let me know.

The function names will be container_* for commands specific to a particular container, and docker_* for commands for the docker system as a whole.

If you have suggestions for a better name, I'm open to suggestions -- there's a slight mismatch between the package name (harbor) and the command names (docker_*).