@@ -395,4 +395,11 @@ When creating/updating alerts, the following steps are performed (in the specifi
8) the Kapacitor topic is named after the Kapacitor task (they share the same identifier)
9) register all URLs as Kapacitor HTTP handlers for the created Kapacitor topic
10) the Kapacitor handler identifier is generated as a hash of the concatenated sfc, sfc instance, policy and trigger identifiers with the handler URL
11) return a response which contains the errors (if any) that were encountered while interacting with Kapacitor (e.g. if an alert already exist)
11) fill in the Kapacitor templates and forward to the Kapacitor HTTP API
12) return a response which contains the errors (if any) that were encountered while interacting with Kapacitor (e.g. if an alert already exist)
Something that is not mentioned in the steps above is the generation of the SFEMC handler URL, that is every time the alerts configuration document references **flame_sfemc** as an alert handler. SFEMC expects a POST request for a given alert to a URL in the following format:
`http://<sfemc fqdn>:<sfemc port number>/<sfc identifier>/<policy identifier>/<trigger identifier>`
However, policy and trigger identifiers are the identifiers included in the TOSCA resource specification document since this is the only deployment information that the SFEMC knows (SFEMC doesn't know anything about the CLMC alert management). This is why we have the restriction that **policy identifiers that reference flame_sfemc from the alerts configuration document must match with StateChange policy identifiers from the resource specification document**. Thus, we ensure that the policy identifier in the generated URL is what SFEMC expects. For the trigger identifiers, we ensure that **a trigger name that references flame_sfemc in the alerts configuration must match with an identifier from a `clmc::<trigger name>` constraint from the resource specification document**. Thus, the SFEMC URL is consistently generated with what SFEMC expects as a request URL. The SFC identifier is extracted from the metadata section of the alerts configuration.