MCPcopy Index your code
hub / github.com/docker/docker-py / APIClient

Class APIClient

docker/api/client.py:57–532  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

55
56
57class APIClient(
58 requests.Session,
59 BuildApiMixin,
60 ConfigApiMixin,
61 ContainerApiMixin,
62 DaemonApiMixin,
63 ExecApiMixin,
64 ImageApiMixin,
65 NetworkApiMixin,
66 PluginApiMixin,
67 SecretApiMixin,
68 ServiceApiMixin,
69 SwarmApiMixin,
70 VolumeApiMixin):
71 """
72 A low-level client for the Docker Engine API.
73
74 Example:
75
76 >>> import docker
77 >>> client = docker.APIClient(base_url='unix://var/run/docker.sock')
78 >>> client.version()
79 {u'ApiVersion': u'1.33',
80 u'Arch': u'amd64',
81 u'BuildTime': u'2017-11-19T18:46:37.000000000+00:00',
82 u'GitCommit': u'f4ffd2511c',
83 u'GoVersion': u'go1.9.2',
84 u'KernelVersion': u'4.14.3-1-ARCH',
85 u'MinAPIVersion': u'1.12',
86 u'Os': u'linux',
87 u'Version': u'17.10.0-ce'}
88
89 Args:
90 base_url (str): URL to the Docker server. For example,
91 ``unix:///var/run/docker.sock`` or ``tcp://127.0.0.1:1234``.
92 version (str): The version of the API to use. Set to ``auto`` to
93 automatically detect the server's version. Default: ``1.35``
94 timeout (int): Default timeout for API calls, in seconds.
95 tls (bool or :py:class:`~docker.tls.TLSConfig`): Enable TLS. Pass
96 ``True`` to enable it with default options, or pass a
97 :py:class:`~docker.tls.TLSConfig` object to use custom
98 configuration.
99 user_agent (str): Set a custom user agent for requests to the server.
100 credstore_env (dict): Override environment variables when calling the
101 credential store process.
102 use_ssh_client (bool): If set to `True`, an ssh connection is made
103 via shelling out to the ssh client. Ensure the ssh client is
104 installed and configured on the host.
105 max_pool_size (int): The maximum number of connections
106 to save in the pool.
107 """
108
109 __attrs__ = requests.Session.__attrs__ + ['_auth_configs',
110 '_general_configs',
111 '_version',
112 'base_url',
113 'timeout']
114

Calls

no outgoing calls