Shayne Jonas
Shayne Jonas

Reputation: 55

How does Heat set alarm configuration and get alarm back from Ceilometer?

I really need your helps. Currently, I am working on Heat auto-scaling. I already learnt some documents about auto-scaling in Heat. I know that Heat uses Ceilometer API to set alarm configuration and get alarm back from Ceilometer via Webhook. These actions are shown in HOT template (OS::Heat::Ceilometer::Alarm). I tried to look at Heat code but I still cannot find where (what modules) handle alarm actions. In particularly, what module will be responsible for creating alarm url and what module will receive and handle alarm url triggered from Ceilometer.

Thanks

Upvotes: 0

Views: 229

Answers (1)

findmyway
findmyway

Reputation: 66

for creating alarm url:

you should see the method _get_ec2_signed_url

alarm url triggered:

It's a singal in heat-cfg service. you can find more code(Liberty) in

heat/api/cfn/v1/__init__.py

mapper.connect('/signal/{arn:.*}',
               controller=signal_controller,
               action='signal',
               conditions=dict(method=['POST']))

and heat/api/cfn/v1/signal.py

def signal(self, req, arn, body=None):
    con = req.context
    identity = identifier.ResourceIdentifier.from_arn(arn)
    try:
        self.rpc_client.resource_signal(
            con,
            stack_identity=dict(identity.stack()),
            resource_name=identity.resource_name,
            details=body)
    except Exception as ex:
        return exception.map_remote_error(ex)

then you can follow the call chain to find what you want

Upvotes: 0

Related Questions