- """Send a notifcation repsonse message to the SO."""
- # Initialiase configuration and authentication for response message
- config = Config.instance()
- config.read_environ("aodh")
- self._alarming = Alarming()
- self._common = Common()
- self._response = OpenStack_Response()
- self._producer = KafkaProducer('alarm_response')
-
- alarm_id = values['alarm_id']
- auth_token = self._common._authenticate()
- endpoint = self._common.get_endpoint("alarming")
-
- # If authenticated generate and send response message
- if (auth_token is not None and endpoint is not None):
- url = "{}/v2/alarms/%s".format(endpoint) % alarm_id
-
- # Get the resource_id of the triggered alarm
- result = self._common._perform_request(
- url, auth_token, req_type="get")
- alarm_details = json.loads(result.text)
- gnocchi_rule = alarm_details['gnocchi_resources_threshold_rule']
- resource_id = gnocchi_rule['resource_id']