The nova.network.model Module

class FixedIP(floating_ips=None, **kwargs)

Bases: nova.network.model.IP

Represents a Fixed IP address in Nova.

add_floating_ip(floating_ip)
floating_ip_addresses()
static hydrate(fixed_ip)
class IP(address=None, type=None, **kwargs)

Bases: nova.network.model.Model

Represents an IP address in Nova.

classmethod hydrate(ip)
is_in_subnet(subnet)
class Model

Bases: dict

Defines some necessary structures for most of the network models.

get_meta(key, default=None)

calls get(key, default) on self[‘meta’].

class Network(id=None, bridge=None, label=None, subnets=None, **kwargs)

Bases: nova.network.model.Model

Represents a Network in Nova.

add_subnet(subnet)
classmethod hydrate(network)
class NetworkInfo

Bases: list

Stores and manipulates network information for a Nova instance.

fixed_ips()

Returns all fixed_ips without floating_ips attached.

floating_ips()

Returns all floating_ips.

classmethod hydrate(network_info)
json()
wait(do_raise=True)

A no-op method.

This is useful to avoid type checking when NetworkInfo might be subclassed with NetworkInfoAsyncWrapper.

class NetworkInfoAsyncWrapper(async_method, *args, **kwargs)

Bases: nova.network.model.NetworkInfo

Wrapper around NetworkInfo that allows retrieving NetworkInfo in an async manner.

This allows one to start querying for network information before you know you will need it. If you have a long-running operation, this allows the network model retrieval to occur in the background. When you need the data, it will ensure the async operation has completed.

As an example:

def allocate_net_info(arg1, arg2)
return call_neutron_to_allocate(arg1, arg2)

network_info = NetworkInfoAsyncWrapper(allocate_net_info, arg1, arg2) [do a long running operation – real network_info will be retrieved in the background] [do something with network_info]

wait(do_raise=True)

Wait for async call to finish.

class Route(cidr=None, gateway=None, interface=None, **kwargs)

Bases: nova.network.model.Model

Represents an IP Route in Nova.

classmethod hydrate(route)
class Subnet(cidr=None, dns=None, gateway=None, ips=None, routes=None, **kwargs)

Bases: nova.network.model.Model

Represents a Subnet in Nova.

add_dns(dns)
add_ip(ip)
add_route(new_route)
as_netaddr()

Convience function to get cidr as a netaddr object.

classmethod hydrate(subnet)
class VIF(id=None, address=None, network=None, type=None, details=None, devname=None, ovs_interfaceid=None, qbh_params=None, qbg_params=None, active=False, vnic_type='normal', profile=None, preserve_on_delete=False, **kwargs)

Bases: nova.network.model.Model

Represents a Virtual Interface in Nova.

fixed_ips()
floating_ips()
get_physical_network()
classmethod hydrate(vif)
is_hybrid_plug_enabled()
is_neutron_filtering_enabled()
labeled_ips()

Returns the list of all IPs

The return value looks like this flat structure:

{'network_label': 'my_network',
 'network_id': 'n8v29837fn234782f08fjxk3ofhb84',
 'ips': [{'address': '123.123.123.123',
          'version': 4,
          'type: 'fixed',
          'meta': {...}},
         {'address': '124.124.124.124',
          'version': 4,
          'type': 'floating',
          'meta': {...}},
         {'address': 'fe80::4',
          'version': 6,
          'type': 'fixed',
          'meta': {...}}]
class VIF8021QbgParams(managerid, typeid, typeidversion, instanceid)

Bases: nova.network.model.Model

Represents the parameters for a 802.1qbg VIF.

class VIF8021QbhParams(profileid)

Bases: nova.network.model.Model

Represents the parameters for a 802.1qbh VIF.

ensure_string_keys(d)
get_netmask(ip, subnet)

Returns the netmask appropriate for injection into a guest.

Previous topic

The nova.network.minidns Module

Next topic

The nova.network.neutronv2.api Module

Project Source

This Page