Skip to main content

UNKNOWN

Project description

This package provides both a command-line and Python client for [Orchard]. Both provide functionality for managing Orchard apps under an account and for interacting with an individual app’s Docker instance using [docker-py].

Install

$ pip install orchard

Command-line client

For help on using Orchard from the command-line, run orchard –help or see the [CLI docs] on the website.

Authenticating

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

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

Managing apps

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

>>> client.apps
[<App: app1>, <App: app2>]
>>> client.apps[0]
<App: app1>
>>> client.apps["app2"]
<App: app2>
>>> app3 = client.apps.create({"name": "app3"})
>>> app3
<App: app3>
>>> app3.delete()

Interacting with Docker

To get a [docker-py] instance for an app, call client.docker(app_name):

>>> docker = client.docker("app1")
>>> docker
<orchard.api.docker_client.DockerClient object at 0x1022a4e50>
>>> docker.containers()
[]
>>> c = docker.create_container("ubuntu", "touch /file.txt")
>>> docker.inspect_container(c['Id'])
{
    u'ID': u'8d1ade26b2b50026a74a5bc55dbe9131fdbd17b1311b512568913e9b84f01209',
    u'Image': u'8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c',
    u'Path': u'touch',
    u'Args': [u'/file.txt'],
    u'State': {...},
    u'Config': {...},
    u'NetworkSettings': {...},
    ...
}
>>> docker.start(c['Id'])
>>> docker.diff(c['Id'])
[
    {u'Path': u'/dev', u'Kind': 0},
    {u'Path': u'/dev/kmsg', u'Kind': 1},
    {u'Path': u'/file.txt', u'Kind': 1}
]

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

[Orchard]: https://orchardup.com [docker-py]: https://github.com/dotcloud/docker-py [CLI docs]: https://orchardup.com/docs/cli

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orchard-1.0.1.tar.gz (13.7 kB view details)

Uploaded Source

File details

Details for the file orchard-1.0.1.tar.gz.

File metadata

  • Download URL: orchard-1.0.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for orchard-1.0.1.tar.gz
Algorithm Hash digest
SHA256 305f7bf1f26ed8b835a37256813c26e75286126f18997468da0f3bdbcabded7a
MD5 bad12a660fcfb83210c6ae17877afb17
BLAKE2b-256 e24ce44f0ff217fa7fe92460368d9493b8c420e5d033f7e13b077d4b7d14d67e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page