Availability Zones

Availability zones represent a data center where cloud resources are located. Resources such as subnets, volumes, instances and more are typically scoped to a particular availability zone. This class inherits from Resource and has direct access to the resource’s database object. The following attributes are directly accessible:

attr organization_service_id:
 The ID of the parent organization service (cloud)
attr name:The name of the availability zone
attr region_name:
 The region where the availability zone is associated
attr service_type:
 The type of service this zone supports
attr state:The health of the availability zone
class DivvyResource.Resources.availabilityzone.AvailabilityZone(resource_id)

Bases: DivvyResource.Resources.resource.Resource

Description of an availability zone

availability_zone
static get_db_class()
get_db_pk()
get_db_pk_criteria()

Most (but not all) resources are associated with a Database Object from DivvyDB.DbObjects. If they are, this returns the criteria for the primary key data appropriate for passing to query.filter().

Implementing this allows for bulk load of this object type of the database which can drastically increase API efficiency.

classmethod get_db_resource_id_field()

Form a query field construct that will return the resource id of this resource in string form :return: Field construct that will retrieve the resource id of this resource :rtype:

get_parent_resource_id()

Retrieve the parent resource ID of this resource.

static get_resource_type()
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(old_resource_data, user_resource_id=None)