mirror of https://github.com/docker/docker-py.git
Merge pull request #231 from dotcloud/ping_support
Added Client.ping() method
This commit is contained in:
commit
b629f9d7ec
|
|
@ -170,6 +170,13 @@ 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.ping()
|
||||
```
|
||||
|
||||
Hits the /_ping endpoint of the remote API and returns the result.
|
||||
An exception will be raised if the endpoint isn't responding.
|
||||
|
||||
```python
|
||||
c.port(container, private_port)
|
||||
```
|
||||
|
|
|
|||
|
|
@ -616,6 +616,9 @@ class Client(requests.Session):
|
|||
logs=True
|
||||
)
|
||||
|
||||
def ping(self):
|
||||
return self._result(self._get(self._url('/_ping')))
|
||||
|
||||
def port(self, container, private_port):
|
||||
if isinstance(container, dict):
|
||||
container = container.get('Id')
|
||||
|
|
|
|||
Loading…
Reference in New Issue