
                             S SK Jr  S SKJrJr  S SKJr  S SKJr  S SK	J
r
  S SKJr  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr   " S S5      r\R8                  rg)   )	APIClient)DEFAULT_TIMEOUT_SECONDSDEFAULT_MAX_POOL_SIZEConfigCollectionContainerCollectionImageCollectionNetworkCollectionNodeCollectionPluginCollectionSecretCollectionServiceCollectionSwarmVolumeCollection)kwargs_from_envc                   x   \ rS rSrSrS r\S 5       r\S 5       r	\S 5       r
\S 5       r\S 5       r\S	 5       r\S
 5       r\S 5       r\S 5       r\S 5       r\S 5       rS r\R&                  R                  \l        S r\R*                  R                  \l        S r\R,                  R                  \l        S r\R.                  R                  \l        S r\R0                  R                  \l        S r\R2                  R                  \l        S r\R4                  R                  \l        S rSrg)DockerClient   a  
A client for communicating with a Docker server.

Example:

    >>> import docker
    >>> client = docker.DockerClient(base_url='unix://var/run/docker.sock')

Args:
    base_url (str): URL to the Docker server. For example,
        ``unix:///var/run/docker.sock`` or ``tcp://127.0.0.1:1234``.
    version (str): The version of the API to use. Set to ``auto`` to
        automatically detect the server's version. Default: ``1.35``
    timeout (int): Default timeout for API calls, in seconds.
    tls (bool or :py:class:`~docker.tls.TLSConfig`): Enable TLS. Pass
        ``True`` to enable it with default options, or pass a
        :py:class:`~docker.tls.TLSConfig` object to use custom
        configuration.
    user_agent (str): Set a custom user agent for requests to the server.
    credstore_env (dict): Override environment variables when calling the
        credential store process.
    use_ssh_client (bool): If set to `True`, an ssh connection is made
        via shelling out to the ssh client. Ensure the ssh client is
        installed and configured on the host.
    max_pool_size (int): The maximum number of connections
        to save in the pool.
c                 $    [        U0 UD6U l        g N)r   apiselfargskwargss       lib/third_party/docker/client.py__init__DockerClient.__init__,   s    d-f-    c           	          UR                  S[        5      nUR                  S[        5      nUR                  SS5      nUR                  SS5      nU " SUUUUS.[        S0 UD6D6$ )	a|  
Return a client configured from environment variables.

The environment variables used are the same as those used by the
Docker command-line client. They are:

.. envvar:: DOCKER_HOST

    The URL to the Docker host.

.. envvar:: DOCKER_TLS_VERIFY

    Verify the host against a CA certificate.

.. envvar:: DOCKER_CERT_PATH

    A path to a directory containing TLS certificates to use when
    connecting to the Docker host.

Args:
    version (str): The version of the API to use. Set to ``auto`` to
        automatically detect the server's version. Default: ``auto``
    timeout (int): Default timeout for API calls, in seconds.
    max_pool_size (int): The maximum number of connections
        to save in the pool.
    ssl_version (int): A valid `SSL version`_.
    assert_hostname (bool): Verify the hostname of the server.
    environment (dict): The environment to read environment variables
        from. Default: the value of ``os.environ``
    credstore_env (dict): Override environment variables when calling
        the credential store process.
    use_ssh_client (bool): If set to `True`, an ssh connection is
        made via shelling out to the ssh client. Ensure the ssh
        client is installed and configured on the host.

Example:

    >>> import docker
    >>> client = docker.from_env()

.. _`SSL version`:
    https://docs.python.org/3.5/library/ssl.html#ssl.PROTOCOL_TLSv1
timeoutmax_pool_sizeversionNuse_ssh_clientF)r*   r+   r,   r-    )popr   r   r   )clsr$   r*   r+   r,   r-   s         r%   from_envDockerClient.from_env/   sx    Z **Y(?@

?4IJ**Y-$4e< 
')	

 ''
 	
r(   c                     [        U S9$ )zp
An object for managing configs on the server. See the
:doc:`configs documentation <configs>` for full details.
clientr   r"   s    r%   configsDockerClient.configsi         t,,r(   c                     [        U S9$ )zy
An object for managing containers on the server. See the
:doc:`containers documentation <containers>` for full details.
r4   r   r6   s    r%   
containersDockerClient.containersq   s     #$//r(   c                     [        U S9$ )zm
An object for managing images on the server. See the
:doc:`images documentation <images>` for full details.
r4   r
   r6   s    r%   imagesDockerClient.imagesy   s     d++r(   c                     [        U S9$ )zs
An object for managing networks on the server. See the
:doc:`networks documentation <networks>` for full details.
r4   r   r6   s    r%   networksDockerClient.networks        !--r(   c                     [        U S9$ )zj
An object for managing nodes on the server. See the
:doc:`nodes documentation <nodes>` for full details.
r4   r   r6   s    r%   nodesDockerClient.nodes   s     T**r(   c                     [        U S9$ )zp
An object for managing plugins on the server. See the
:doc:`plugins documentation <plugins>` for full details.
r4   r   r6   s    r%   pluginsDockerClient.plugins   r9   r(   c                     [        U S9$ )zp
An object for managing secrets on the server. See the
:doc:`secrets documentation <secrets>` for full details.
r4   r   r6   s    r%   secretsDockerClient.secrets   r9   r(   c                     [        U S9$ )zs
An object for managing services on the server. See the
:doc:`services documentation <services>` for full details.
r4   r   r6   s    r%   servicesDockerClient.services   rC   r(   c                     [        U S9$ )zl
An object for managing a swarm on the server. See the
:doc:`swarm documentation <swarm>` for full details.
r4   r   r6   s    r%   swarmDockerClient.swarm   s     D!!r(   c                     [        U S9$ )zp
An object for managing volumes on the server. See the
:doc:`volumes documentation <volumes>` for full details.
r4   r   r6   s    r%   volumesDockerClient.volumes   r9   r(   c                 :    U R                   R                  " U0 UD6$ r   )r    eventsr!   s      r%   rW   DockerClient.events   s    xx///r(   c                 6    U R                   R                  5       $ r   )r    dfr6   s    r%   rZ   DockerClient.df   s    xx{{}r(   c                 :    U R                   R                  " U0 UD6$ r   )r    infor!   s      r%   r]   DockerClient.info       xx}}d-f--r(   c                 :    U R                   R                  " U0 UD6$ r   )r    loginr!   s      r%   ra   DockerClient.login   s    xx~~t.v..r(   c                 :    U R                   R                  " U0 UD6$ r   )r    pingr!   s      r%   rd   DockerClient.ping   r_   r(   c                 :    U R                   R                  " U0 UD6$ r   )r    r,   r!   s      r%   r,   DockerClient.version   s    xx000r(   c                 6    U R                   R                  5       $ r   )r    closer6   s    r%   ri   DockerClient.close   s    xx~~r(   c                     SU S3/n[        [        U5      (       a  UR                  S5        [        SR	                  U5      5      e)Nz('DockerClient' object has no attribute ''zIn Docker SDK for Python 2.0, this method is now on the object APIClient. See the low-level API section of the documentation for more details. )hasattrr   appendAttributeErrorjoin)r"   namess      r%   __getattr__DockerClient.__getattr__   sF    7vQ?@9d##HH 7 8 SXXa[))r(   )r    N)__name__
__module____qualname____firstlineno____doc__r&   classmethodr1   propertyr7   r;   r>   rA   rE   rH   rK   rN   rQ   rT   rW   r   rZ   r]   ra   rd   r,   ri   rt   __static_attributes__r.   r(   r%   r   r      s   6. 6
 6
r - - 0 0 , , . . + + - - - - . . " " - -0%%--FN%%BJ.>>))DL/OO++EM.>>))DL1''//GO OO++EM*r(   r   N)
api.clientr   	constantsr   r   models.configsr   models.containersr	   models.imagesr   models.networksr   models.nodesr   models.pluginsr   models.secretsr   models.servicesr   models.swarmr   models.volumesr   utilsr   r   r1   r.   r(   r%   <module>r      sF    ! G , 2 * . ( , , .  , "M* M*`   r(   