This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.network.api Module

Handles all requests relating to instances (guest vms).

class nova.network.api.API(db_driver=None)

Bases: nova.db.base.Base

API for interacting with the network manager.

add_fixed_ip_to_instance(context, instance_id, host, network_id)

Adds a fixed ip to instance from specified network.

add_network_to_project(context, project_id)

Force adds another network to a project.

allocate_floating_ip(context)

Adds a floating ip to a project.

allocate_for_instance(context, instance, **kwargs)

Allocates all network structures for an instance.

Returns:network info as from get_instance_nw_info() below
associate_floating_ip(context, floating_ip, fixed_ip, affect_auto_assigned=False)

Associates a floating ip with a fixed ip.

ensures floating ip is allocated to the project in context

Parameters:
  • fixed_ip – is either fixed_ip object or a string fixed ip address
  • floating_ip – is a string floating ip address
deallocate_for_instance(context, instance, **kwargs)

Deallocates all network structures related to instance.

disassociate_floating_ip(context, address, affect_auto_assigned=False)

Disassociates a floating ip from fixed ip it is associated with.

get_floating_ip(context, id)
get_floating_ip_by_ip(context, address)
get_instance_nw_info(context, instance)

Returns all network info related to an instance.

get_vifs_by_instance(context, instance_id)
list_floating_ips(context)
release_floating_ip(context, address, affect_auto_assigned=False)

Removes floating ip with address from a project.

remove_fixed_ip_from_instance(context, instance_id, address)

Removes a fixed ip from instance from specified network.

validate_networks(context, requested_networks)

validate the networks passed at the time of creating the server