The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/pylxd/pull/187

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
I understand that the config specification for `create()` is beyond the
scope of the documentation, but I had to look directly in lxd's code to
figure how to create a container from a local image, something which, I
think, is a rather common usage of (py)lxd.

In this commit, I add an example of such config.

This additional example should be benefical to many other users.
From ab9e8b9cc6083388d92196410c912a102dfcc063 Mon Sep 17 00:00:00 2001
From: Virgil Dupras <hs...@hardcoded.net>
Date: Sun, 16 Oct 2016 13:46:17 -0400
Subject: [PATCH] Improve documentation with a new container example

I understand that the config specification for `create()` is beyond the
scope of the documentation, but I had to look directly in lxd's code to
figure how to create a container from a local image, something which, I
think, is a rather common usage of (py)lxd.

In this commit, I add an example of such config.

This additional example should be benefical to many other users.
---
 doc/source/containers.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/source/containers.rst b/doc/source/containers.rst
index e48af76..014288f 100644
--- a/doc/source/containers.rst
+++ b/doc/source/containers.rst
@@ -105,6 +105,10 @@ If you were to use an actual image source, you would be 
able to operate
 on the container, starting, stopping, snapshotting, and deleting the
 container.
 
+.. code-block:: python
+
+    >>> config = {'name': 'my-container', 'source': {'type': 'image', 'image': 
'ubuntu/trusty'}}
+    >>> container = client.containers.create(config, wait=True)
     >>> container.start()
     >>> container.freeze()
     >>> container.delete()
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to