summaryrefslogtreecommitdiff
path: root/docker/api/container.py
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2017-06-15 18:34:00 -0700
committerJoffrey F <joffrey@docker.com>2017-06-15 18:34:00 -0700
commitd33e9ad030effb126dea39181ef401c80c442f15 (patch)
treee4b5f568a2acacde35904587693c737f611c34c7 /docker/api/container.py
parent8fc6540fea8d4ed86f187a064872b6d616208e8b (diff)
downloaddocker-py-d33e9ad030effb126dea39181ef401c80c442f15.tar.gz
Update check_resource decorator to account for new resource names
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/api/container.py')
-rw-r--r--docker/api/container.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/docker/api/container.py b/docker/api/container.py
index 97b5405..f7ff971 100644
--- a/docker/api/container.py
+++ b/docker/api/container.py
@@ -10,7 +10,7 @@ from ..types import (
class ContainerApiMixin(object):
- @utils.check_resource
+ @utils.check_resource('container')
def attach(self, container, stdout=True, stderr=True,
stream=False, logs=False):
"""
@@ -54,7 +54,7 @@ class ContainerApiMixin(object):
return self._read_from_socket(response, stream)
- @utils.check_resource
+ @utils.check_resource('container')
def attach_socket(self, container, params=None, ws=False):
"""
Like ``attach``, but returns the underlying socket-like object for the
@@ -93,7 +93,7 @@ class ContainerApiMixin(object):
)
)
- @utils.check_resource
+ @utils.check_resource('container')
def commit(self, container, repository=None, tag=None, message=None,
author=None, changes=None, conf=None):
"""
@@ -195,7 +195,7 @@ class ContainerApiMixin(object):
x['Id'] = x['Id'][:12]
return res
- @utils.check_resource
+ @utils.check_resource('container')
def copy(self, container, resource):
"""
Identical to the ``docker cp`` command. Get files/folders from the
@@ -659,7 +659,7 @@ class ContainerApiMixin(object):
"""
return EndpointConfig(self._version, *args, **kwargs)
- @utils.check_resource
+ @utils.check_resource('container')
def diff(self, container):
"""
Inspect changes on a container's filesystem.
@@ -678,7 +678,7 @@ class ContainerApiMixin(object):
self._get(self._url("/containers/{0}/changes", container)), True
)
- @utils.check_resource
+ @utils.check_resource('container')
def export(self, container):
"""
Export the contents of a filesystem as a tar archive.
@@ -699,7 +699,7 @@ class ContainerApiMixin(object):
self._raise_for_status(res)
return res.raw
- @utils.check_resource
+ @utils.check_resource('container')
@utils.minimum_version('1.20')
def get_archive(self, container, path):
"""
@@ -730,7 +730,7 @@ class ContainerApiMixin(object):
utils.decode_json_header(encoded_stat) if encoded_stat else None
)
- @utils.check_resource
+ @utils.check_resource('container')
def inspect_container(self, container):
"""
Identical to the `docker inspect` command, but only for containers.
@@ -750,7 +750,7 @@ class ContainerApiMixin(object):
self._get(self._url("/containers/{0}/json", container)), True
)
- @utils.check_resource
+ @utils.check_resource('container')
def kill(self, container, signal=None):
"""
Kill a container or send a signal to a container.
@@ -773,7 +773,7 @@ class ContainerApiMixin(object):
self._raise_for_status(res)
- @utils.check_resource
+ @utils.check_resource('container')
def logs(self, container, stdout=True, stderr=True, stream=False,
timestamps=False, tail='all', since=None, follow=None):
"""
@@ -836,7 +836,7 @@ class ContainerApiMixin(object):
logs=True
)
- @utils.check_resource
+ @utils.check_resource('container')
def pause(self, container):
"""
Pauses all processes within a container.
@@ -852,7 +852,7 @@ class ContainerApiMixin(object):
res = self._post(url)
self._raise_for_status(res)
- @utils.check_resource
+ @utils.check_resource('container')
def port(self, container, private_port):
"""
Lookup the public-facing port that is NAT-ed to ``private_port``.
@@ -901,7 +901,7 @@ class ContainerApiMixin(object):
return h_ports
- @utils.check_resource
+ @utils.check_resource('container')
@utils.minimum_version('1.20')
def put_archive(self, container, path, data):
"""
@@ -949,7 +949,7 @@ class ContainerApiMixin(object):
url = self._url('/containers/prune')
return self._result(self._post(url, params=params), True)
- @utils.check_resource
+ @utils.check_resource('container')
def remove_container(self, container, v=False, link=False, force=False):
"""
Remove a container. Similar to the ``docker rm`` command.
@@ -973,7 +973,7 @@ class ContainerApiMixin(object):
self._raise_for_status(res)
@utils.minimum_version('1.17')
- @utils.check_resource
+ @utils.check_resource('container')
def rename(self, container, name):
"""
Rename a container. Similar to the ``docker rename`` command.
@@ -991,7 +991,7 @@ class ContainerApiMixin(object):
res = self._post(url, params=params)
self._raise_for_status(res)
- @utils.check_resource
+ @utils.check_resource('container')
def resize(self, container, height, width):
"""
Resize the tty session.
@@ -1010,7 +1010,7 @@ class ContainerApiMixin(object):
res = self._post(url, params=params)
self._raise_for_status(res)
- @utils.check_resource
+ @utils.check_resource('container')
def restart(self, container, timeout=10):
"""
Restart a container. Similar to the ``docker restart`` command.
@@ -1031,7 +1031,7 @@ class ContainerApiMixin(object):
res = self._post(url, params=params)
self._raise_for_status(res)
- @utils.check_resource
+ @utils.check_resource('container')
def start(self, container, *args, **kwargs):
"""
Start a container. Similar to the ``docker start`` command, but
@@ -1070,7 +1070,7 @@ class ContainerApiMixin(object):
self._raise_for_status(res)
@utils.minimum_version('1.17')
- @utils.check_resource
+ @utils.check_resource('container')
def stats(self, container, decode=None, stream=True):
"""
Stream statistics for a specific container. Similar to the
@@ -1096,7 +1096,7 @@ class ContainerApiMixin(object):
return self._result(self._get(url, params={'stream': False}),
json=True)
- @utils.check_resource
+ @utils.check_resource('container')
def stop(self, container, timeout=10):
"""
Stops a container. Similar to the ``docker stop`` command.
@@ -1117,7 +1117,7 @@ class ContainerApiMixin(object):
timeout=(timeout + (self.timeout or 0)))
self._raise_for_status(res)
- @utils.check_resource
+ @utils.check_resource('container')
def top(self, container, ps_args=None):
"""
Display the running processes of a container.
@@ -1139,7 +1139,7 @@ class ContainerApiMixin(object):
params['ps_args'] = ps_args
return self._result(self._get(u, params=params), True)
- @utils.check_resource
+ @utils.check_resource('container')
def unpause(self, container):
"""
Unpause all processes within a container.
@@ -1152,7 +1152,7 @@ class ContainerApiMixin(object):
self._raise_for_status(res)
@utils.minimum_version('1.22')
- @utils.check_resource
+ @utils.check_resource('container')
def update_container(
self, container, blkio_weight=None, cpu_period=None, cpu_quota=None,
cpu_shares=None, cpuset_cpus=None, cpuset_mems=None, mem_limit=None,
@@ -1217,7 +1217,7 @@ class ContainerApiMixin(object):
res = self._post_json(url, data=data)
return self._result(res, True)
- @utils.check_resource
+ @utils.check_resource('container')
def wait(self, container, timeout=None):
"""
Block until a container stops, then return its exit code. Similar to