mirror of https://github.com/docker/docker-py.git
Added pause/unpause methods.
This commit is contained in:
parent
7a46297085
commit
75e53f1add
12
README.md
12
README.md
|
|
@ -181,6 +181,12 @@ The `logs` function is a wrapper around this one, which you can use
|
|||
instead if you want to fetch/stream container output without first
|
||||
retrieving the entire backlog.
|
||||
|
||||
```python
|
||||
c.pause(container)
|
||||
```
|
||||
|
||||
Pauses all processes within a container.
|
||||
|
||||
```python
|
||||
c.ping()
|
||||
```
|
||||
|
|
@ -307,6 +313,12 @@ c.top(container)
|
|||
|
||||
Identical to the `docker top` command.
|
||||
|
||||
```python
|
||||
c.unpause(container)
|
||||
```
|
||||
|
||||
Unpauses all processes within a container.
|
||||
|
||||
```python
|
||||
c.version()
|
||||
```
|
||||
|
|
|
|||
|
|
@ -696,6 +696,13 @@ class Client(requests.Session):
|
|||
logs=True
|
||||
)
|
||||
|
||||
def pause(self, container):
|
||||
if isinstance(container, dict):
|
||||
container = container.get('Id')
|
||||
url = self._url('/containers/{0}/pause'.format(container))
|
||||
res = self._post(url)
|
||||
self._raise_for_status(res)
|
||||
|
||||
def ping(self):
|
||||
return self._result(self._get(self._url('/_ping')))
|
||||
|
||||
|
|
@ -922,6 +929,13 @@ class Client(requests.Session):
|
|||
def version(self):
|
||||
return self._result(self._get(self._url("/version")), True)
|
||||
|
||||
def unpause(self, container):
|
||||
if isinstance(container, dict):
|
||||
container = container.get('Id')
|
||||
url = self._url('/containers/{0}/unpause'.format(container))
|
||||
res = self._post(url)
|
||||
self._raise_for_status(res)
|
||||
|
||||
def wait(self, container):
|
||||
if isinstance(container, dict):
|
||||
container = container.get('Id')
|
||||
|
|
|
|||
Loading…
Reference in New Issue