def __init__(self, namespace, region_name='us-east-1', dimensions={}, alarms={}, actions={}, **kwargs): Emitter.__init__(self) self.namespace = namespace self.conn = connect_to_region(region_name, **kwargs) # Set our dimensions, including instance ID self.dims = dimensions or {} self.setInstanceId() # Make sure our actions exist... self.actions = {} # Store our AWS credential args for later self.kwargs = kwargs self.updateActions(actions) # Now update our alarms self.updateAlarms(alarms)
def __init__(self, namespace, region_name=None, dimensions={}, alarms={}, actions={}, **kwargs): Emitter.__init__(self) if not region_name: region_name = get_instance_metadata()['placement']['availability-zone'][:-1] self.namespace = namespace self.conn = connect_to_region(region_name, **kwargs) # Set our dimensions, including instance ID self.dims = dimensions or {} self.setInstanceId() # Make sure our actions exist... self.actions = {} # Store our AWS credential args for later self.kwargs = kwargs self.updateActions(actions) # Now update our alarms self.updateAlarms(alarms)
def __init__(self, namespace, region_name=None, dimensions={}, alarms={}, actions={}, **kwargs): Emitter.__init__(self) if not region_name: region_name = get_instance_metadata( )['placement']['availability-zone'][:-1] self.namespace = namespace self.conn = connect_to_region(region_name, **kwargs) # Set our dimensions, including instance ID self.dims = dimensions or {} self.setInstanceId() # Make sure our actions exist... self.actions = {} # Store our AWS credential args for later self.kwargs = kwargs self.updateActions(actions) # Now update our alarms self.updateAlarms(alarms)