Kaydet (Commit) 1d59aeca authored tarafından Joffrey F's avatar Joffrey F

Add options to IPAMConfig

Signed-off-by: 's avatarJoffrey F <joffrey@docker.com>
üst fd4c01aa
......@@ -50,6 +50,8 @@ class IPAMConfig(dict):
driver (str): The IPAM driver to use. Defaults to ``default``.
pool_configs (list): A list of pool configurations
(:py:class:`~docker.types.IPAMPool`). Defaults to empty list.
options (dict): Driver options as a key-value dictionary.
Defaults to `None`.
Example:
......@@ -57,12 +59,17 @@ class IPAMConfig(dict):
>>> network = client.create_network('network1', ipam=ipam_config)
"""
def __init__(self, driver='default', pool_configs=None):
def __init__(self, driver='default', pool_configs=None, options=None):
self.update({
'Driver': driver,
'Config': pool_configs or []
})
if options:
if not isinstance(options, dict):
raise TypeError('IPAMConfig options must be a dictionary')
self['Options'] = options
class IPAMPool(dict):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment