Private Networks

Private Networks are virtual networks dedicated to your cloud provider account. It is isolated from other virtual networks. This class inherits from TopLevelResource and has direct access to the resource’s database object.

attr organization_service_id:
 The ID of the parent organization service (cloud)
attr region_name:
 The region that the instance resides in
attr resource_id:
 The primary resource identifier that takes the form of a prefix followed by numbers and letters
attr network_id:
 The resource ID of the network
attr state:The state that the network is in (available etc.)
attr name:The name of the network
attr cidr:The CIDR block for the network. The default network always has a /16 netmask; for example, 172.31.0.0/16
attr prefix:The routing prefix associated with the network
attr user_defined:
 Returns a boolean value that indicates 1 (True) or 0 (False)
attr type:The a type of the respective network (default, unknown etc.)
attr shared:Returns a boolean value that returns whether or not the network is shared
attr default_network:
 The ID of the network associated with this network
attr gateway:The gateway associated with your network
attr subnets:Returns the range of IP addresses in the network
attr route_tables:
 Returns the route tables in this network
attr access_lists:
 Returns a list of associated security groups
attr network_interfaces:
 Returns a list of attached network interfaces
attr instances:Returns a list of attached instances
class DivvyResource.Resources.privatenetwork.PrivateNetwork(resource_id)

Bases: DivvyResource.Resources.toplevelresource.TopLevelResource

Private Network Operations

delete(user_resource_id=None)
Delete this resource. If wrapped in a with JobQueue() block, this will queue the deletion job to the wrapped queue, otherwise it
calls immediately.
get_cidr()

Retrieve the CIDR block of the network

static get_db_class()
get_gateway()

Retrieve the Internet gateway for the network

get_instances()

Retrieve a list of db objects for instances created within the network (if any)

get_ip_block_size()
get_network_gateways()

Retrieve a list of db objects for network gateways attached to the network (if any)

get_network_interfaces()

Retrieve a list of db objects for network interfaces that reside within the network

get_network_subnets()

Retrieve a list of db objects for network subnets created within the network (if any)

static get_provider_id_field()
get_resource_dependencies()

Retrieve the dependencies for a particular resources. This is an override of the parent function because we need to reverse the order on our resource lookups.

static get_resource_type()
get_security_groups()

Retrieve a list of db objects for security groups created within the network (if any)

get_supported_actions()
handle_resource_created(user_resource_id=None, project_resource_id=None)

This should be called when a resource is created/discovered after the basic data is added to the database. This gives an opportunity for post-addition hooks (assignment to projects/groups, alerts, etc)

handle_resource_destroyed(user_resource_id=None, project_resource_id=None)

This should be called when a resource is destroyed before the basic data is removed from the database. This gives an opportunity for pre-destruction hooks (removal from projects/groups, alerts, etc)

handle_resource_modified(resource, *args, **kwargs)

This should be called when a resource is modified after the new data has been updated in the DB session This gives an opportunity for post-modification hooks

private_network
private_network_id
top_level_resource = True