skip to navigation
skip to content

orchard 2.0.1

Latest Version: 2.0.2

This package provides Python bindings for [Orchard], letting you manage Docker hosts for a particular account and interact with an individual host using [docker-py].


`bash $ pip install orchard `


The orchard package provides two methods for instantiating an API client:

`python >>> import orchard >>> orchard.with_token(my_token) <orchard.client.Client object at 0x101de0d10> >>> orchard.with_username_and_password(my_username, my_password) <orchard.client.Client object at 0x102244e10> `

Managing hosts

Once you’ve instaniated a Client object, the hosts property lets you list, create and delete hosts:

`python >>> client.hosts [<Host: default>, <Host: host2>] >>> client.hosts[0] <Host: default> >>> client.hosts["host2"] <Host: host2> >>> host3 = client.hosts.create({"name": "host3"}) >>> host3 <Host: host3> >>> host3.delete() `

Interacting with Docker

To get a [docker-py] instance for a host, call host.docker():

`python >>> docker = client.hosts["default"].docker() >>> docker.containers() [] >>> c = docker.create_container("ubuntu", "date") >>> docker.start(c['Id']) >>> docker.wait(c['Id']) 0 >>> docker.logs(c['Id']) 'Mon Oct 28 15:42:56 UTC 2013\n' >>> docker.remove_container(c['Id']) `

See the [docker-py] README for a full list of methods.

[Orchard]: [docker-py]: [CLI docs]: [Orchard API docs]:

File Type Py Version Uploaded on Size
orchard-2.0.1.tar.gz (md5) Source 2014-04-25 15KB