Load Balancer

Load balancers are used in multi-tier apps to distribute load across a variety of compute instances. This class inherits from TopLevelResource and has direct access to the resource’s database object. The following attributes are directly accessible:

attr resource_id:
 The primary resource identifier that takes the form of a prefix followed by numbers and letters
attr organization_service_id:
 The ID of the parent organization service (cloud)
attr region_name:
 The region that the instance resides in
attr load_balancer_id:
 The provider ID of the load balancer
attr name:The name of the load balancer
attr lb_type:The type of load balancer (eg: Application, Classic, Network)
attr created_time:
 The time the resource was created
attr fqdn:The fully qualified domain name of the load balancer
attr scheme:Denotes whether or not the load balancer is public facing
attr arn:The ARN associated with this load balancer
attr attributes:
 
attr networks:Returns a list of associated networks
attr subnets:Returns a list of subnets associated with this load balancer
attr instances:Returns a list of instances associated with this load balancer
attr access_lists:
 Returns a list of associated security groups
class DivvyResource.Resources.loadbalancer.LoadBalancer(resource_id)

Bases: DivvyResource.Resources.toplevelresource.TopLevelResource

LoadBalancer 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.

Apply the query filters that will restrict a provided query to the provided global search string and return the modified query.

Parameters:
  • query (sqlalchemy.orm.query) – Original query that includes this resource type
  • search_string (basestring) – Single string to search for across all important text fields for this resource
Returns:

Modified query including filters that match search string

Return type:

sqlalchemy.orm.query

get_date_created()

Retrieve the time from the provider that this resource was created (if available).

static get_db_class()
static get_provider_id_field()
static get_resource_type()
get_supported_actions()

Retrieve all the actions which are supported by this resource.

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 groups, alerts, etc)

handle_resource_destroyed(user_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 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

load_balancer_id
loadbalancer
top_level_resource = True