Service Alarms

A cloud provider alarm within an organization service. An example of this would be AWS CloudWatch alarms. 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 alarm_id:The ID of the alarm
attr region_name:
 The region that the service alarm resides in
attr name:The name of the alarm
attr provider_resource_id:
 The ARN for the account where this alarm resides
attr description:
 An optional description for the alarm
attr namespace:The namespace (container for CloudWatch metrics) of the alarm
attr metric_name:
 The name of the metric this alarm checks for
attr threshold:User defined threshold for alarm
attr evaluation_periods:
 How many times this data will be evaluated before arriving at conclusion for alarm
attr state_value:
 Type of alarm (eg: Insufficient Data or Alarm)
attr state_reason:
 The reason for the alarm
attr state_reason_data:
 Returns insightful data of the alarm
class DivvyResource.Resources.servicealarm.ServiceAlarm(resource_id)

Bases: DivvyResource.Resources.toplevelresource.TopLevelResource

ServiceAlarm Operations

static get_db_class()
static get_provider_id_field()
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 groups, alerts, etc).


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.

top_level_resource = True