MCPcopy Create free account
hub / github.com/docker/docker-py / IPAMPool

Class IPAMPool

docker/types/networks.py:91–128  ·  view source on GitHub ↗

Create an IPAM pool config dictionary to be added to the ``pool_configs`` parameter of :py:class:`~docker.types.IPAMConfig`. Args: subnet (str): Custom subnet for this IPAM pool using the CIDR notation. Defaults to ``None``. iprange (str): Custom IP ran

Source from the content-addressed store, hash-verified

89
90
91class IPAMPool(dict):
92 """
93 Create an IPAM pool config dictionary to be added to the
94 ``pool_configs`` parameter of
95 :py:class:`~docker.types.IPAMConfig`.
96
97 Args:
98
99 subnet (str): Custom subnet for this IPAM pool using the CIDR
100 notation. Defaults to ``None``.
101 iprange (str): Custom IP range for endpoints in this IPAM pool using
102 the CIDR notation. Defaults to ``None``.
103 gateway (str): Custom IP address for the pool's gateway.
104 aux_addresses (dict): A dictionary of ``key -> ip_address``
105 relationships specifying auxiliary addresses that need to be
106 allocated by the IPAM driver.
107
108 Example:
109
110 >>> ipam_pool = docker.types.IPAMPool(
111 subnet='124.42.0.0/16',
112 iprange='124.42.0.0/24',
113 gateway='124.42.0.254',
114 aux_addresses={
115 'reserved1': '124.42.1.1'
116 }
117 )
118 >>> ipam_config = docker.types.IPAMConfig(
119 pool_configs=[ipam_pool])
120 """
121 def __init__(self, subnet=None, iprange=None, gateway=None,
122 aux_addresses=None):
123 self.update({
124 'Subnet': subnet,
125 'IPRange': iprange,
126 'Gateway': gateway,
127 'AuxiliaryAddresses': aux_addresses
128 })

Calls

no outgoing calls