mirror of https://github.com/docker/docker-py.git
Add 'verbose' option for network inspect api
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
This commit is contained in:
parent
ffc3769920
commit
abd5370d87
|
@ -168,13 +168,22 @@ class NetworkApiMixin(object):
|
||||||
self._raise_for_status(res)
|
self._raise_for_status(res)
|
||||||
|
|
||||||
@minimum_version('1.21')
|
@minimum_version('1.21')
|
||||||
def inspect_network(self, net_id):
|
def inspect_network(self, net_id, verbose=False):
|
||||||
"""
|
"""
|
||||||
Get detailed information about a network.
|
Get detailed information about a network.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
net_id (str): ID of network
|
net_id (str): ID of network
|
||||||
|
verbose (bool): If set shows the service details across the cluster
|
||||||
|
in swarm mode
|
||||||
"""
|
"""
|
||||||
|
if verbose is True:
|
||||||
|
if version_lt(self._version, '1.28'):
|
||||||
|
raise InvalidVersion(
|
||||||
|
'Verbose option was introduced in API 1.28'
|
||||||
|
)
|
||||||
|
url = self._url("/networks/{0}?verbose=true", net_id)
|
||||||
|
else:
|
||||||
url = self._url("/networks/{0}", net_id)
|
url = self._url("/networks/{0}", net_id)
|
||||||
res = self._get(url)
|
res = self._get(url)
|
||||||
return self._result(res, json=True)
|
return self._result(res, json=True)
|
||||||
|
|
Loading…
Reference in New Issue