File: //usr/local/CyberPanel/lib64/python3.10/site-packages/docker/api/__pycache__/client.cpython-310.pyc
o
��h�K � @ s� d dl Z d dlZd dlZd dlmZ d dlZd dlZd dlZddlm Z ddl
mZmZm
Z
mZmZmZmZmZ ddlmZmZmZmZ ddlmZ ddlmZ dd lmZmZmZmZ dd
l m!Z! ddl"m#Z# ddl$m%Z%m&Z&m'Z' d
dl(m)Z) d
dlm*Z* d
dl+m,Z, d
dl-m.Z. d
dl/m0Z0 d
dl1m2Z2 d
dl3m4Z4 d
dl5m6Z6 d
dl7m8Z8 d
dl9m:Z: d
dl;m<Z< d
dl=m>Z> zddlm?Z? W n e@y� Y nw zddlmAZA W n e@y� Y nw G dd� dejBe)e*e,e.e0e2e4e6e8e:e<e>�ZCdS )� N)�partial� )�auth)�DEFAULT_MAX_POOL_SIZE�DEFAULT_NUM_POOLS�DEFAULT_NUM_POOLS_SSH�DEFAULT_TIMEOUT_SECONDS�DEFAULT_USER_AGENT�IS_WINDOWS_PLATFORM�MINIMUM_DOCKER_API_VERSION�STREAM_HEADER_SIZE_BYTES)�DockerException�InvalidVersion�TLSParameterError�$create_api_error_from_http_exception)� TLSConfig)�UnixHTTPAdapter)�check_resource�config�update_headers�utils)�json_stream)�ProxyConfig)�consume_socket_output�
demux_adaptor�frames_iter� )�
BuildApiMixin)�ConfigApiMixin)�ContainerApiMixin)�DaemonApiMixin)�ExecApiMixin)�
ImageApiMixin)�NetworkApiMixin)�PluginApiMixin)�SecretApiMixin)�ServiceApiMixin)�
SwarmApiMixin)�VolumeApiMixin)�NpipeHTTPAdapter)�SSHHTTPAdapterc sR e Zd ZdZejjg d� Zddededdde f � fdd� Z
dd� Zd d
� Ze
dd� �Ze
d
d� �Ze
dd� �Ze
dd� �Zdd� Zdd� Zd@dd�Zdd� ZdAdd�Zed�dAdd��Zd d!� Zd"d#� ZdBd$d%�Zd&d'� Zd(d)� ZdCd,d-�ZdDd.d/�Zd0d1� Z ed�d2d3� �Z!d4d5� Z"d6d7� Z#d8d9� Z$� fd:d;�Z%e&d<d=� �Z'dAd>d?�Z(� Z)S )E� APIClientaW
A low-level client for the Docker Engine API.
Example:
>>> import docker
>>> client = docker.APIClient(base_url='unix://var/run/docker.sock')
>>> client.version()
{u'ApiVersion': u'1.33',
u'Arch': u'amd64',
u'BuildTime': u'2017-11-19T18:46:37.000000000+00:00',
u'GitCommit': u'f4ffd2511c',
u'GoVersion': u'go1.9.2',
u'KernelVersion': u'4.14.3-1-ARCH',
u'MinAPIVersion': u'1.12',
u'Os': u'linux',
u'Version': u'17.10.0-ce'}
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.
)�
_auth_configs�_general_configs�_version�base_url�timeoutNFc
s� t � �� |r
|s
td��|| _|| _|| jd<