File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,26 @@ class IPAMConfig(dict):
50
50
driver (str): The IPAM driver to use. Defaults to ``default``.
51
51
pool_configs (list): A list of pool configurations
52
52
(:py:class:`~docker.types.IPAMPool`). Defaults to empty list.
53
+ options (dict): Driver options as a key-value dictionary.
54
+ Defaults to `None`.
53
55
54
56
Example:
55
57
56
58
>>> ipam_config = docker.types.IPAMConfig(driver='default')
57
59
>>> network = client.create_network('network1', ipam=ipam_config)
58
60
59
61
"""
60
- def __init__ (self , driver = 'default' , pool_configs = None ):
62
+ def __init__ (self , driver = 'default' , pool_configs = None , options = None ):
61
63
self .update ({
62
64
'Driver' : driver ,
63
65
'Config' : pool_configs or []
64
66
})
65
67
68
+ if options :
69
+ if not isinstance (options , dict ):
70
+ raise TypeError ('IPAMConfig options must be a dictionary' )
71
+ self ['Options' ] = options
72
+
66
73
67
74
class IPAMPool (dict ):
68
75
"""
You can’t perform that action at this time.
0 commit comments