You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2016/01/20 04:43:55 UTC
[07/50] libcloud git commit: Adding comments and additional
explanation to the docker driver.
Adding comments and additional explanation to the docker driver.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/6a4a772c
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/6a4a772c
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/6a4a772c
Branch: refs/heads/trunk
Commit: 6a4a772c88ce7667fc52ca8f1d71f4ec3121da56
Parents: 8e749b5
Author: anthony-shaw <an...@gmail.com>
Authored: Wed Dec 23 19:28:42 2015 +1100
Committer: anthony-shaw <an...@gmail.com>
Committed: Wed Dec 23 19:28:42 2015 +1100
----------------------------------------------------------------------
libcloud/container/drivers/docker.py | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a4a772c/libcloud/container/drivers/docker.py
----------------------------------------------------------------------
diff --git a/libcloud/container/drivers/docker.py b/libcloud/container/drivers/docker.py
index 3e456d5..9d60d20 100644
--- a/libcloud/container/drivers/docker.py
+++ b/libcloud/container/drivers/docker.py
@@ -28,6 +28,7 @@ from libcloud.utils.py3 import b
from libcloud.common.base import JsonResponse, ConnectionUserAndKey
from libcloud.common.types import InvalidCredsError
+
from libcloud.container.base import (Container, ContainerDriver,
ContainerImage)
@@ -121,7 +122,7 @@ class DockerContainerDriver(ContainerDriver):
connect with tls authentication, by providing a hostname, port, a private
key file (.pem) and certificate (.pem) file
>>> conn = driver(host='https://198.61.239.128',
- port=4243, key_file='key.pem', cert_file='cert.pem')
+ >>> port=4243, key_file='key.pem', cert_file='cert.pem')
"""
type = Provider.DOCKER
@@ -132,7 +133,31 @@ class DockerContainerDriver(ContainerDriver):
def __init__(self, key=None, secret=None, secure=False, host='localhost',
port=4243, key_file=None, cert_file=None):
+ """
+ :param key: API key or username to used (required)
+ :type key: ``str``
+
+ :param secret: Secret password to be used (required)
+ :type secret: ``str``
+
+ :param secure: Whether to use HTTPS or HTTP. Note: Some providers
+ only support HTTPS, and it is on by default.
+ :type secure: ``bool``
+
+ :param host: Override hostname used for connections.
+ :type host: ``str``
+ :param port: Override port used for connections.
+ :type port: ``int``
+
+ :param key_file: Path to private key for TLS connection (optional)
+ :type key_file: ``str``
+
+ :param cert_file: Path to public key for TLS connection (optional)
+ :type cert_file: ``str``
+
+ :return: ``None``
+ """
super(DockerContainerDriver, self).__init__(key=key, secret=secret,
secure=secure, host=host,
port=port,
@@ -271,6 +296,8 @@ class DockerContainerDriver(ContainerDriver):
"""
Deploy an installed container image
+ For details on the additional parameters see : http://bit.ly/1PjMVKV
+
:param name: The name of the new container
:type name: ``str``
@@ -599,7 +626,7 @@ class DockerContainerDriver(ContainerDriver):
id=data['Id'],
name=name,
image=ContainerImage(
- id=None,
+ id=data.get('ImageID', None),
path=image,
name=image,
version=None,