Skip to content

Commit abd5370

Browse files
Santhosh Manoharshin-
authored andcommitted
Add 'verbose' option for network inspect api
Signed-off-by: Santhosh Manohar <[email protected]>
1 parent ffc3769 commit abd5370

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docker/api/network.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,23 @@ def remove_network(self, net_id):
168168
self._raise_for_status(res)
169169

170170
@minimum_version('1.21')
171-
def inspect_network(self, net_id):
171+
def inspect_network(self, net_id, verbose=False):
172172
"""
173173
Get detailed information about a network.
174174
175175
Args:
176176
net_id (str): ID of network
177+
verbose (bool): If set shows the service details across the cluster
178+
in swarm mode
177179
"""
178-
url = self._url("/networks/{0}", net_id)
180+
if verbose is True:
181+
if version_lt(self._version, '1.28'):
182+
raise InvalidVersion(
183+
'Verbose option was introduced in API 1.28'
184+
)
185+
url = self._url("/networks/{0}?verbose=true", net_id)
186+
else:
187+
url = self._url("/networks/{0}", net_id)
179188
res = self._get(url)
180189
return self._result(res, json=True)
181190

0 commit comments

Comments
 (0)