types.networks

Module Contents

Classes

EndpointConfig(self,version,aliases=None,links=None,ipv4_address=None,ipv6_address=None,link_local_ips=None)
NetworkingConfig(self,endpoints_config=None)
IPAMConfig(self,driver=”default”,pool_configs=None,options=None) Create an IPAM (IP Address Management) config dictionary to be used with
IPAMPool(self,subnet=None,iprange=None,gateway=None,aux_addresses=None) Create an IPAM pool config dictionary to be added to the
class EndpointConfig(version, aliases=None, links=None, ipv4_address=None, ipv6_address=None, link_local_ips=None)
__init__(version, aliases=None, links=None, ipv4_address=None, ipv6_address=None, link_local_ips=None)
class NetworkingConfig(endpoints_config=None)
__init__(endpoints_config=None)
class IPAMConfig(driver="default", pool_configs=None, options=None)

Create an IPAM (IP Address Management) config dictionary to be used with create_network().

Args:

driver (str): The IPAM driver to use. Defaults to default. pool_configs (list): A list of pool configurations

(IPAMPool). Defaults to empty list.
options (dict): Driver options as a key-value dictionary.
Defaults to None.

Example:

>>> ipam_config = docker.types.IPAMConfig(driver='default')
>>> network = client.create_network('network1', ipam=ipam_config)
__init__(driver="default", pool_configs=None, options=None)
class IPAMPool(subnet=None, iprange=None, gateway=None, aux_addresses=None)

Create an IPAM pool config dictionary to be added to the pool_configs parameter of IPAMConfig.

Args:

subnet (str): Custom subnet for this IPAM pool using the CIDR
notation. Defaults to None.
iprange (str): Custom IP range for endpoints in this IPAM pool using
the CIDR notation. Defaults to None.

gateway (str): Custom IP address for the pool’s gateway. aux_addresses (dict): A dictionary of key -> ip_address

relationships specifying auxiliary addresses that need to be allocated by the IPAM driver.

Example:

>>> ipam_pool = docker.types.IPAMPool(
    subnet='124.42.0.0/16',
    iprange='124.42.0.0/24',
    gateway='124.42.0.254',
    aux_addresses={
        'reserved1': '124.42.1.1'
    }
)
>>> ipam_config = docker.types.IPAMConfig(
        pool_configs=[ipam_pool])
__init__(subnet=None, iprange=None, gateway=None, aux_addresses=None)