File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -168,24 +168,23 @@ def remove_network(self, net_id):
168
168
self ._raise_for_status (res )
169
169
170
170
@minimum_version ('1.21' )
171
- def inspect_network (self , net_id , verbose = False ):
171
+ def inspect_network (self , net_id , verbose = None ):
172
172
"""
173
173
Get detailed information about a network.
174
174
175
175
Args:
176
176
net_id (str): ID of network
177
- verbose (bool): If set shows the service details across the cluster
178
- in swarm mode
177
+ verbose (bool): Show the service details across the cluster in
178
+ swarm mode.
179
179
"""
180
- if verbose is True :
180
+ params = {}
181
+ if verbose is not None :
181
182
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 )
188
- res = self ._get (url )
183
+ raise InvalidVersion ('verbose was introduced in API 1.28' )
184
+ params ['verbose' ] = verbose
185
+
186
+ url = self ._url ("/networks/{0}" , net_id )
187
+ res = self ._get (url , params = params )
189
188
return self ._result (res , json = True )
190
189
191
190
@check_resource
You can’t perform that action at this time.
0 commit comments