partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | PluginApiMixin.remove_plugin | Remove an installed plugin.
Args:
name (string): Name of the plugin to remove. The ``:latest``
tag is optional, and is the default if omitted.
force (bool): Disable the plugin before removing. This may
result in issues if the plugin is... | docker/api/plugin.py | def remove_plugin(self, name, force=False):
"""
Remove an installed plugin.
Args:
name (string): Name of the plugin to remove. The ``:latest``
tag is optional, and is the default if omitted.
force (bool): Disable the plugin before remo... | def remove_plugin(self, name, force=False):
"""
Remove an installed plugin.
Args:
name (string): Name of the plugin to remove. The ``:latest``
tag is optional, and is the default if omitted.
force (bool): Disable the plugin before remo... | [
"Remove",
"an",
"installed",
"plugin",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L210-L226 | [
"def",
"remove_plugin",
"(",
"self",
",",
"name",
",",
"force",
"=",
"False",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/plugins/{0}'",
",",
"name",
")",
"res",
"=",
"self",
".",
"_delete",
"(",
"url",
",",
"params",
"=",
"{",
"'force'",
":... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | PluginApiMixin.upgrade_plugin | Upgrade an installed plugin.
Args:
name (string): Name of the plugin to upgrade. The ``:latest``
tag is optional and is the default if omitted.
remote (string): Remote reference to upgrade to. The
``:latest`` tag is optional and is the... | docker/api/plugin.py | def upgrade_plugin(self, name, remote, privileges):
"""
Upgrade an installed plugin.
Args:
name (string): Name of the plugin to upgrade. The ``:latest``
tag is optional and is the default if omitted.
remote (string): Remote reference t... | def upgrade_plugin(self, name, remote, privileges):
"""
Upgrade an installed plugin.
Args:
name (string): Name of the plugin to upgrade. The ``:latest``
tag is optional and is the default if omitted.
remote (string): Remote reference t... | [
"Upgrade",
"an",
"installed",
"plugin",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L230-L262 | [
"def",
"upgrade_plugin",
"(",
"self",
",",
"name",
",",
"remote",
",",
"privileges",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/plugins/{0}/upgrade'",
",",
"name",
")",
"params",
"=",
"{",
"'remote'",
":",
"remote",
",",
"}",
"headers",
"=",
"{... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | DockerClient.from_env | 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 aga... | docker/client.py | def from_env(cls, **kwargs):
"""
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:: D... | def from_env(cls, **kwargs):
"""
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:: D... | [
"Return",
"a",
"client",
"configured",
"from",
"environment",
"variables",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/client.py#L43-L86 | [
"def",
"from_env",
"(",
"cls",
",",
"*",
"*",
"kwargs",
")",
":",
"timeout",
"=",
"kwargs",
".",
"pop",
"(",
"'timeout'",
",",
"DEFAULT_TIMEOUT_SECONDS",
")",
"version",
"=",
"kwargs",
".",
"pop",
"(",
"'version'",
",",
"None",
")",
"return",
"cls",
"(... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | CancellableStream.close | Closes the event streaming. | docker/types/daemon.py | def close(self):
"""
Closes the event streaming.
"""
if not self._response.raw.closed:
# find the underlying socket object
# based on api.client._get_raw_response_socket
sock_fp = self._response.raw._fp.fp
if hasattr(sock_fp, 'raw'):
... | def close(self):
"""
Closes the event streaming.
"""
if not self._response.raw.closed:
# find the underlying socket object
# based on api.client._get_raw_response_socket
sock_fp = self._response.raw._fp.fp
if hasattr(sock_fp, 'raw'):
... | [
"Closes",
"the",
"event",
"streaming",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/types/daemon.py#L40-L74 | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_response",
".",
"raw",
".",
"closed",
":",
"# find the underlying socket object",
"# based on api.client._get_raw_response_socket",
"sock_fp",
"=",
"self",
".",
"_response",
".",
"raw",
".",
"_fp",... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | read | Reads at most n bytes from socket | docker/utils/socket.py | def read(socket, n=4096):
"""
Reads at most n bytes from socket
"""
recoverable_errors = (errno.EINTR, errno.EDEADLK, errno.EWOULDBLOCK)
if six.PY3 and not isinstance(socket, NpipeSocket):
select.select([socket], [], [])
try:
if hasattr(socket, 'recv'):
return sock... | def read(socket, n=4096):
"""
Reads at most n bytes from socket
"""
recoverable_errors = (errno.EINTR, errno.EDEADLK, errno.EWOULDBLOCK)
if six.PY3 and not isinstance(socket, NpipeSocket):
select.select([socket], [], [])
try:
if hasattr(socket, 'recv'):
return sock... | [
"Reads",
"at",
"most",
"n",
"bytes",
"from",
"socket"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L23-L41 | [
"def",
"read",
"(",
"socket",
",",
"n",
"=",
"4096",
")",
":",
"recoverable_errors",
"=",
"(",
"errno",
".",
"EINTR",
",",
"errno",
".",
"EDEADLK",
",",
"errno",
".",
"EWOULDBLOCK",
")",
"if",
"six",
".",
"PY3",
"and",
"not",
"isinstance",
"(",
"sock... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | read_exactly | Reads exactly n bytes from socket
Raises SocketError if there isn't enough data | docker/utils/socket.py | def read_exactly(socket, n):
"""
Reads exactly n bytes from socket
Raises SocketError if there isn't enough data
"""
data = six.binary_type()
while len(data) < n:
next_data = read(socket, n - len(data))
if not next_data:
raise SocketError("Unexpected EOF")
dat... | def read_exactly(socket, n):
"""
Reads exactly n bytes from socket
Raises SocketError if there isn't enough data
"""
data = six.binary_type()
while len(data) < n:
next_data = read(socket, n - len(data))
if not next_data:
raise SocketError("Unexpected EOF")
dat... | [
"Reads",
"exactly",
"n",
"bytes",
"from",
"socket",
"Raises",
"SocketError",
"if",
"there",
"isn",
"t",
"enough",
"data"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L44-L55 | [
"def",
"read_exactly",
"(",
"socket",
",",
"n",
")",
":",
"data",
"=",
"six",
".",
"binary_type",
"(",
")",
"while",
"len",
"(",
"data",
")",
"<",
"n",
":",
"next_data",
"=",
"read",
"(",
"socket",
",",
"n",
"-",
"len",
"(",
"data",
")",
")",
"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | next_frame_header | Returns the stream and size of the next frame of data waiting to be read
from socket, according to the protocol defined here:
https://docs.docker.com/engine/api/v1.24/#attach-to-a-container | docker/utils/socket.py | def next_frame_header(socket):
"""
Returns the stream and size of the next frame of data waiting to be read
from socket, according to the protocol defined here:
https://docs.docker.com/engine/api/v1.24/#attach-to-a-container
"""
try:
data = read_exactly(socket, 8)
except SocketError... | def next_frame_header(socket):
"""
Returns the stream and size of the next frame of data waiting to be read
from socket, according to the protocol defined here:
https://docs.docker.com/engine/api/v1.24/#attach-to-a-container
"""
try:
data = read_exactly(socket, 8)
except SocketError... | [
"Returns",
"the",
"stream",
"and",
"size",
"of",
"the",
"next",
"frame",
"of",
"data",
"waiting",
"to",
"be",
"read",
"from",
"socket",
"according",
"to",
"the",
"protocol",
"defined",
"here",
":"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L58-L71 | [
"def",
"next_frame_header",
"(",
"socket",
")",
":",
"try",
":",
"data",
"=",
"read_exactly",
"(",
"socket",
",",
"8",
")",
"except",
"SocketError",
":",
"return",
"(",
"-",
"1",
",",
"-",
"1",
")",
"stream",
",",
"actual",
"=",
"struct",
".",
"unpac... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | frames_iter | Return a generator of frames read from socket. A frame is a tuple where
the first item is the stream number and the second item is a chunk of data.
If the tty setting is enabled, the streams are multiplexed into the stdout
stream. | docker/utils/socket.py | def frames_iter(socket, tty):
"""
Return a generator of frames read from socket. A frame is a tuple where
the first item is the stream number and the second item is a chunk of data.
If the tty setting is enabled, the streams are multiplexed into the stdout
stream.
"""
if tty:
return... | def frames_iter(socket, tty):
"""
Return a generator of frames read from socket. A frame is a tuple where
the first item is the stream number and the second item is a chunk of data.
If the tty setting is enabled, the streams are multiplexed into the stdout
stream.
"""
if tty:
return... | [
"Return",
"a",
"generator",
"of",
"frames",
"read",
"from",
"socket",
".",
"A",
"frame",
"is",
"a",
"tuple",
"where",
"the",
"first",
"item",
"is",
"the",
"stream",
"number",
"and",
"the",
"second",
"item",
"is",
"a",
"chunk",
"of",
"data",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L74-L85 | [
"def",
"frames_iter",
"(",
"socket",
",",
"tty",
")",
":",
"if",
"tty",
":",
"return",
"(",
"(",
"STDOUT",
",",
"frame",
")",
"for",
"frame",
"in",
"frames_iter_tty",
"(",
"socket",
")",
")",
"else",
":",
"return",
"frames_iter_no_tty",
"(",
"socket",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | frames_iter_no_tty | Returns a generator of data read from the socket when the tty setting is
not enabled. | docker/utils/socket.py | def frames_iter_no_tty(socket):
"""
Returns a generator of data read from the socket when the tty setting is
not enabled.
"""
while True:
(stream, n) = next_frame_header(socket)
if n < 0:
break
while n > 0:
result = read(socket, n)
if resul... | def frames_iter_no_tty(socket):
"""
Returns a generator of data read from the socket when the tty setting is
not enabled.
"""
while True:
(stream, n) = next_frame_header(socket)
if n < 0:
break
while n > 0:
result = read(socket, n)
if resul... | [
"Returns",
"a",
"generator",
"of",
"data",
"read",
"from",
"the",
"socket",
"when",
"the",
"tty",
"setting",
"is",
"not",
"enabled",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L88-L106 | [
"def",
"frames_iter_no_tty",
"(",
"socket",
")",
":",
"while",
"True",
":",
"(",
"stream",
",",
"n",
")",
"=",
"next_frame_header",
"(",
"socket",
")",
"if",
"n",
"<",
"0",
":",
"break",
"while",
"n",
">",
"0",
":",
"result",
"=",
"read",
"(",
"soc... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | consume_socket_output | Iterate through frames read from the socket and return the result.
Args:
demux (bool):
If False, stdout and stderr are multiplexed, and the result is the
concatenation of all the frames. If True, the streams are
demultiplexed, and the result is a 2-tuple where each item... | docker/utils/socket.py | def consume_socket_output(frames, demux=False):
"""
Iterate through frames read from the socket and return the result.
Args:
demux (bool):
If False, stdout and stderr are multiplexed, and the result is the
concatenation of all the frames. If True, the streams are
... | def consume_socket_output(frames, demux=False):
"""
Iterate through frames read from the socket and return the result.
Args:
demux (bool):
If False, stdout and stderr are multiplexed, and the result is the
concatenation of all the frames. If True, the streams are
... | [
"Iterate",
"through",
"frames",
"read",
"from",
"the",
"socket",
"and",
"return",
"the",
"result",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L122-L156 | [
"def",
"consume_socket_output",
"(",
"frames",
",",
"demux",
"=",
"False",
")",
":",
"if",
"demux",
"is",
"False",
":",
"# If the streams are multiplexed, the generator returns strings, that",
"# we just need to concatenate.",
"return",
"six",
".",
"binary_type",
"(",
")"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | demux_adaptor | Utility to demultiplex stdout and stderr when reading frames from the
socket. | docker/utils/socket.py | def demux_adaptor(stream_id, data):
"""
Utility to demultiplex stdout and stderr when reading frames from the
socket.
"""
if stream_id == STDOUT:
return (data, None)
elif stream_id == STDERR:
return (None, data)
else:
raise ValueError('{0} is not a valid stream'.forma... | def demux_adaptor(stream_id, data):
"""
Utility to demultiplex stdout and stderr when reading frames from the
socket.
"""
if stream_id == STDOUT:
return (data, None)
elif stream_id == STDERR:
return (None, data)
else:
raise ValueError('{0} is not a valid stream'.forma... | [
"Utility",
"to",
"demultiplex",
"stdout",
"and",
"stderr",
"when",
"reading",
"frames",
"from",
"the",
"socket",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L159-L169 | [
"def",
"demux_adaptor",
"(",
"stream_id",
",",
"data",
")",
":",
"if",
"stream_id",
"==",
"STDOUT",
":",
"return",
"(",
"data",
",",
"None",
")",
"elif",
"stream_id",
"==",
"STDERR",
":",
"return",
"(",
"None",
",",
"data",
")",
"else",
":",
"raise",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | BuildApiMixin.build | Similar to the ``docker build`` command. Either ``path`` or ``fileobj``
needs to be set. ``path`` can be a local path (to a directory
containing a Dockerfile) or a remote URL. ``fileobj`` must be a
readable file-like object to a Dockerfile.
If you have a tar file for the Docker build co... | docker/api/build.py | def build(self, path=None, tag=None, quiet=False, fileobj=None,
nocache=False, rm=False, timeout=None,
custom_context=False, encoding=None, pull=False,
forcerm=False, dockerfile=None, container_limits=None,
decode=False, buildargs=None, gzip=False, shmsize=None,
... | def build(self, path=None, tag=None, quiet=False, fileobj=None,
nocache=False, rm=False, timeout=None,
custom_context=False, encoding=None, pull=False,
forcerm=False, dockerfile=None, container_limits=None,
decode=False, buildargs=None, gzip=False, shmsize=None,
... | [
"Similar",
"to",
"the",
"docker",
"build",
"command",
".",
"Either",
"path",
"or",
"fileobj",
"needs",
"to",
"be",
"set",
".",
"path",
"can",
"be",
"a",
"local",
"path",
"(",
"to",
"a",
"directory",
"containing",
"a",
"Dockerfile",
")",
"or",
"a",
"rem... | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/build.py#L16-L275 | [
"def",
"build",
"(",
"self",
",",
"path",
"=",
"None",
",",
"tag",
"=",
"None",
",",
"quiet",
"=",
"False",
",",
"fileobj",
"=",
"None",
",",
"nocache",
"=",
"False",
",",
"rm",
"=",
"False",
",",
"timeout",
"=",
"None",
",",
"custom_context",
"=",... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | BuildApiMixin.prune_builds | Delete the builder cache
Returns:
(dict): A dictionary containing information about the operation's
result. The ``SpaceReclaimed`` key indicates the amount of
bytes of disk space reclaimed.
Raises:
:py:class:`docker.errors.APIError`
... | docker/api/build.py | def prune_builds(self):
"""
Delete the builder cache
Returns:
(dict): A dictionary containing information about the operation's
result. The ``SpaceReclaimed`` key indicates the amount of
bytes of disk space reclaimed.
Raises:
... | def prune_builds(self):
"""
Delete the builder cache
Returns:
(dict): A dictionary containing information about the operation's
result. The ``SpaceReclaimed`` key indicates the amount of
bytes of disk space reclaimed.
Raises:
... | [
"Delete",
"the",
"builder",
"cache"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/build.py#L278-L292 | [
"def",
"prune_builds",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"\"/build/prune\"",
")",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_post",
"(",
"url",
")",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SwarmApiMixin.create_swarm_spec | Create a :py:class:`docker.types.SwarmSpec` instance that can be used
as the ``swarm_spec`` argument in
:py:meth:`~docker.api.swarm.SwarmApiMixin.init_swarm`.
Args:
task_history_retention_limit (int): Maximum number of tasks
history stored.
snapshot_inter... | docker/api/swarm.py | def create_swarm_spec(self, *args, **kwargs):
"""
Create a :py:class:`docker.types.SwarmSpec` instance that can be used
as the ``swarm_spec`` argument in
:py:meth:`~docker.api.swarm.SwarmApiMixin.init_swarm`.
Args:
task_history_retention_limit (int): Maximum number o... | def create_swarm_spec(self, *args, **kwargs):
"""
Create a :py:class:`docker.types.SwarmSpec` instance that can be used
as the ``swarm_spec`` argument in
:py:meth:`~docker.api.swarm.SwarmApiMixin.init_swarm`.
Args:
task_history_retention_limit (int): Maximum number o... | [
"Create",
"a",
":",
"py",
":",
"class",
":",
"docker",
".",
"types",
".",
"SwarmSpec",
"instance",
"that",
"can",
"be",
"used",
"as",
"the",
"swarm_spec",
"argument",
"in",
":",
"py",
":",
"meth",
":",
"~docker",
".",
"api",
".",
"swarm",
".",
"Swarm... | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L13-L72 | [
"def",
"create_swarm_spec",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"ext_ca",
"=",
"kwargs",
".",
"pop",
"(",
"'external_ca'",
",",
"None",
")",
"if",
"ext_ca",
":",
"kwargs",
"[",
"'external_cas'",
"]",
"=",
"[",
"ext_ca",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SwarmApiMixin.init_swarm | Initialize a new Swarm using the current connected engine as the first
node.
Args:
advertise_addr (string): Externally reachable address advertised
to other nodes. This can either be an address/port combination
in the form ``192.168.1.1:4567``, or an interfac... | docker/api/swarm.py | def init_swarm(self, advertise_addr=None, listen_addr='0.0.0.0:2377',
force_new_cluster=False, swarm_spec=None,
default_addr_pool=None, subnet_size=None):
"""
Initialize a new Swarm using the current connected engine as the first
node.
Args:
... | def init_swarm(self, advertise_addr=None, listen_addr='0.0.0.0:2377',
force_new_cluster=False, swarm_spec=None,
default_addr_pool=None, subnet_size=None):
"""
Initialize a new Swarm using the current connected engine as the first
node.
Args:
... | [
"Initialize",
"a",
"new",
"Swarm",
"using",
"the",
"current",
"connected",
"engine",
"as",
"the",
"first",
"node",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L85-L159 | [
"def",
"init_swarm",
"(",
"self",
",",
"advertise_addr",
"=",
"None",
",",
"listen_addr",
"=",
"'0.0.0.0:2377'",
",",
"force_new_cluster",
"=",
"False",
",",
"swarm_spec",
"=",
"None",
",",
"default_addr_pool",
"=",
"None",
",",
"subnet_size",
"=",
"None",
")"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SwarmApiMixin.inspect_swarm | Retrieve low-level information about the current swarm.
Returns:
A dictionary containing data about the swarm.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/api/swarm.py | def inspect_swarm(self):
"""
Retrieve low-level information about the current swarm.
Returns:
A dictionary containing data about the swarm.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
url = self.... | def inspect_swarm(self):
"""
Retrieve low-level information about the current swarm.
Returns:
A dictionary containing data about the swarm.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
url = self.... | [
"Retrieve",
"low",
"-",
"level",
"information",
"about",
"the",
"current",
"swarm",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L162-L174 | [
"def",
"inspect_swarm",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/swarm'",
")",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SwarmApiMixin.inspect_node | Retrieve low-level information about a swarm node
Args:
node_id (string): ID of the node to be inspected.
Returns:
A dictionary containing data about this node.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/api/swarm.py | def inspect_node(self, node_id):
"""
Retrieve low-level information about a swarm node
Args:
node_id (string): ID of the node to be inspected.
Returns:
A dictionary containing data about this node.
Raises:
:py:class:`docker.errors.APIError`
... | def inspect_node(self, node_id):
"""
Retrieve low-level information about a swarm node
Args:
node_id (string): ID of the node to be inspected.
Returns:
A dictionary containing data about this node.
Raises:
:py:class:`docker.errors.APIError`
... | [
"Retrieve",
"low",
"-",
"level",
"information",
"about",
"a",
"swarm",
"node"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L178-L193 | [
"def",
"inspect_node",
"(",
"self",
",",
"node_id",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/nodes/{0}'",
",",
"node_id",
")",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SwarmApiMixin.join_swarm | Make this Engine join a swarm that has already been created.
Args:
remote_addrs (:py:class:`list`): Addresses of one or more manager
nodes already participating in the Swarm to join.
join_token (string): Secret token for joining this Swarm.
listen_addr (strin... | docker/api/swarm.py | def join_swarm(self, remote_addrs, join_token, listen_addr='0.0.0.0:2377',
advertise_addr=None):
"""
Make this Engine join a swarm that has already been created.
Args:
remote_addrs (:py:class:`list`): Addresses of one or more manager
nodes already ... | def join_swarm(self, remote_addrs, join_token, listen_addr='0.0.0.0:2377',
advertise_addr=None):
"""
Make this Engine join a swarm that has already been created.
Args:
remote_addrs (:py:class:`list`): Addresses of one or more manager
nodes already ... | [
"Make",
"this",
"Engine",
"join",
"a",
"swarm",
"that",
"has",
"already",
"been",
"created",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L196-L233 | [
"def",
"join_swarm",
"(",
"self",
",",
"remote_addrs",
",",
"join_token",
",",
"listen_addr",
"=",
"'0.0.0.0:2377'",
",",
"advertise_addr",
"=",
"None",
")",
":",
"data",
"=",
"{",
"\"RemoteAddrs\"",
":",
"remote_addrs",
",",
"\"ListenAddr\"",
":",
"listen_addr"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SwarmApiMixin.leave_swarm | Leave a swarm.
Args:
force (bool): Leave the swarm even if this node is a manager.
Default: ``False``
Returns:
``True`` if the request went through.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/api/swarm.py | def leave_swarm(self, force=False):
"""
Leave a swarm.
Args:
force (bool): Leave the swarm even if this node is a manager.
Default: ``False``
Returns:
``True`` if the request went through.
Raises:
:py:class:`docker.errors.API... | def leave_swarm(self, force=False):
"""
Leave a swarm.
Args:
force (bool): Leave the swarm even if this node is a manager.
Default: ``False``
Returns:
``True`` if the request went through.
Raises:
:py:class:`docker.errors.API... | [
"Leave",
"a",
"swarm",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L236-L261 | [
"def",
"leave_swarm",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/swarm/leave'",
")",
"response",
"=",
"self",
".",
"_post",
"(",
"url",
",",
"params",
"=",
"{",
"'force'",
":",
"force",
"}",
")",
"# ... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SwarmApiMixin.remove_node | Remove a node from the swarm.
Args:
node_id (string): ID of the node to be removed.
force (bool): Force remove an active node. Default: `False`
Raises:
:py:class:`docker.errors.NotFound`
If the node referenced doesn't exist in the swarm.
... | docker/api/swarm.py | def remove_node(self, node_id, force=False):
"""
Remove a node from the swarm.
Args:
node_id (string): ID of the node to be removed.
force (bool): Force remove an active node. Default: `False`
Raises:
:py:class:`docker.errors.NotFound`
... | def remove_node(self, node_id, force=False):
"""
Remove a node from the swarm.
Args:
node_id (string): ID of the node to be removed.
force (bool): Force remove an active node. Default: `False`
Raises:
:py:class:`docker.errors.NotFound`
... | [
"Remove",
"a",
"node",
"from",
"the",
"swarm",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L289-L312 | [
"def",
"remove_node",
"(",
"self",
",",
"node_id",
",",
"force",
"=",
"False",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/nodes/{0}'",
",",
"node_id",
")",
"params",
"=",
"{",
"'force'",
":",
"force",
"}",
"res",
"=",
"self",
".",
"_delete",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SwarmApiMixin.unlock_swarm | Unlock a locked swarm.
Args:
key (string): The unlock key as provided by
:py:meth:`get_unlock_key`
Raises:
:py:class:`docker.errors.InvalidArgument`
If the key argument is in an incompatible format
:py:cla... | docker/api/swarm.py | def unlock_swarm(self, key):
"""
Unlock a locked swarm.
Args:
key (string): The unlock key as provided by
:py:meth:`get_unlock_key`
Raises:
:py:class:`docker.errors.InvalidArgument`
If the key argument ... | def unlock_swarm(self, key):
"""
Unlock a locked swarm.
Args:
key (string): The unlock key as provided by
:py:meth:`get_unlock_key`
Raises:
:py:class:`docker.errors.InvalidArgument`
If the key argument ... | [
"Unlock",
"a",
"locked",
"swarm",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L315-L348 | [
"def",
"unlock_swarm",
"(",
"self",
",",
"key",
")",
":",
"if",
"isinstance",
"(",
"key",
",",
"dict",
")",
":",
"if",
"'UnlockKey'",
"not",
"in",
"key",
":",
"raise",
"errors",
".",
"InvalidArgument",
"(",
"'Invalid unlock key format'",
")",
"else",
":",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SwarmApiMixin.update_node | Update the node's configuration
Args:
node_id (string): ID of the node to be updated.
version (int): The version number of the node object being
updated. This is required to avoid conflicting writes.
node_spec (dict): Configuration settings to update. Any va... | docker/api/swarm.py | def update_node(self, node_id, version, node_spec=None):
"""
Update the node's configuration
Args:
node_id (string): ID of the node to be updated.
version (int): The version number of the node object being
updated. This is required to avoid conflicting w... | def update_node(self, node_id, version, node_spec=None):
"""
Update the node's configuration
Args:
node_id (string): ID of the node to be updated.
version (int): The version number of the node object being
updated. This is required to avoid conflicting w... | [
"Update",
"the",
"node",
"s",
"configuration"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L351-L384 | [
"def",
"update_node",
"(",
"self",
",",
"node_id",
",",
"version",
",",
"node_spec",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/nodes/{0}/update?version={1}'",
",",
"node_id",
",",
"str",
"(",
"version",
")",
")",
"res",
"=",
"self",... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SwarmApiMixin.update_swarm | Update the Swarm's configuration
Args:
version (int): The version number of the swarm object being
updated. This is required to avoid conflicting writes.
swarm_spec (dict): Configuration settings to update. Use
:py:meth:`~docker.api.swarm.SwarmApiMixin.cr... | docker/api/swarm.py | def update_swarm(self, version, swarm_spec=None, rotate_worker_token=False,
rotate_manager_token=False):
"""
Update the Swarm's configuration
Args:
version (int): The version number of the swarm object being
updated. This is required to avoid con... | def update_swarm(self, version, swarm_spec=None, rotate_worker_token=False,
rotate_manager_token=False):
"""
Update the Swarm's configuration
Args:
version (int): The version number of the swarm object being
updated. This is required to avoid con... | [
"Update",
"the",
"Swarm",
"s",
"configuration"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L387-L418 | [
"def",
"update_swarm",
"(",
"self",
",",
"version",
",",
"swarm_spec",
"=",
"None",
",",
"rotate_worker_token",
"=",
"False",
",",
"rotate_manager_token",
"=",
"False",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/swarm/update'",
")",
"response",
"=",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SecretCollection.get | Get a secret.
Args:
secret_id (str): Secret ID.
Returns:
(:py:class:`Secret`): The secret.
Raises:
:py:class:`docker.errors.NotFound`
If the secret does not exist.
:py:class:`docker.errors.APIError`
If the server ... | docker/models/secrets.py | def get(self, secret_id):
"""
Get a secret.
Args:
secret_id (str): Secret ID.
Returns:
(:py:class:`Secret`): The secret.
Raises:
:py:class:`docker.errors.NotFound`
If the secret does not exist.
:py:class:`docker.e... | def get(self, secret_id):
"""
Get a secret.
Args:
secret_id (str): Secret ID.
Returns:
(:py:class:`Secret`): The secret.
Raises:
:py:class:`docker.errors.NotFound`
If the secret does not exist.
:py:class:`docker.e... | [
"Get",
"a",
"secret",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/secrets.py#L36-L52 | [
"def",
"get",
"(",
"self",
",",
"secret_id",
")",
":",
"return",
"self",
".",
"prepare_model",
"(",
"self",
".",
"client",
".",
"api",
".",
"inspect_secret",
"(",
"secret_id",
")",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SecretCollection.list | List secrets. Similar to the ``docker secret ls`` command.
Args:
filters (dict): Server-side list filtering options.
Returns:
(list of :py:class:`Secret`): The secrets.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an erro... | docker/models/secrets.py | def list(self, **kwargs):
"""
List secrets. Similar to the ``docker secret ls`` command.
Args:
filters (dict): Server-side list filtering options.
Returns:
(list of :py:class:`Secret`): The secrets.
Raises:
:py:class:`docker.errors.APIError`... | def list(self, **kwargs):
"""
List secrets. Similar to the ``docker secret ls`` command.
Args:
filters (dict): Server-side list filtering options.
Returns:
(list of :py:class:`Secret`): The secrets.
Raises:
:py:class:`docker.errors.APIError`... | [
"List",
"secrets",
".",
"Similar",
"to",
"the",
"docker",
"secret",
"ls",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/secrets.py#L54-L69 | [
"def",
"list",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"resp",
"=",
"self",
".",
"client",
".",
"api",
".",
"secrets",
"(",
"*",
"*",
"kwargs",
")",
"return",
"[",
"self",
".",
"prepare_model",
"(",
"obj",
")",
"for",
"obj",
"in",
"resp",... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | NetworkApiMixin.networks | List networks. Similar to the ``docker networks ls`` command.
Args:
names (:py:class:`list`): List of names to filter by
ids (:py:class:`list`): List of ids to filter by
filters (dict): Filters to be processed on the network list.
Available filters:
... | docker/api/network.py | def networks(self, names=None, ids=None, filters=None):
"""
List networks. Similar to the ``docker networks ls`` command.
Args:
names (:py:class:`list`): List of names to filter by
ids (:py:class:`list`): List of ids to filter by
filters (dict): Filters to be... | def networks(self, names=None, ids=None, filters=None):
"""
List networks. Similar to the ``docker networks ls`` command.
Args:
names (:py:class:`list`): List of names to filter by
ids (:py:class:`list`): List of ids to filter by
filters (dict): Filters to be... | [
"List",
"networks",
".",
"Similar",
"to",
"the",
"docker",
"networks",
"ls",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L8-L38 | [
"def",
"networks",
"(",
"self",
",",
"names",
"=",
"None",
",",
"ids",
"=",
"None",
",",
"filters",
"=",
"None",
")",
":",
"if",
"filters",
"is",
"None",
":",
"filters",
"=",
"{",
"}",
"if",
"names",
":",
"filters",
"[",
"'name'",
"]",
"=",
"name... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | NetworkApiMixin.create_network | Create a network. Similar to the ``docker network create``.
Args:
name (str): Name of the network
driver (str): Name of the driver used to create the network
options (dict): Driver options as a key-value dictionary
ipam (IPAMConfig): Optional custom IP scheme for... | docker/api/network.py | def create_network(self, name, driver=None, options=None, ipam=None,
check_duplicate=None, internal=False, labels=None,
enable_ipv6=False, attachable=None, scope=None,
ingress=None):
"""
Create a network. Similar to the ``docker networ... | def create_network(self, name, driver=None, options=None, ipam=None,
check_duplicate=None, internal=False, labels=None,
enable_ipv6=False, attachable=None, scope=None,
ingress=None):
"""
Create a network. Similar to the ``docker networ... | [
"Create",
"a",
"network",
".",
"Similar",
"to",
"the",
"docker",
"network",
"create",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L40-L152 | [
"def",
"create_network",
"(",
"self",
",",
"name",
",",
"driver",
"=",
"None",
",",
"options",
"=",
"None",
",",
"ipam",
"=",
"None",
",",
"check_duplicate",
"=",
"None",
",",
"internal",
"=",
"False",
",",
"labels",
"=",
"None",
",",
"enable_ipv6",
"=... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | NetworkApiMixin.remove_network | Remove a network. Similar to the ``docker network rm`` command.
Args:
net_id (str): The network's id | docker/api/network.py | def remove_network(self, net_id):
"""
Remove a network. Similar to the ``docker network rm`` command.
Args:
net_id (str): The network's id
"""
url = self._url("/networks/{0}", net_id)
res = self._delete(url)
self._raise_for_status(res) | def remove_network(self, net_id):
"""
Remove a network. Similar to the ``docker network rm`` command.
Args:
net_id (str): The network's id
"""
url = self._url("/networks/{0}", net_id)
res = self._delete(url)
self._raise_for_status(res) | [
"Remove",
"a",
"network",
".",
"Similar",
"to",
"the",
"docker",
"network",
"rm",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L177-L186 | [
"def",
"remove_network",
"(",
"self",
",",
"net_id",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"\"/networks/{0}\"",
",",
"net_id",
")",
"res",
"=",
"self",
".",
"_delete",
"(",
"url",
")",
"self",
".",
"_raise_for_status",
"(",
"res",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | NetworkApiMixin.inspect_network | Get detailed information about a network.
Args:
net_id (str): ID of network
verbose (bool): Show the service details across the cluster in
swarm mode.
scope (str): Filter the network by scope (``swarm``, ``global``
or ``local``). | docker/api/network.py | def inspect_network(self, net_id, verbose=None, scope=None):
"""
Get detailed information about a network.
Args:
net_id (str): ID of network
verbose (bool): Show the service details across the cluster in
swarm mode.
scope (str): Filter the net... | def inspect_network(self, net_id, verbose=None, scope=None):
"""
Get detailed information about a network.
Args:
net_id (str): ID of network
verbose (bool): Show the service details across the cluster in
swarm mode.
scope (str): Filter the net... | [
"Get",
"detailed",
"information",
"about",
"a",
"network",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L189-L212 | [
"def",
"inspect_network",
"(",
"self",
",",
"net_id",
",",
"verbose",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"verbose",
"is",
"not",
"None",
":",
"if",
"version_lt",
"(",
"self",
".",
"_version",
",",
"'1.28'... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | NetworkApiMixin.connect_container_to_network | Connect a container to a network.
Args:
container (str): container-id/name to be connected to the network
net_id (str): network id
aliases (:py:class:`list`): A list of aliases for this endpoint.
Names in that list can be used within the network to reach the
... | docker/api/network.py | def connect_container_to_network(self, container, net_id,
ipv4_address=None, ipv6_address=None,
aliases=None, links=None,
link_local_ips=None):
"""
Connect a container to a network.
Ar... | def connect_container_to_network(self, container, net_id,
ipv4_address=None, ipv6_address=None,
aliases=None, links=None,
link_local_ips=None):
"""
Connect a container to a network.
Ar... | [
"Connect",
"a",
"container",
"to",
"a",
"network",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L215-L248 | [
"def",
"connect_container_to_network",
"(",
"self",
",",
"container",
",",
"net_id",
",",
"ipv4_address",
"=",
"None",
",",
"ipv6_address",
"=",
"None",
",",
"aliases",
"=",
"None",
",",
"links",
"=",
"None",
",",
"link_local_ips",
"=",
"None",
")",
":",
"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | NetworkApiMixin.disconnect_container_from_network | Disconnect a container from a network.
Args:
container (str): container ID or name to be disconnected from the
network
net_id (str): network ID
force (bool): Force the container to disconnect from a network.
Default: ``False`` | docker/api/network.py | def disconnect_container_from_network(self, container, net_id,
force=False):
"""
Disconnect a container from a network.
Args:
container (str): container ID or name to be disconnected from the
network
net_id (str):... | def disconnect_container_from_network(self, container, net_id,
force=False):
"""
Disconnect a container from a network.
Args:
container (str): container ID or name to be disconnected from the
network
net_id (str):... | [
"Disconnect",
"a",
"container",
"from",
"a",
"network",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L251-L272 | [
"def",
"disconnect_container_from_network",
"(",
"self",
",",
"container",
",",
"net_id",
",",
"force",
"=",
"False",
")",
":",
"data",
"=",
"{",
"\"Container\"",
":",
"container",
"}",
"if",
"force",
":",
"if",
"version_lt",
"(",
"self",
".",
"_version",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Swarm.init | Initialize a new swarm on this Engine.
Args:
advertise_addr (str): Externally reachable address advertised to
other nodes. This can either be an address/port combination in
the form ``192.168.1.1:4567``, or an interface followed by a
port number, like... | docker/models/swarm.py | def init(self, advertise_addr=None, listen_addr='0.0.0.0:2377',
force_new_cluster=False, default_addr_pool=None,
subnet_size=None, **kwargs):
"""
Initialize a new swarm on this Engine.
Args:
advertise_addr (str): Externally reachable address advertised to
... | def init(self, advertise_addr=None, listen_addr='0.0.0.0:2377',
force_new_cluster=False, default_addr_pool=None,
subnet_size=None, **kwargs):
"""
Initialize a new swarm on this Engine.
Args:
advertise_addr (str): Externally reachable address advertised to
... | [
"Initialize",
"a",
"new",
"swarm",
"on",
"this",
"Engine",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/swarm.py#L36-L125 | [
"def",
"init",
"(",
"self",
",",
"advertise_addr",
"=",
"None",
",",
"listen_addr",
"=",
"'0.0.0.0:2377'",
",",
"force_new_cluster",
"=",
"False",
",",
"default_addr_pool",
"=",
"None",
",",
"subnet_size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"i... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Swarm.update | Update the swarm's configuration.
It takes the same arguments as :py:meth:`init`, except
``advertise_addr``, ``listen_addr``, and ``force_new_cluster``. In
addition, it takes these arguments:
Args:
rotate_worker_token (bool): Rotate the worker join token. Default:
... | docker/models/swarm.py | def update(self, rotate_worker_token=False, rotate_manager_token=False,
**kwargs):
"""
Update the swarm's configuration.
It takes the same arguments as :py:meth:`init`, except
``advertise_addr``, ``listen_addr``, and ``force_new_cluster``. In
addition, it takes th... | def update(self, rotate_worker_token=False, rotate_manager_token=False,
**kwargs):
"""
Update the swarm's configuration.
It takes the same arguments as :py:meth:`init`, except
``advertise_addr``, ``listen_addr``, and ``force_new_cluster``. In
addition, it takes th... | [
"Update",
"the",
"swarm",
"s",
"configuration",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/swarm.py#L150-L179 | [
"def",
"update",
"(",
"self",
",",
"rotate_worker_token",
"=",
"False",
",",
"rotate_manager_token",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# this seems to have to be set",
"if",
"kwargs",
".",
"get",
"(",
"'node_cert_expiry'",
")",
"is",
"None",
":... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | VolumeApiMixin.create_volume | Create and register a named volume
Args:
name (str): Name of the volume
driver (str): Name of the driver used to create the volume
driver_opts (dict): Driver options as a key-value dictionary
labels (dict): Labels to set on the volume
Returns:
... | docker/api/volume.py | def create_volume(self, name=None, driver=None, driver_opts=None,
labels=None):
"""
Create and register a named volume
Args:
name (str): Name of the volume
driver (str): Name of the driver used to create the volume
driver_opts (dict): Dr... | def create_volume(self, name=None, driver=None, driver_opts=None,
labels=None):
"""
Create and register a named volume
Args:
name (str): Name of the volume
driver (str): Name of the driver used to create the volume
driver_opts (dict): Dr... | [
"Create",
"and",
"register",
"a",
"named",
"volume"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/volume.py#L39-L89 | [
"def",
"create_volume",
"(",
"self",
",",
"name",
"=",
"None",
",",
"driver",
"=",
"None",
",",
"driver_opts",
"=",
"None",
",",
"labels",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/volumes/create'",
")",
"if",
"driver_opts",
"is",... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | VolumeApiMixin.inspect_volume | Retrieve volume info by name.
Args:
name (str): volume name
Returns:
(dict): Volume information dictionary
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
Example:
>>> cli.inspect_volume('foob... | docker/api/volume.py | def inspect_volume(self, name):
"""
Retrieve volume info by name.
Args:
name (str): volume name
Returns:
(dict): Volume information dictionary
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
... | def inspect_volume(self, name):
"""
Retrieve volume info by name.
Args:
name (str): volume name
Returns:
(dict): Volume information dictionary
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
... | [
"Retrieve",
"volume",
"info",
"by",
"name",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/volume.py#L91-L114 | [
"def",
"inspect_volume",
"(",
"self",
",",
"name",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/volumes/{0}'",
",",
"name",
")",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | VolumeApiMixin.prune_volumes | Delete unused volumes
Args:
filters (dict): Filters to process on the prune list.
Returns:
(dict): A dict containing a list of deleted volume names and
the amount of disk space reclaimed in bytes.
Raises:
:py:class:`docker.errors.APIError`
... | docker/api/volume.py | def prune_volumes(self, filters=None):
"""
Delete unused volumes
Args:
filters (dict): Filters to process on the prune list.
Returns:
(dict): A dict containing a list of deleted volume names and
the amount of disk space reclaimed in bytes.
... | def prune_volumes(self, filters=None):
"""
Delete unused volumes
Args:
filters (dict): Filters to process on the prune list.
Returns:
(dict): A dict containing a list of deleted volume names and
the amount of disk space reclaimed in bytes.
... | [
"Delete",
"unused",
"volumes"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/volume.py#L117-L136 | [
"def",
"prune_volumes",
"(",
"self",
",",
"filters",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"filters",
":",
"params",
"[",
"'filters'",
"]",
"=",
"utils",
".",
"convert_filters",
"(",
"filters",
")",
"url",
"=",
"self",
".",
"_url",
"(... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | VolumeApiMixin.remove_volume | Remove a volume. Similar to the ``docker volume rm`` command.
Args:
name (str): The volume's name
force (bool): Force removal of volumes that were already removed
out of band by the volume driver plugin.
Raises:
:py:class:`docker.errors.APIError`
... | docker/api/volume.py | def remove_volume(self, name, force=False):
"""
Remove a volume. Similar to the ``docker volume rm`` command.
Args:
name (str): The volume's name
force (bool): Force removal of volumes that were already removed
out of band by the volume driver plugin.
... | def remove_volume(self, name, force=False):
"""
Remove a volume. Similar to the ``docker volume rm`` command.
Args:
name (str): The volume's name
force (bool): Force removal of volumes that were already removed
out of band by the volume driver plugin.
... | [
"Remove",
"a",
"volume",
".",
"Similar",
"to",
"the",
"docker",
"volume",
"rm",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/volume.py#L138-L161 | [
"def",
"remove_volume",
"(",
"self",
",",
"name",
",",
"force",
"=",
"False",
")",
":",
"params",
"=",
"{",
"}",
"if",
"force",
":",
"if",
"utils",
".",
"version_lt",
"(",
"self",
".",
"_version",
",",
"'1.25'",
")",
":",
"raise",
"errors",
".",
"I... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ConfigApiMixin.create_config | Create a config
Args:
name (string): Name of the config
data (bytes): Config data to be stored
labels (dict): A mapping of labels to assign to the config
Returns (dict): ID of the newly created config | docker/api/config.py | def create_config(self, name, data, labels=None):
"""
Create a config
Args:
name (string): Name of the config
data (bytes): Config data to be stored
labels (dict): A mapping of labels to assign to the config
Returns (dict): ID... | def create_config(self, name, data, labels=None):
"""
Create a config
Args:
name (string): Name of the config
data (bytes): Config data to be stored
labels (dict): A mapping of labels to assign to the config
Returns (dict): ID... | [
"Create",
"a",
"config"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/config.py#L10-L36 | [
"def",
"create_config",
"(",
"self",
",",
"name",
",",
"data",
",",
"labels",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"bytes",
")",
":",
"data",
"=",
"data",
".",
"encode",
"(",
"'utf-8'",
")",
"data",
"=",
"base64",
"."... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ConfigApiMixin.inspect_config | Retrieve config metadata
Args:
id (string): Full ID of the config to inspect
Returns (dict): A dictionary of metadata
Raises:
:py:class:`docker.errors.NotFound`
if no config with that ID exists | docker/api/config.py | def inspect_config(self, id):
"""
Retrieve config metadata
Args:
id (string): Full ID of the config to inspect
Returns (dict): A dictionary of metadata
Raises:
:py:class:`docker.errors.NotFound`
if no config w... | def inspect_config(self, id):
"""
Retrieve config metadata
Args:
id (string): Full ID of the config to inspect
Returns (dict): A dictionary of metadata
Raises:
:py:class:`docker.errors.NotFound`
if no config w... | [
"Retrieve",
"config",
"metadata"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/config.py#L40-L54 | [
"def",
"inspect_config",
"(",
"self",
",",
"id",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/configs/{0}'",
",",
"id",
")",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ConfigApiMixin.remove_config | Remove a config
Args:
id (string): Full ID of the config to remove
Returns (boolean): True if successful
Raises:
:py:class:`docker.errors.NotFound`
if no config with that ID exists | docker/api/config.py | def remove_config(self, id):
"""
Remove a config
Args:
id (string): Full ID of the config to remove
Returns (boolean): True if successful
Raises:
:py:class:`docker.errors.NotFound`
if no config with that ID ex... | def remove_config(self, id):
"""
Remove a config
Args:
id (string): Full ID of the config to remove
Returns (boolean): True if successful
Raises:
:py:class:`docker.errors.NotFound`
if no config with that ID ex... | [
"Remove",
"a",
"config"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/config.py#L58-L74 | [
"def",
"remove_config",
"(",
"self",
",",
"id",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/configs/{0}'",
",",
"id",
")",
"res",
"=",
"self",
".",
"_delete",
"(",
"url",
")",
"self",
".",
"_raise_for_status",
"(",
"res",
")",
"return",
"True"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ConfigApiMixin.configs | List configs
Args:
filters (dict): A map of filters to process on the configs
list. Available filters: ``names``
Returns (list): A list of configs | docker/api/config.py | def configs(self, filters=None):
"""
List configs
Args:
filters (dict): A map of filters to process on the configs
list. Available filters: ``names``
Returns (list): A list of configs
"""
url = self._url('/configs')
pa... | def configs(self, filters=None):
"""
List configs
Args:
filters (dict): A map of filters to process on the configs
list. Available filters: ``names``
Returns (list): A list of configs
"""
url = self._url('/configs')
pa... | [
"List",
"configs"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/config.py#L77-L91 | [
"def",
"configs",
"(",
"self",
",",
"filters",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/configs'",
")",
"params",
"=",
"{",
"}",
"if",
"filters",
":",
"params",
"[",
"'filters'",
"]",
"=",
"utils",
".",
"convert_filters",
"(",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SecretApiMixin.create_secret | Create a secret
Args:
name (string): Name of the secret
data (bytes): Secret data to be stored
labels (dict): A mapping of labels to assign to the secret
driver (DriverConfig): A custom driver configuration. If
unspecified,... | docker/api/secret.py | def create_secret(self, name, data, labels=None, driver=None):
"""
Create a secret
Args:
name (string): Name of the secret
data (bytes): Secret data to be stored
labels (dict): A mapping of labels to assign to the secret
dr... | def create_secret(self, name, data, labels=None, driver=None):
"""
Create a secret
Args:
name (string): Name of the secret
data (bytes): Secret data to be stored
labels (dict): A mapping of labels to assign to the secret
dr... | [
"Create",
"a",
"secret"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/secret.py#L11-L47 | [
"def",
"create_secret",
"(",
"self",
",",
"name",
",",
"data",
",",
"labels",
"=",
"None",
",",
"driver",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"bytes",
")",
":",
"data",
"=",
"data",
".",
"encode",
"(",
"'utf-8'",
")"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SecretApiMixin.inspect_secret | Retrieve secret metadata
Args:
id (string): Full ID of the secret to remove
Returns (dict): A dictionary of metadata
Raises:
:py:class:`docker.errors.NotFound`
if no secret with that ID exists | docker/api/secret.py | def inspect_secret(self, id):
"""
Retrieve secret metadata
Args:
id (string): Full ID of the secret to remove
Returns (dict): A dictionary of metadata
Raises:
:py:class:`docker.errors.NotFound`
if no secret wi... | def inspect_secret(self, id):
"""
Retrieve secret metadata
Args:
id (string): Full ID of the secret to remove
Returns (dict): A dictionary of metadata
Raises:
:py:class:`docker.errors.NotFound`
if no secret wi... | [
"Retrieve",
"secret",
"metadata"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/secret.py#L51-L65 | [
"def",
"inspect_secret",
"(",
"self",
",",
"id",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/secrets/{0}'",
",",
"id",
")",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Node.update | Update the node's configuration.
Args:
node_spec (dict): Configuration settings to update. Any values
not provided will be removed. Default: ``None``
Returns:
`True` if the request went through.
Raises:
:py:class:`docker.errors.APIError`
... | docker/models/nodes.py | def update(self, node_spec):
"""
Update the node's configuration.
Args:
node_spec (dict): Configuration settings to update. Any values
not provided will be removed. Default: ``None``
Returns:
`True` if the request went through.
Raises:
... | def update(self, node_spec):
"""
Update the node's configuration.
Args:
node_spec (dict): Configuration settings to update. Any values
not provided will be removed. Default: ``None``
Returns:
`True` if the request went through.
Raises:
... | [
"Update",
"the",
"node",
"s",
"configuration",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/nodes.py#L17-L42 | [
"def",
"update",
"(",
"self",
",",
"node_spec",
")",
":",
"return",
"self",
".",
"client",
".",
"api",
".",
"update_node",
"(",
"self",
".",
"id",
",",
"self",
".",
"version",
",",
"node_spec",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Node.remove | Remove this node from the swarm.
Args:
force (bool): Force remove an active node. Default: `False`
Returns:
`True` if the request was successful.
Raises:
:py:class:`docker.errors.NotFound`
If the node doesn't exist in the swarm.
... | docker/models/nodes.py | def remove(self, force=False):
"""
Remove this node from the swarm.
Args:
force (bool): Force remove an active node. Default: `False`
Returns:
`True` if the request was successful.
Raises:
:py:class:`docker.errors.NotFound`
I... | def remove(self, force=False):
"""
Remove this node from the swarm.
Args:
force (bool): Force remove an active node. Default: `False`
Returns:
`True` if the request was successful.
Raises:
:py:class:`docker.errors.NotFound`
I... | [
"Remove",
"this",
"node",
"from",
"the",
"swarm",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/nodes.py#L44-L61 | [
"def",
"remove",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"return",
"self",
".",
"client",
".",
"api",
".",
"remove_node",
"(",
"self",
".",
"id",
",",
"force",
"=",
"force",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | NodeCollection.get | Get a node.
Args:
node_id (string): ID of the node to be inspected.
Returns:
A :py:class:`Node` object.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/models/nodes.py | def get(self, node_id):
"""
Get a node.
Args:
node_id (string): ID of the node to be inspected.
Returns:
A :py:class:`Node` object.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
... | def get(self, node_id):
"""
Get a node.
Args:
node_id (string): ID of the node to be inspected.
Returns:
A :py:class:`Node` object.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
... | [
"Get",
"a",
"node",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/nodes.py#L68-L82 | [
"def",
"get",
"(",
"self",
",",
"node_id",
")",
":",
"return",
"self",
".",
"prepare_model",
"(",
"self",
".",
"client",
".",
"api",
".",
"inspect_node",
"(",
"node_id",
")",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | NodeCollection.list | List swarm nodes.
Args:
filters (dict): Filters to process on the nodes list. Valid
filters: ``id``, ``name``, ``membership`` and ``role``.
Default: ``None``
Returns:
A list of :py:class:`Node` objects.
Raises:
:py:class:`doc... | docker/models/nodes.py | def list(self, *args, **kwargs):
"""
List swarm nodes.
Args:
filters (dict): Filters to process on the nodes list. Valid
filters: ``id``, ``name``, ``membership`` and ``role``.
Default: ``None``
Returns:
A list of :py:class:`Node`... | def list(self, *args, **kwargs):
"""
List swarm nodes.
Args:
filters (dict): Filters to process on the nodes list. Valid
filters: ``id``, ``name``, ``membership`` and ``role``.
Default: ``None``
Returns:
A list of :py:class:`Node`... | [
"List",
"swarm",
"nodes",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/nodes.py#L84-L107 | [
"def",
"list",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"[",
"self",
".",
"prepare_model",
"(",
"n",
")",
"for",
"n",
"in",
"self",
".",
"client",
".",
"api",
".",
"nodes",
"(",
"*",
"args",
",",
"*",
"*",
"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | json_splitter | Attempt to parse a json object from a buffer. If there is at least one
object, return it and the rest of the buffer, otherwise return None. | docker/utils/json_stream.py | def json_splitter(buffer):
"""Attempt to parse a json object from a buffer. If there is at least one
object, return it and the rest of the buffer, otherwise return None.
"""
buffer = buffer.strip()
try:
obj, index = json_decoder.raw_decode(buffer)
rest = buffer[json.decoder.WHITESPAC... | def json_splitter(buffer):
"""Attempt to parse a json object from a buffer. If there is at least one
object, return it and the rest of the buffer, otherwise return None.
"""
buffer = buffer.strip()
try:
obj, index = json_decoder.raw_decode(buffer)
rest = buffer[json.decoder.WHITESPAC... | [
"Attempt",
"to",
"parse",
"a",
"json",
"object",
"from",
"a",
"buffer",
".",
"If",
"there",
"is",
"at",
"least",
"one",
"object",
"return",
"it",
"and",
"the",
"rest",
"of",
"the",
"buffer",
"otherwise",
"return",
"None",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/json_stream.py#L28-L38 | [
"def",
"json_splitter",
"(",
"buffer",
")",
":",
"buffer",
"=",
"buffer",
".",
"strip",
"(",
")",
"try",
":",
"obj",
",",
"index",
"=",
"json_decoder",
".",
"raw_decode",
"(",
"buffer",
")",
"rest",
"=",
"buffer",
"[",
"json",
".",
"decoder",
".",
"W... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Plugin.configure | Update the plugin's settings.
Args:
options (dict): A key-value mapping of options.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/models/plugins.py | def configure(self, options):
"""
Update the plugin's settings.
Args:
options (dict): A key-value mapping of options.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
self.clie... | def configure(self, options):
"""
Update the plugin's settings.
Args:
options (dict): A key-value mapping of options.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
self.clie... | [
"Update",
"the",
"plugin",
"s",
"settings",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/plugins.py#L33-L45 | [
"def",
"configure",
"(",
"self",
",",
"options",
")",
":",
"self",
".",
"client",
".",
"api",
".",
"configure_plugin",
"(",
"self",
".",
"name",
",",
"options",
")",
"self",
".",
"reload",
"(",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Plugin.disable | Disable the plugin.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/models/plugins.py | def disable(self):
"""
Disable the plugin.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
self.client.api.disable_plugin(self.name)
self.reload() | def disable(self):
"""
Disable the plugin.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
self.client.api.disable_plugin(self.name)
self.reload() | [
"Disable",
"the",
"plugin",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/plugins.py#L47-L57 | [
"def",
"disable",
"(",
"self",
")",
":",
"self",
".",
"client",
".",
"api",
".",
"disable_plugin",
"(",
"self",
".",
"name",
")",
"self",
".",
"reload",
"(",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Plugin.enable | Enable the plugin.
Args:
timeout (int): Timeout in seconds. Default: 0
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/models/plugins.py | def enable(self, timeout=0):
"""
Enable the plugin.
Args:
timeout (int): Timeout in seconds. Default: 0
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
self.client.api.enable_... | def enable(self, timeout=0):
"""
Enable the plugin.
Args:
timeout (int): Timeout in seconds. Default: 0
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
self.client.api.enable_... | [
"Enable",
"the",
"plugin",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/plugins.py#L59-L71 | [
"def",
"enable",
"(",
"self",
",",
"timeout",
"=",
"0",
")",
":",
"self",
".",
"client",
".",
"api",
".",
"enable_plugin",
"(",
"self",
".",
"name",
",",
"timeout",
")",
"self",
".",
"reload",
"(",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Plugin.remove | Remove the plugin from the server.
Args:
force (bool): Remove even if the plugin is enabled.
Default: False
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/models/plugins.py | def remove(self, force=False):
"""
Remove the plugin from the server.
Args:
force (bool): Remove even if the plugin is enabled.
Default: False
Raises:
:py:class:`docker.errors.APIError`
If the server re... | def remove(self, force=False):
"""
Remove the plugin from the server.
Args:
force (bool): Remove even if the plugin is enabled.
Default: False
Raises:
:py:class:`docker.errors.APIError`
If the server re... | [
"Remove",
"the",
"plugin",
"from",
"the",
"server",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/plugins.py#L86-L98 | [
"def",
"remove",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"return",
"self",
".",
"client",
".",
"api",
".",
"remove_plugin",
"(",
"self",
".",
"name",
",",
"force",
"=",
"force",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Plugin.upgrade | Upgrade the plugin.
Args:
remote (string): Remote reference to upgrade to. The
``:latest`` tag is optional and is the default if omitted.
Default: this plugin's name.
Returns:
A generator streaming the decoded API logs | docker/models/plugins.py | def upgrade(self, remote=None):
"""
Upgrade the plugin.
Args:
remote (string): Remote reference to upgrade to. The
``:latest`` tag is optional and is the default if omitted.
Default: this plugin's name.
Returns:
... | def upgrade(self, remote=None):
"""
Upgrade the plugin.
Args:
remote (string): Remote reference to upgrade to. The
``:latest`` tag is optional and is the default if omitted.
Default: this plugin's name.
Returns:
... | [
"Upgrade",
"the",
"plugin",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/plugins.py#L100-L122 | [
"def",
"upgrade",
"(",
"self",
",",
"remote",
"=",
"None",
")",
":",
"if",
"self",
".",
"enabled",
":",
"raise",
"errors",
".",
"DockerError",
"(",
"'Plugin must be disabled before upgrading.'",
")",
"if",
"remote",
"is",
"None",
":",
"remote",
"=",
"self",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | PluginCollection.create | Create a new plugin.
Args:
name (string): The name of the plugin. The ``:latest`` tag is
optional, and is the default if omitted.
plugin_data_dir (string): Path to the plugin data directory.
Plugin data directory must contain the ``con... | docker/models/plugins.py | def create(self, name, plugin_data_dir, gzip=False):
"""
Create a new plugin.
Args:
name (string): The name of the plugin. The ``:latest`` tag is
optional, and is the default if omitted.
plugin_data_dir (string): Path to the plugin dat... | def create(self, name, plugin_data_dir, gzip=False):
"""
Create a new plugin.
Args:
name (string): The name of the plugin. The ``:latest`` tag is
optional, and is the default if omitted.
plugin_data_dir (string): Path to the plugin dat... | [
"Create",
"a",
"new",
"plugin",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/plugins.py#L128-L144 | [
"def",
"create",
"(",
"self",
",",
"name",
",",
"plugin_data_dir",
",",
"gzip",
"=",
"False",
")",
":",
"self",
".",
"client",
".",
"api",
".",
"create_plugin",
"(",
"name",
",",
"plugin_data_dir",
",",
"gzip",
")",
"return",
"self",
".",
"get",
"(",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | PluginCollection.get | Gets a plugin.
Args:
name (str): The name of the plugin.
Returns:
(:py:class:`Plugin`): The plugin.
Raises:
:py:class:`docker.errors.NotFound` If the plugin does not
exist.
:py:class:`docker.errors.APIError`
If the se... | docker/models/plugins.py | def get(self, name):
"""
Gets a plugin.
Args:
name (str): The name of the plugin.
Returns:
(:py:class:`Plugin`): The plugin.
Raises:
:py:class:`docker.errors.NotFound` If the plugin does not
exist.
:py:class:`docker.e... | def get(self, name):
"""
Gets a plugin.
Args:
name (str): The name of the plugin.
Returns:
(:py:class:`Plugin`): The plugin.
Raises:
:py:class:`docker.errors.NotFound` If the plugin does not
exist.
:py:class:`docker.e... | [
"Gets",
"a",
"plugin",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/plugins.py#L146-L162 | [
"def",
"get",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"prepare_model",
"(",
"self",
".",
"client",
".",
"api",
".",
"inspect_plugin",
"(",
"name",
")",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | PluginCollection.install | Pull and install a plugin.
Args:
remote_name (string): Remote reference for the plugin to
install. The ``:latest`` tag is optional, and is the
default if omitted.
local_name (string): Local name for the pulled plugin.
... | docker/models/plugins.py | def install(self, remote_name, local_name=None):
"""
Pull and install a plugin.
Args:
remote_name (string): Remote reference for the plugin to
install. The ``:latest`` tag is optional, and is the
default if omitted.
... | def install(self, remote_name, local_name=None):
"""
Pull and install a plugin.
Args:
remote_name (string): Remote reference for the plugin to
install. The ``:latest`` tag is optional, and is the
default if omitted.
... | [
"Pull",
"and",
"install",
"a",
"plugin",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/plugins.py#L164-L186 | [
"def",
"install",
"(",
"self",
",",
"remote_name",
",",
"local_name",
"=",
"None",
")",
":",
"privileges",
"=",
"self",
".",
"client",
".",
"api",
".",
"plugin_privileges",
"(",
"remote_name",
")",
"it",
"=",
"self",
".",
"client",
".",
"api",
".",
"pu... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | PluginCollection.list | List plugins installed on the server.
Returns:
(list of :py:class:`Plugin`): The plugins.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/models/plugins.py | def list(self):
"""
List plugins installed on the server.
Returns:
(list of :py:class:`Plugin`): The plugins.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
resp = self.client.api.plugins()
... | def list(self):
"""
List plugins installed on the server.
Returns:
(list of :py:class:`Plugin`): The plugins.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
resp = self.client.api.plugins()
... | [
"List",
"plugins",
"installed",
"on",
"the",
"server",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/plugins.py#L188-L200 | [
"def",
"list",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"client",
".",
"api",
".",
"plugins",
"(",
")",
"return",
"[",
"self",
".",
"prepare_model",
"(",
"r",
")",
"for",
"r",
"in",
"resp",
"]"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | DaemonApiMixin.df | Get data usage information.
Returns:
(dict): A dictionary representing different resource categories
and their respective data usage.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/api/daemon.py | def df(self):
"""
Get data usage information.
Returns:
(dict): A dictionary representing different resource categories
and their respective data usage.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
... | def df(self):
"""
Get data usage information.
Returns:
(dict): A dictionary representing different resource categories
and their respective data usage.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
... | [
"Get",
"data",
"usage",
"information",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/daemon.py#L9-L22 | [
"def",
"df",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/system/df'",
")",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | DaemonApiMixin.events | Get real-time events from the server. Similar to the ``docker events``
command.
Args:
since (UTC datetime or int): Get events from this point
until (UTC datetime or int): Get events until this point
filters (dict): Filter the events by event time, container or image
... | docker/api/daemon.py | def events(self, since=None, until=None, filters=None, decode=None):
"""
Get real-time events from the server. Similar to the ``docker events``
command.
Args:
since (UTC datetime or int): Get events from this point
until (UTC datetime or int): Get events until th... | def events(self, since=None, until=None, filters=None, decode=None):
"""
Get real-time events from the server. Similar to the ``docker events``
command.
Args:
since (UTC datetime or int): Get events from this point
until (UTC datetime or int): Get events until th... | [
"Get",
"real",
"-",
"time",
"events",
"from",
"the",
"server",
".",
"Similar",
"to",
"the",
"docker",
"events",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/daemon.py#L24-L81 | [
"def",
"events",
"(",
"self",
",",
"since",
"=",
"None",
",",
"until",
"=",
"None",
",",
"filters",
"=",
"None",
",",
"decode",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"since",
",",
"datetime",
")",
":",
"since",
"=",
"utils",
".",
"datetim... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | DaemonApiMixin.login | Authenticate with a registry. Similar to the ``docker login`` command.
Args:
username (str): The registry username
password (str): The plaintext password
email (str): The email for the registry account
registry (str): URL to the registry. E.g.
``... | docker/api/daemon.py | def login(self, username, password=None, email=None, registry=None,
reauth=False, dockercfg_path=None):
"""
Authenticate with a registry. Similar to the ``docker login`` command.
Args:
username (str): The registry username
password (str): The plaintext pass... | def login(self, username, password=None, email=None, registry=None,
reauth=False, dockercfg_path=None):
"""
Authenticate with a registry. Similar to the ``docker login`` command.
Args:
username (str): The registry username
password (str): The plaintext pass... | [
"Authenticate",
"with",
"a",
"registry",
".",
"Similar",
"to",
"the",
"docker",
"login",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/daemon.py#L97-L152 | [
"def",
"login",
"(",
"self",
",",
"username",
",",
"password",
"=",
"None",
",",
"email",
"=",
"None",
",",
"registry",
"=",
"None",
",",
"reauth",
"=",
"False",
",",
"dockercfg_path",
"=",
"None",
")",
":",
"# If we don't have any auth data so far, try reload... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | DaemonApiMixin.version | Returns version information from the server. Similar to the ``docker
version`` command.
Returns:
(dict): The server version information
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/api/daemon.py | def version(self, api_version=True):
"""
Returns version information from the server. Similar to the ``docker
version`` command.
Returns:
(dict): The server version information
Raises:
:py:class:`docker.errors.APIError`
If the server retu... | def version(self, api_version=True):
"""
Returns version information from the server. Similar to the ``docker
version`` command.
Returns:
(dict): The server version information
Raises:
:py:class:`docker.errors.APIError`
If the server retu... | [
"Returns",
"version",
"information",
"from",
"the",
"server",
".",
"Similar",
"to",
"the",
"docker",
"version",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/daemon.py#L168-L181 | [
"def",
"version",
"(",
"self",
",",
"api_version",
"=",
"True",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"\"/version\"",
",",
"versioned_api",
"=",
"api_version",
")",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_get",
"(",
"url",
")",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ServiceApiMixin.create_service | Create a service.
Args:
task_template (TaskTemplate): Specification of the task to start as
part of the new service.
name (string): User-defined name for the service. Optional.
labels (dict): A map of labels to associate with the service.
Opti... | docker/api/service.py | def create_service(
self, task_template, name=None, labels=None, mode=None,
update_config=None, networks=None, endpoint_config=None,
endpoint_spec=None, rollback_config=None
):
"""
Create a service.
Args:
task_template (TaskTemplate): Specific... | def create_service(
self, task_template, name=None, labels=None, mode=None,
update_config=None, networks=None, endpoint_config=None,
endpoint_spec=None, rollback_config=None
):
"""
Create a service.
Args:
task_template (TaskTemplate): Specific... | [
"Create",
"a",
"service",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/service.py#L118-L190 | [
"def",
"create_service",
"(",
"self",
",",
"task_template",
",",
"name",
"=",
"None",
",",
"labels",
"=",
"None",
",",
"mode",
"=",
"None",
",",
"update_config",
"=",
"None",
",",
"networks",
"=",
"None",
",",
"endpoint_config",
"=",
"None",
",",
"endpoi... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ServiceApiMixin.inspect_service | Return information about a service.
Args:
service (str): Service name or ID.
insert_defaults (boolean): If true, default values will be merged
into the service inspect output.
Returns:
(dict): A dictionary of the server-side representation of the
... | docker/api/service.py | def inspect_service(self, service, insert_defaults=None):
"""
Return information about a service.
Args:
service (str): Service name or ID.
insert_defaults (boolean): If true, default values will be merged
into the service inspect output.
Returns:... | def inspect_service(self, service, insert_defaults=None):
"""
Return information about a service.
Args:
service (str): Service name or ID.
insert_defaults (boolean): If true, default values will be merged
into the service inspect output.
Returns:... | [
"Return",
"information",
"about",
"a",
"service",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/service.py#L194-L220 | [
"def",
"inspect_service",
"(",
"self",
",",
"service",
",",
"insert_defaults",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/services/{0}'",
",",
"service",
")",
"params",
"=",
"{",
"}",
"if",
"insert_defaults",
"is",
"not",
"None",
":"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ServiceApiMixin.inspect_task | Retrieve information about a task.
Args:
task (str): Task ID
Returns:
(dict): Information about the task.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/api/service.py | def inspect_task(self, task):
"""
Retrieve information about a task.
Args:
task (str): Task ID
Returns:
(dict): Information about the task.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
""... | def inspect_task(self, task):
"""
Retrieve information about a task.
Args:
task (str): Task ID
Returns:
(dict): Information about the task.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
""... | [
"Retrieve",
"information",
"about",
"a",
"task",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/service.py#L224-L239 | [
"def",
"inspect_task",
"(",
"self",
",",
"task",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/tasks/{0}'",
",",
"task",
")",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ServiceApiMixin.remove_service | Stop and remove a service.
Args:
service (str): Service name or ID
Returns:
``True`` if successful.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/api/service.py | def remove_service(self, service):
"""
Stop and remove a service.
Args:
service (str): Service name or ID
Returns:
``True`` if successful.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""... | def remove_service(self, service):
"""
Stop and remove a service.
Args:
service (str): Service name or ID
Returns:
``True`` if successful.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""... | [
"Stop",
"and",
"remove",
"a",
"service",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/service.py#L243-L261 | [
"def",
"remove_service",
"(",
"self",
",",
"service",
")",
":",
"url",
"=",
"self",
".",
"_url",
"(",
"'/services/{0}'",
",",
"service",
")",
"resp",
"=",
"self",
".",
"_delete",
"(",
"url",
")",
"self",
".",
"_raise_for_status",
"(",
"resp",
")",
"ret... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ServiceApiMixin.service_logs | Get log stream for a service.
Note: This endpoint works only for services with the ``json-file``
or ``journald`` logging drivers.
Args:
service (str): ID or name of the service
details (bool): Show extra details provided to logs.
D... | docker/api/service.py | def service_logs(self, service, details=False, follow=False, stdout=False,
stderr=False, since=0, timestamps=False, tail='all',
is_tty=None):
"""
Get log stream for a service.
Note: This endpoint works only for services with the ``json-file``
... | def service_logs(self, service, details=False, follow=False, stdout=False,
stderr=False, since=0, timestamps=False, tail='all',
is_tty=None):
"""
Get log stream for a service.
Note: This endpoint works only for services with the ``json-file``
... | [
"Get",
"log",
"stream",
"for",
"a",
"service",
".",
"Note",
":",
"This",
"endpoint",
"works",
"only",
"for",
"services",
"with",
"the",
"json",
"-",
"file",
"or",
"journald",
"logging",
"drivers",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/service.py#L288-L334 | [
"def",
"service_logs",
"(",
"self",
",",
"service",
",",
"details",
"=",
"False",
",",
"follow",
"=",
"False",
",",
"stdout",
"=",
"False",
",",
"stderr",
"=",
"False",
",",
"since",
"=",
"0",
",",
"timestamps",
"=",
"False",
",",
"tail",
"=",
"'all'... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ServiceApiMixin.update_service | Update a service.
Args:
service (string): A service identifier (either its name or service
ID).
version (int): The version number of the service object being
updated. This is required to avoid conflicting writes.
task_template (TaskTemplate): ... | docker/api/service.py | def update_service(self, service, version, task_template=None, name=None,
labels=None, mode=None, update_config=None,
networks=None, endpoint_config=None,
endpoint_spec=None, fetch_current_spec=False,
rollback_config=None):
... | def update_service(self, service, version, task_template=None, name=None,
labels=None, mode=None, update_config=None,
networks=None, endpoint_config=None,
endpoint_spec=None, fetch_current_spec=False,
rollback_config=None):
... | [
"Update",
"a",
"service",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/service.py#L362-L478 | [
"def",
"update_service",
"(",
"self",
",",
"service",
",",
"version",
",",
"task_template",
"=",
"None",
",",
"name",
"=",
"None",
",",
"labels",
"=",
"None",
",",
"mode",
"=",
"None",
",",
"update_config",
"=",
"None",
",",
"networks",
"=",
"None",
",... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | create_api_error_from_http_exception | Create a suitable APIError from requests.exceptions.HTTPError. | docker/errors.py | def create_api_error_from_http_exception(e):
"""
Create a suitable APIError from requests.exceptions.HTTPError.
"""
response = e.response
try:
explanation = response.json()['message']
except ValueError:
explanation = (response.content or '').strip()
cls = APIError
if resp... | def create_api_error_from_http_exception(e):
"""
Create a suitable APIError from requests.exceptions.HTTPError.
"""
response = e.response
try:
explanation = response.json()['message']
except ValueError:
explanation = (response.content or '').strip()
cls = APIError
if resp... | [
"Create",
"a",
"suitable",
"APIError",
"from",
"requests",
".",
"exceptions",
".",
"HTTPError",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/errors.py#L13-L31 | [
"def",
"create_api_error_from_http_exception",
"(",
"e",
")",
":",
"response",
"=",
"e",
".",
"response",
"try",
":",
"explanation",
"=",
"response",
".",
"json",
"(",
")",
"[",
"'message'",
"]",
"except",
"ValueError",
":",
"explanation",
"=",
"(",
"respons... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ProxyConfig.from_dict | Instantiate a new ProxyConfig from a dictionary that represents a
client configuration, as described in `the documentation`_.
.. _the documentation:
https://docs.docker.com/network/proxy/#configure-the-docker-client | docker/utils/proxy.py | def from_dict(config):
'''
Instantiate a new ProxyConfig from a dictionary that represents a
client configuration, as described in `the documentation`_.
.. _the documentation:
https://docs.docker.com/network/proxy/#configure-the-docker-client
'''
return Proxy... | def from_dict(config):
'''
Instantiate a new ProxyConfig from a dictionary that represents a
client configuration, as described in `the documentation`_.
.. _the documentation:
https://docs.docker.com/network/proxy/#configure-the-docker-client
'''
return Proxy... | [
"Instantiate",
"a",
"new",
"ProxyConfig",
"from",
"a",
"dictionary",
"that",
"represents",
"a",
"client",
"configuration",
"as",
"described",
"in",
"the",
"documentation",
"_",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/proxy.py#L25-L38 | [
"def",
"from_dict",
"(",
"config",
")",
":",
"return",
"ProxyConfig",
"(",
"http",
"=",
"config",
".",
"get",
"(",
"'httpProxy'",
")",
",",
"https",
"=",
"config",
".",
"get",
"(",
"'httpsProxy'",
")",
",",
"ftp",
"=",
"config",
".",
"get",
"(",
"'ft... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ProxyConfig.get_environment | Return a dictionary representing the environment variables used to
set the proxy settings. | docker/utils/proxy.py | def get_environment(self):
'''
Return a dictionary representing the environment variables used to
set the proxy settings.
'''
env = {}
if self.http:
env['http_proxy'] = env['HTTP_PROXY'] = self.http
if self.https:
env['https_proxy'] = env['... | def get_environment(self):
'''
Return a dictionary representing the environment variables used to
set the proxy settings.
'''
env = {}
if self.http:
env['http_proxy'] = env['HTTP_PROXY'] = self.http
if self.https:
env['https_proxy'] = env['... | [
"Return",
"a",
"dictionary",
"representing",
"the",
"environment",
"variables",
"used",
"to",
"set",
"the",
"proxy",
"settings",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/proxy.py#L40-L54 | [
"def",
"get_environment",
"(",
"self",
")",
":",
"env",
"=",
"{",
"}",
"if",
"self",
".",
"http",
":",
"env",
"[",
"'http_proxy'",
"]",
"=",
"env",
"[",
"'HTTP_PROXY'",
"]",
"=",
"self",
".",
"http",
"if",
"self",
".",
"https",
":",
"env",
"[",
"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ProxyConfig.inject_proxy_environment | Given a list of strings representing environment variables, prepend the
environment variables corresponding to the proxy settings. | docker/utils/proxy.py | def inject_proxy_environment(self, environment):
'''
Given a list of strings representing environment variables, prepend the
environment variables corresponding to the proxy settings.
'''
if not self:
return environment
proxy_env = format_environment(self.get... | def inject_proxy_environment(self, environment):
'''
Given a list of strings representing environment variables, prepend the
environment variables corresponding to the proxy settings.
'''
if not self:
return environment
proxy_env = format_environment(self.get... | [
"Given",
"a",
"list",
"of",
"strings",
"representing",
"environment",
"variables",
"prepend",
"the",
"environment",
"variables",
"corresponding",
"to",
"the",
"proxy",
"settings",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/proxy.py#L56-L69 | [
"def",
"inject_proxy_environment",
"(",
"self",
",",
"environment",
")",
":",
"if",
"not",
"self",
":",
"return",
"environment",
"proxy_env",
"=",
"format_environment",
"(",
"self",
".",
"get_environment",
"(",
")",
")",
"if",
"not",
"environment",
":",
"retur... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Version.order | Return a representation that allows this object to be sorted
correctly with the default comparator. | scripts/versions.py | def order(self):
"""Return a representation that allows this object to be sorted
correctly with the default comparator.
"""
# non-GA releases should appear before GA releases
# Order: tp -> beta -> rc -> GA
if self.stage:
for st in STAGES:
if s... | def order(self):
"""Return a representation that allows this object to be sorted
correctly with the default comparator.
"""
# non-GA releases should appear before GA releases
# Order: tp -> beta -> rc -> GA
if self.stage:
for st in STAGES:
if s... | [
"Return",
"a",
"representation",
"that",
"allows",
"this",
"object",
"to",
"be",
"sorted",
"correctly",
"with",
"the",
"default",
"comparator",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/scripts/versions.py#L38-L52 | [
"def",
"order",
"(",
"self",
")",
":",
"# non-GA releases should appear before GA releases",
"# Order: tp -> beta -> rc -> GA",
"if",
"self",
".",
"stage",
":",
"for",
"st",
"in",
"STAGES",
":",
"if",
"st",
"in",
"self",
".",
"stage",
":",
"stage",
"=",
"(",
"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | Volume.remove | Remove this volume.
Args:
force (bool): Force removal of volumes that were already removed
out of band by the volume driver plugin.
Raises:
:py:class:`docker.errors.APIError`
If volume failed to remove. | docker/models/volumes.py | def remove(self, force=False):
"""
Remove this volume.
Args:
force (bool): Force removal of volumes that were already removed
out of band by the volume driver plugin.
Raises:
:py:class:`docker.errors.APIError`
If volume failed to r... | def remove(self, force=False):
"""
Remove this volume.
Args:
force (bool): Force removal of volumes that were already removed
out of band by the volume driver plugin.
Raises:
:py:class:`docker.errors.APIError`
If volume failed to r... | [
"Remove",
"this",
"volume",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/volumes.py#L14-L25 | [
"def",
"remove",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"return",
"self",
".",
"client",
".",
"api",
".",
"remove_volume",
"(",
"self",
".",
"id",
",",
"force",
"=",
"force",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | VolumeCollection.create | Create a volume.
Args:
name (str): Name of the volume. If not specified, the engine
generates a name.
driver (str): Name of the driver used to create the volume
driver_opts (dict): Driver options as a key-value dictionary
labels (dict): Labels to... | docker/models/volumes.py | def create(self, name=None, **kwargs):
"""
Create a volume.
Args:
name (str): Name of the volume. If not specified, the engine
generates a name.
driver (str): Name of the driver used to create the volume
driver_opts (dict): Driver options as ... | def create(self, name=None, **kwargs):
"""
Create a volume.
Args:
name (str): Name of the volume. If not specified, the engine
generates a name.
driver (str): Name of the driver used to create the volume
driver_opts (dict): Driver options as ... | [
"Create",
"a",
"volume",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/volumes.py#L32-L58 | [
"def",
"create",
"(",
"self",
",",
"name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"obj",
"=",
"self",
".",
"client",
".",
"api",
".",
"create_volume",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
"return",
"self",
".",
"prepare_model",
"(",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | VolumeCollection.get | Get a volume.
Args:
volume_id (str): Volume name.
Returns:
(:py:class:`Volume`): The volume.
Raises:
:py:class:`docker.errors.NotFound`
If the volume does not exist.
:py:class:`docker.errors.APIError`
If the serve... | docker/models/volumes.py | def get(self, volume_id):
"""
Get a volume.
Args:
volume_id (str): Volume name.
Returns:
(:py:class:`Volume`): The volume.
Raises:
:py:class:`docker.errors.NotFound`
If the volume does not exist.
:py:class:`docker... | def get(self, volume_id):
"""
Get a volume.
Args:
volume_id (str): Volume name.
Returns:
(:py:class:`Volume`): The volume.
Raises:
:py:class:`docker.errors.NotFound`
If the volume does not exist.
:py:class:`docker... | [
"Get",
"a",
"volume",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/volumes.py#L60-L76 | [
"def",
"get",
"(",
"self",
",",
"volume_id",
")",
":",
"return",
"self",
".",
"prepare_model",
"(",
"self",
".",
"client",
".",
"api",
".",
"inspect_volume",
"(",
"volume_id",
")",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | VolumeCollection.list | List volumes. Similar to the ``docker volume ls`` command.
Args:
filters (dict): Server-side list filtering options.
Returns:
(list of :py:class:`Volume`): The volumes.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an erro... | docker/models/volumes.py | def list(self, **kwargs):
"""
List volumes. Similar to the ``docker volume ls`` command.
Args:
filters (dict): Server-side list filtering options.
Returns:
(list of :py:class:`Volume`): The volumes.
Raises:
:py:class:`docker.errors.APIError`... | def list(self, **kwargs):
"""
List volumes. Similar to the ``docker volume ls`` command.
Args:
filters (dict): Server-side list filtering options.
Returns:
(list of :py:class:`Volume`): The volumes.
Raises:
:py:class:`docker.errors.APIError`... | [
"List",
"volumes",
".",
"Similar",
"to",
"the",
"docker",
"volume",
"ls",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/volumes.py#L78-L95 | [
"def",
"list",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"resp",
"=",
"self",
".",
"client",
".",
"api",
".",
"volumes",
"(",
"*",
"*",
"kwargs",
")",
"if",
"not",
"resp",
".",
"get",
"(",
"'Volumes'",
")",
":",
"return",
"[",
"]",
"retur... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | fnmatch | Test whether FILENAME matches PATTERN.
Patterns are Unix shell style:
* matches everything
? matches any single character
[seq] matches any character in seq
[!seq] matches any char not in seq
An initial period in FILENAME is not special.
Both FILENAME and PATTERN are first ... | docker/utils/fnmatch.py | def fnmatch(name, pat):
"""Test whether FILENAME matches PATTERN.
Patterns are Unix shell style:
* matches everything
? matches any single character
[seq] matches any character in seq
[!seq] matches any char not in seq
An initial period in FILENAME is not special.
Both ... | def fnmatch(name, pat):
"""Test whether FILENAME matches PATTERN.
Patterns are Unix shell style:
* matches everything
? matches any single character
[seq] matches any character in seq
[!seq] matches any char not in seq
An initial period in FILENAME is not special.
Both ... | [
"Test",
"whether",
"FILENAME",
"matches",
"PATTERN",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/fnmatch.py#L26-L44 | [
"def",
"fnmatch",
"(",
"name",
",",
"pat",
")",
":",
"name",
"=",
"name",
".",
"lower",
"(",
")",
"pat",
"=",
"pat",
".",
"lower",
"(",
")",
"return",
"fnmatchcase",
"(",
"name",
",",
"pat",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ConfigCollection.get | Get a config.
Args:
config_id (str): Config ID.
Returns:
(:py:class:`Config`): The config.
Raises:
:py:class:`docker.errors.NotFound`
If the config does not exist.
:py:class:`docker.errors.APIError`
If the server ... | docker/models/configs.py | def get(self, config_id):
"""
Get a config.
Args:
config_id (str): Config ID.
Returns:
(:py:class:`Config`): The config.
Raises:
:py:class:`docker.errors.NotFound`
If the config does not exist.
:py:class:`docker.e... | def get(self, config_id):
"""
Get a config.
Args:
config_id (str): Config ID.
Returns:
(:py:class:`Config`): The config.
Raises:
:py:class:`docker.errors.NotFound`
If the config does not exist.
:py:class:`docker.e... | [
"Get",
"a",
"config",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/configs.py#L36-L52 | [
"def",
"get",
"(",
"self",
",",
"config_id",
")",
":",
"return",
"self",
".",
"prepare_model",
"(",
"self",
".",
"client",
".",
"api",
".",
"inspect_config",
"(",
"config_id",
")",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | SSLHTTPAdapter.get_connection | Ensure assert_hostname is set correctly on our pool
We already take care of a normal poolmanager via init_poolmanager
But we still need to take care of when there is a proxy poolmanager | docker/transport/ssladapter.py | def get_connection(self, *args, **kwargs):
"""
Ensure assert_hostname is set correctly on our pool
We already take care of a normal poolmanager via init_poolmanager
But we still need to take care of when there is a proxy poolmanager
"""
conn = super(SSLHTTPAdapter, self... | def get_connection(self, *args, **kwargs):
"""
Ensure assert_hostname is set correctly on our pool
We already take care of a normal poolmanager via init_poolmanager
But we still need to take care of when there is a proxy poolmanager
"""
conn = super(SSLHTTPAdapter, self... | [
"Ensure",
"assert_hostname",
"is",
"set",
"correctly",
"on",
"our",
"pool"
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/transport/ssladapter.py#L54-L65 | [
"def",
"get_connection",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"super",
"(",
"SSLHTTPAdapter",
",",
"self",
")",
".",
"get_connection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"if",
"conn",
".",
"ass... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | exclude_paths | Given a root directory path and a list of .dockerignore patterns, return
an iterator of all paths (both regular files and directories) in the root
directory that do *not* match any of the patterns.
All paths returned are relative to the root. | docker/utils/build.py | def exclude_paths(root, patterns, dockerfile=None):
"""
Given a root directory path and a list of .dockerignore patterns, return
an iterator of all paths (both regular files and directories) in the root
directory that do *not* match any of the patterns.
All paths returned are relative to the root.
... | def exclude_paths(root, patterns, dockerfile=None):
"""
Given a root directory path and a list of .dockerignore patterns, return
an iterator of all paths (both regular files and directories) in the root
directory that do *not* match any of the patterns.
All paths returned are relative to the root.
... | [
"Given",
"a",
"root",
"directory",
"path",
"and",
"a",
"list",
"of",
".",
"dockerignore",
"patterns",
"return",
"an",
"iterator",
"of",
"all",
"paths",
"(",
"both",
"regular",
"files",
"and",
"directories",
")",
"in",
"the",
"root",
"directory",
"that",
"d... | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/build.py#L35-L49 | [
"def",
"exclude_paths",
"(",
"root",
",",
"patterns",
",",
"dockerfile",
"=",
"None",
")",
":",
"if",
"dockerfile",
"is",
"None",
":",
"dockerfile",
"=",
"'Dockerfile'",
"patterns",
".",
"append",
"(",
"'!'",
"+",
"dockerfile",
")",
"pm",
"=",
"PatternMatc... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.get_image | Get a tarball of an image. Similar to the ``docker save`` command.
Args:
image (str): Image name to get
chunk_size (int): The number of bytes returned by each iteration
of the generator. If ``None``, data will be streamed as it is
received. Default: 2 MB
... | docker/api/image.py | def get_image(self, image, chunk_size=DEFAULT_DATA_CHUNK_SIZE):
"""
Get a tarball of an image. Similar to the ``docker save`` command.
Args:
image (str): Image name to get
chunk_size (int): The number of bytes returned by each iteration
of the generator. ... | def get_image(self, image, chunk_size=DEFAULT_DATA_CHUNK_SIZE):
"""
Get a tarball of an image. Similar to the ``docker save`` command.
Args:
image (str): Image name to get
chunk_size (int): The number of bytes returned by each iteration
of the generator. ... | [
"Get",
"a",
"tarball",
"of",
"an",
"image",
".",
"Similar",
"to",
"the",
"docker",
"save",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L15-L41 | [
"def",
"get_image",
"(",
"self",
",",
"image",
",",
"chunk_size",
"=",
"DEFAULT_DATA_CHUNK_SIZE",
")",
":",
"res",
"=",
"self",
".",
"_get",
"(",
"self",
".",
"_url",
"(",
"\"/images/{0}/get\"",
",",
"image",
")",
",",
"stream",
"=",
"True",
")",
"return... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.history | Show the history of an image.
Args:
image (str): The image to show history for
Returns:
(str): The history of the image
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error. | docker/api/image.py | def history(self, image):
"""
Show the history of an image.
Args:
image (str): The image to show history for
Returns:
(str): The history of the image
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
... | def history(self, image):
"""
Show the history of an image.
Args:
image (str): The image to show history for
Returns:
(str): The history of the image
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
... | [
"Show",
"the",
"history",
"of",
"an",
"image",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L44-L59 | [
"def",
"history",
"(",
"self",
",",
"image",
")",
":",
"res",
"=",
"self",
".",
"_get",
"(",
"self",
".",
"_url",
"(",
"\"/images/{0}/history\"",
",",
"image",
")",
")",
"return",
"self",
".",
"_result",
"(",
"res",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.images | List images. Similar to the ``docker images`` command.
Args:
name (str): Only show images belonging to the repository ``name``
quiet (bool): Only return numeric IDs as a list.
all (bool): Show intermediate image layers. By default, these are
filtered out.
... | docker/api/image.py | def images(self, name=None, quiet=False, all=False, filters=None):
"""
List images. Similar to the ``docker images`` command.
Args:
name (str): Only show images belonging to the repository ``name``
quiet (bool): Only return numeric IDs as a list.
all (bool): ... | def images(self, name=None, quiet=False, all=False, filters=None):
"""
List images. Similar to the ``docker images`` command.
Args:
name (str): Only show images belonging to the repository ``name``
quiet (bool): Only return numeric IDs as a list.
all (bool): ... | [
"List",
"images",
".",
"Similar",
"to",
"the",
"docker",
"images",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L61-L93 | [
"def",
"images",
"(",
"self",
",",
"name",
"=",
"None",
",",
"quiet",
"=",
"False",
",",
"all",
"=",
"False",
",",
"filters",
"=",
"None",
")",
":",
"params",
"=",
"{",
"'filter'",
":",
"name",
",",
"'only_ids'",
":",
"1",
"if",
"quiet",
"else",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.import_image | Import an image. Similar to the ``docker import`` command.
If ``src`` is a string or unicode string, it will first be treated as a
path to a tarball on the local system. If there is an error reading
from that file, ``src`` will be treated as a URL instead to fetch the
image from. You ca... | docker/api/image.py | def import_image(self, src=None, repository=None, tag=None, image=None,
changes=None, stream_src=False):
"""
Import an image. Similar to the ``docker import`` command.
If ``src`` is a string or unicode string, it will first be treated as a
path to a tarball on the l... | def import_image(self, src=None, repository=None, tag=None, image=None,
changes=None, stream_src=False):
"""
Import an image. Similar to the ``docker import`` command.
If ``src`` is a string or unicode string, it will first be treated as a
path to a tarball on the l... | [
"Import",
"an",
"image",
".",
"Similar",
"to",
"the",
"docker",
"import",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L95-L145 | [
"def",
"import_image",
"(",
"self",
",",
"src",
"=",
"None",
",",
"repository",
"=",
"None",
",",
"tag",
"=",
"None",
",",
"image",
"=",
"None",
",",
"changes",
"=",
"None",
",",
"stream_src",
"=",
"False",
")",
":",
"if",
"not",
"(",
"src",
"or",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.import_image_from_data | Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but
allows importing in-memory bytes data.
Args:
data (bytes collection): Bytes collection containing valid tar data
repository (str): The repository to create
tag (str): The tag to apply | docker/api/image.py | def import_image_from_data(self, data, repository=None, tag=None,
changes=None):
"""
Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but
allows importing in-memory bytes data.
Args:
data (bytes collection): Bytes collection contai... | def import_image_from_data(self, data, repository=None, tag=None,
changes=None):
"""
Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but
allows importing in-memory bytes data.
Args:
data (bytes collection): Bytes collection contai... | [
"Like",
":",
"py",
":",
"meth",
":",
"~docker",
".",
"api",
".",
"image",
".",
"ImageApiMixin",
".",
"import_image",
"but",
"allows",
"importing",
"in",
"-",
"memory",
"bytes",
"data",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L147-L168 | [
"def",
"import_image_from_data",
"(",
"self",
",",
"data",
",",
"repository",
"=",
"None",
",",
"tag",
"=",
"None",
",",
"changes",
"=",
"None",
")",
":",
"u",
"=",
"self",
".",
"_url",
"(",
"'/images/create'",
")",
"params",
"=",
"_import_image_params",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.import_image_from_file | Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but only
supports importing from a tar file on disk.
Args:
filename (str): Full path to a tar file.
repository (str): The repository to create
tag (str): The tag to apply
Raises:
IOErr... | docker/api/image.py | def import_image_from_file(self, filename, repository=None, tag=None,
changes=None):
"""
Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but only
supports importing from a tar file on disk.
Args:
filename (str): Full path to a tar... | def import_image_from_file(self, filename, repository=None, tag=None,
changes=None):
"""
Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but only
supports importing from a tar file on disk.
Args:
filename (str): Full path to a tar... | [
"Like",
":",
"py",
":",
"meth",
":",
"~docker",
".",
"api",
".",
"image",
".",
"ImageApiMixin",
".",
"import_image",
"but",
"only",
"supports",
"importing",
"from",
"a",
"tar",
"file",
"on",
"disk",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L170-L187 | [
"def",
"import_image_from_file",
"(",
"self",
",",
"filename",
",",
"repository",
"=",
"None",
",",
"tag",
"=",
"None",
",",
"changes",
"=",
"None",
")",
":",
"return",
"self",
".",
"import_image",
"(",
"src",
"=",
"filename",
",",
"repository",
"=",
"re... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.import_image_from_url | Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but only
supports importing from a URL.
Args:
url (str): A URL pointing to a tar file.
repository (str): The repository to create
tag (str): The tag to apply | docker/api/image.py | def import_image_from_url(self, url, repository=None, tag=None,
changes=None):
"""
Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but only
supports importing from a URL.
Args:
url (str): A URL pointing to a tar file.
r... | def import_image_from_url(self, url, repository=None, tag=None,
changes=None):
"""
Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but only
supports importing from a URL.
Args:
url (str): A URL pointing to a tar file.
r... | [
"Like",
":",
"py",
":",
"meth",
":",
"~docker",
".",
"api",
".",
"image",
".",
"ImageApiMixin",
".",
"import_image",
"but",
"only",
"supports",
"importing",
"from",
"a",
"URL",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L196-L209 | [
"def",
"import_image_from_url",
"(",
"self",
",",
"url",
",",
"repository",
"=",
"None",
",",
"tag",
"=",
"None",
",",
"changes",
"=",
"None",
")",
":",
"return",
"self",
".",
"import_image",
"(",
"src",
"=",
"url",
",",
"repository",
"=",
"repository",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.import_image_from_image | Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but only
supports importing from another image, like the ``FROM`` Dockerfile
parameter.
Args:
image (str): Image name to import from
repository (str): The repository to create
tag (str): The tag to... | docker/api/image.py | def import_image_from_image(self, image, repository=None, tag=None,
changes=None):
"""
Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but only
supports importing from another image, like the ``FROM`` Dockerfile
parameter.
Args:
... | def import_image_from_image(self, image, repository=None, tag=None,
changes=None):
"""
Like :py:meth:`~docker.api.image.ImageApiMixin.import_image`, but only
supports importing from another image, like the ``FROM`` Dockerfile
parameter.
Args:
... | [
"Like",
":",
"py",
":",
"meth",
":",
"~docker",
".",
"api",
".",
"image",
".",
"ImageApiMixin",
".",
"import_image",
"but",
"only",
"supports",
"importing",
"from",
"another",
"image",
"like",
"the",
"FROM",
"Dockerfile",
"parameter",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L211-L225 | [
"def",
"import_image_from_image",
"(",
"self",
",",
"image",
",",
"repository",
"=",
"None",
",",
"tag",
"=",
"None",
",",
"changes",
"=",
"None",
")",
":",
"return",
"self",
".",
"import_image",
"(",
"image",
"=",
"image",
",",
"repository",
"=",
"repos... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.inspect_image | Get detailed information about an image. Similar to the ``docker
inspect`` command, but only for images.
Args:
image (str): The image to inspect
Returns:
(dict): Similar to the output of ``docker inspect``, but as a
single dict
Raises:
:py:c... | docker/api/image.py | def inspect_image(self, image):
"""
Get detailed information about an image. Similar to the ``docker
inspect`` command, but only for images.
Args:
image (str): The image to inspect
Returns:
(dict): Similar to the output of ``docker inspect``, but as a
... | def inspect_image(self, image):
"""
Get detailed information about an image. Similar to the ``docker
inspect`` command, but only for images.
Args:
image (str): The image to inspect
Returns:
(dict): Similar to the output of ``docker inspect``, but as a
... | [
"Get",
"detailed",
"information",
"about",
"an",
"image",
".",
"Similar",
"to",
"the",
"docker",
"inspect",
"command",
"but",
"only",
"for",
"images",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L228-L246 | [
"def",
"inspect_image",
"(",
"self",
",",
"image",
")",
":",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_get",
"(",
"self",
".",
"_url",
"(",
"\"/images/{0}/json\"",
",",
"image",
")",
")",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.inspect_distribution | Get image digest and platform information by contacting the registry.
Args:
image (str): The image name to inspect
auth_config (dict): Override the credentials that are found in the
config for this request. ``auth_config`` should contain the
``username``... | docker/api/image.py | def inspect_distribution(self, image, auth_config=None):
"""
Get image digest and platform information by contacting the registry.
Args:
image (str): The image name to inspect
auth_config (dict): Override the credentials that are found in the
config for t... | def inspect_distribution(self, image, auth_config=None):
"""
Get image digest and platform information by contacting the registry.
Args:
image (str): The image name to inspect
auth_config (dict): Override the credentials that are found in the
config for t... | [
"Get",
"image",
"digest",
"and",
"platform",
"information",
"by",
"contacting",
"the",
"registry",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L250-L282 | [
"def",
"inspect_distribution",
"(",
"self",
",",
"image",
",",
"auth_config",
"=",
"None",
")",
":",
"registry",
",",
"_",
"=",
"auth",
".",
"resolve_repository_name",
"(",
"image",
")",
"headers",
"=",
"{",
"}",
"if",
"auth_config",
"is",
"None",
":",
"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.load_image | Load an image that was previously saved using
:py:meth:`~docker.api.image.ImageApiMixin.get_image` (or ``docker
save``). Similar to ``docker load``.
Args:
data (binary): Image data to be loaded.
quiet (boolean): Suppress progress details in response.
Returns:
... | docker/api/image.py | def load_image(self, data, quiet=None):
"""
Load an image that was previously saved using
:py:meth:`~docker.api.image.ImageApiMixin.get_image` (or ``docker
save``). Similar to ``docker load``.
Args:
data (binary): Image data to be loaded.
quiet (boolean):... | def load_image(self, data, quiet=None):
"""
Load an image that was previously saved using
:py:meth:`~docker.api.image.ImageApiMixin.get_image` (or ``docker
save``). Similar to ``docker load``.
Args:
data (binary): Image data to be loaded.
quiet (boolean):... | [
"Load",
"an",
"image",
"that",
"was",
"previously",
"saved",
"using",
":",
"py",
":",
"meth",
":",
"~docker",
".",
"api",
".",
"image",
".",
"ImageApiMixin",
".",
"get_image",
"(",
"or",
"docker",
"save",
")",
".",
"Similar",
"to",
"docker",
"load",
".... | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L284-L317 | [
"def",
"load_image",
"(",
"self",
",",
"data",
",",
"quiet",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"quiet",
"is",
"not",
"None",
":",
"if",
"utils",
".",
"version_lt",
"(",
"self",
".",
"_version",
",",
"'1.23'",
")",
":",
"raise",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.pull | Pulls an image. Similar to the ``docker pull`` command.
Args:
repository (str): The repository to pull
tag (str): The tag to pull
stream (bool): Stream the output as a generator. Make sure to
consume the generator, otherwise pull might get cancelled.
... | docker/api/image.py | def pull(self, repository, tag=None, stream=False, auth_config=None,
decode=False, platform=None):
"""
Pulls an image. Similar to the ``docker pull`` command.
Args:
repository (str): The repository to pull
tag (str): The tag to pull
stream (bool)... | def pull(self, repository, tag=None, stream=False, auth_config=None,
decode=False, platform=None):
"""
Pulls an image. Similar to the ``docker pull`` command.
Args:
repository (str): The repository to pull
tag (str): The tag to pull
stream (bool)... | [
"Pulls",
"an",
"image",
".",
"Similar",
"to",
"the",
"docker",
"pull",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L344-L419 | [
"def",
"pull",
"(",
"self",
",",
"repository",
",",
"tag",
"=",
"None",
",",
"stream",
"=",
"False",
",",
"auth_config",
"=",
"None",
",",
"decode",
"=",
"False",
",",
"platform",
"=",
"None",
")",
":",
"if",
"not",
"tag",
":",
"repository",
",",
"... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.push | Push an image or a repository to the registry. Similar to the ``docker
push`` command.
Args:
repository (str): The repository to push to
tag (str): An optional tag to push
stream (bool): Stream the output as a blocking generator
auth_config (dict): Overri... | docker/api/image.py | def push(self, repository, tag=None, stream=False, auth_config=None,
decode=False):
"""
Push an image or a repository to the registry. Similar to the ``docker
push`` command.
Args:
repository (str): The repository to push to
tag (str): An optional ta... | def push(self, repository, tag=None, stream=False, auth_config=None,
decode=False):
"""
Push an image or a repository to the registry. Similar to the ``docker
push`` command.
Args:
repository (str): The repository to push to
tag (str): An optional ta... | [
"Push",
"an",
"image",
"or",
"a",
"repository",
"to",
"the",
"registry",
".",
"Similar",
"to",
"the",
"docker",
"push",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L421-L480 | [
"def",
"push",
"(",
"self",
",",
"repository",
",",
"tag",
"=",
"None",
",",
"stream",
"=",
"False",
",",
"auth_config",
"=",
"None",
",",
"decode",
"=",
"False",
")",
":",
"if",
"not",
"tag",
":",
"repository",
",",
"tag",
"=",
"utils",
".",
"pars... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.remove_image | Remove an image. Similar to the ``docker rmi`` command.
Args:
image (str): The image to remove
force (bool): Force removal of the image
noprune (bool): Do not delete untagged parents | docker/api/image.py | def remove_image(self, image, force=False, noprune=False):
"""
Remove an image. Similar to the ``docker rmi`` command.
Args:
image (str): The image to remove
force (bool): Force removal of the image
noprune (bool): Do not delete untagged parents
"""
... | def remove_image(self, image, force=False, noprune=False):
"""
Remove an image. Similar to the ``docker rmi`` command.
Args:
image (str): The image to remove
force (bool): Force removal of the image
noprune (bool): Do not delete untagged parents
"""
... | [
"Remove",
"an",
"image",
".",
"Similar",
"to",
"the",
"docker",
"rmi",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L483-L494 | [
"def",
"remove_image",
"(",
"self",
",",
"image",
",",
"force",
"=",
"False",
",",
"noprune",
"=",
"False",
")",
":",
"params",
"=",
"{",
"'force'",
":",
"force",
",",
"'noprune'",
":",
"noprune",
"}",
"res",
"=",
"self",
".",
"_delete",
"(",
"self",... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.search | Search for images on Docker Hub. Similar to the ``docker search``
command.
Args:
term (str): A term to search for.
Returns:
(list of dicts): The response of the search.
Raises:
:py:class:`docker.errors.APIError`
If the server returns... | docker/api/image.py | def search(self, term):
"""
Search for images on Docker Hub. Similar to the ``docker search``
command.
Args:
term (str): A term to search for.
Returns:
(list of dicts): The response of the search.
Raises:
:py:class:`docker.errors.API... | def search(self, term):
"""
Search for images on Docker Hub. Similar to the ``docker search``
command.
Args:
term (str): A term to search for.
Returns:
(list of dicts): The response of the search.
Raises:
:py:class:`docker.errors.API... | [
"Search",
"for",
"images",
"on",
"Docker",
"Hub",
".",
"Similar",
"to",
"the",
"docker",
"search",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L496-L514 | [
"def",
"search",
"(",
"self",
",",
"term",
")",
":",
"return",
"self",
".",
"_result",
"(",
"self",
".",
"_get",
"(",
"self",
".",
"_url",
"(",
"\"/images/search\"",
")",
",",
"params",
"=",
"{",
"'term'",
":",
"term",
"}",
")",
",",
"True",
")"
] | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ImageApiMixin.tag | Tag an image into a repository. Similar to the ``docker tag`` command.
Args:
image (str): The image to tag
repository (str): The repository to set for the tag
tag (str): The tag name
force (bool): Force
Returns:
(bool): ``True`` if successful... | docker/api/image.py | def tag(self, image, repository, tag=None, force=False):
"""
Tag an image into a repository. Similar to the ``docker tag`` command.
Args:
image (str): The image to tag
repository (str): The repository to set for the tag
tag (str): The tag name
for... | def tag(self, image, repository, tag=None, force=False):
"""
Tag an image into a repository. Similar to the ``docker tag`` command.
Args:
image (str): The image to tag
repository (str): The repository to set for the tag
tag (str): The tag name
for... | [
"Tag",
"an",
"image",
"into",
"a",
"repository",
".",
"Similar",
"to",
"the",
"docker",
"tag",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/image.py#L517-L547 | [
"def",
"tag",
"(",
"self",
",",
"image",
",",
"repository",
",",
"tag",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"params",
"=",
"{",
"'tag'",
":",
"tag",
",",
"'repo'",
":",
"repository",
",",
"'force'",
":",
"1",
"if",
"force",
"else",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ContainerApiMixin.attach | Attach to a container.
The ``.logs()`` function is a wrapper around this method, which you can
use instead if you want to fetch/stream container output without first
retrieving the entire backlog.
Args:
container (str): The container to attach to.
stdout (bool):... | docker/api/container.py | def attach(self, container, stdout=True, stderr=True,
stream=False, logs=False, demux=False):
"""
Attach to a container.
The ``.logs()`` function is a wrapper around this method, which you can
use instead if you want to fetch/stream container output without first
... | def attach(self, container, stdout=True, stderr=True,
stream=False, logs=False, demux=False):
"""
Attach to a container.
The ``.logs()`` function is a wrapper around this method, which you can
use instead if you want to fetch/stream container output without first
... | [
"Attach",
"to",
"a",
"container",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/container.py#L15-L66 | [
"def",
"attach",
"(",
"self",
",",
"container",
",",
"stdout",
"=",
"True",
",",
"stderr",
"=",
"True",
",",
"stream",
"=",
"False",
",",
"logs",
"=",
"False",
",",
"demux",
"=",
"False",
")",
":",
"params",
"=",
"{",
"'logs'",
":",
"logs",
"and",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ContainerApiMixin.attach_socket | Like ``attach``, but returns the underlying socket-like object for the
HTTP request.
Args:
container (str): The container to attach to.
params (dict): Dictionary of request parameters (e.g. ``stdout``,
``stderr``, ``stream``).
For ``detachKeys``, ... | docker/api/container.py | def attach_socket(self, container, params=None, ws=False):
"""
Like ``attach``, but returns the underlying socket-like object for the
HTTP request.
Args:
container (str): The container to attach to.
params (dict): Dictionary of request parameters (e.g. ``stdout``... | def attach_socket(self, container, params=None, ws=False):
"""
Like ``attach``, but returns the underlying socket-like object for the
HTTP request.
Args:
container (str): The container to attach to.
params (dict): Dictionary of request parameters (e.g. ``stdout``... | [
"Like",
"attach",
"but",
"returns",
"the",
"underlying",
"socket",
"-",
"like",
"object",
"for",
"the",
"HTTP",
"request",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/container.py#L69-L111 | [
"def",
"attach_socket",
"(",
"self",
",",
"container",
",",
"params",
"=",
"None",
",",
"ws",
"=",
"False",
")",
":",
"if",
"params",
"is",
"None",
":",
"params",
"=",
"{",
"'stdout'",
":",
"1",
",",
"'stderr'",
":",
"1",
",",
"'stream'",
":",
"1",... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ContainerApiMixin.commit | Commit a container to an image. Similar to the ``docker commit``
command.
Args:
container (str): The image hash of the container
repository (str): The repository to push the image to
tag (str): The tag to push
message (str): A commit message
a... | docker/api/container.py | def commit(self, container, repository=None, tag=None, message=None,
author=None, changes=None, conf=None):
"""
Commit a container to an image. Similar to the ``docker commit``
command.
Args:
container (str): The image hash of the container
reposit... | def commit(self, container, repository=None, tag=None, message=None,
author=None, changes=None, conf=None):
"""
Commit a container to an image. Similar to the ``docker commit``
command.
Args:
container (str): The image hash of the container
reposit... | [
"Commit",
"a",
"container",
"to",
"an",
"image",
".",
"Similar",
"to",
"the",
"docker",
"commit",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/container.py#L114-L147 | [
"def",
"commit",
"(",
"self",
",",
"container",
",",
"repository",
"=",
"None",
",",
"tag",
"=",
"None",
",",
"message",
"=",
"None",
",",
"author",
"=",
"None",
",",
"changes",
"=",
"None",
",",
"conf",
"=",
"None",
")",
":",
"params",
"=",
"{",
... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
train | ContainerApiMixin.containers | List containers. Similar to the ``docker ps`` command.
Args:
quiet (bool): Only display numeric Ids
all (bool): Show all containers. Only running containers are shown
by default
trunc (bool): Truncate output
latest (bool): Show only the latest cre... | docker/api/container.py | def containers(self, quiet=False, all=False, trunc=False, latest=False,
since=None, before=None, limit=-1, size=False,
filters=None):
"""
List containers. Similar to the ``docker ps`` command.
Args:
quiet (bool): Only display numeric Ids
... | def containers(self, quiet=False, all=False, trunc=False, latest=False,
since=None, before=None, limit=-1, size=False,
filters=None):
"""
List containers. Similar to the ``docker ps`` command.
Args:
quiet (bool): Only display numeric Ids
... | [
"List",
"containers",
".",
"Similar",
"to",
"the",
"docker",
"ps",
"command",
"."
] | docker/docker-py | python | https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/container.py#L149-L215 | [
"def",
"containers",
"(",
"self",
",",
"quiet",
"=",
"False",
",",
"all",
"=",
"False",
",",
"trunc",
"=",
"False",
",",
"latest",
"=",
"False",
",",
"since",
"=",
"None",
",",
"before",
"=",
"None",
",",
"limit",
"=",
"-",
"1",
",",
"size",
"=",... | 613d6aad83acc9931ff2ecfd6a6c7bd8061dc125 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.