Ceilometer/blueprints/alarm-over-time

Summary
The idea is to create a new kind of alarm rule on the API part, and a new alarm evaluator that change state and trigger alarms actions over the time.

Combining this kind alarm with an other alarm will allow to cover the following use cases.

User stories

 * I don't want to receive the alarm callback during a certain time lapse.
 * I want to trigger a alarm action every three hours if an other alarm have a particular state.

API v2 extension proposition
{   name: AlarmOverTime, type: time, description: Change at , time_rule: { time_spec: "Mon-Fri 00:08", duration: 43200 },   ... }

time_spec format is when we needs to change the state to alarm and duration (in seconds) is the time we keep the alarm state in alarm

Evaluator behavior
The alarm above will set the alarm state to 'alarm' every working day since 8pm during 12 hours.

The alarm actions are called on each state change.

Other example:

time_rule: { time_spec: "1/3:00", duration: 0 }

The alarm above will set the alarm state to 'alarm' every 3 hours for 0 seconds.

In reality for less time as possible, ie: the alarm evaluation_interval, because the alarm need to be reevaluate to change back to state 'ok'.

This behavior permit to combinate this kind of alarm with an other one to trigger some actions every 3 hours if the other alarm state in 'alarm' too.

time spec format
time_spec format is the same as systemd calendar format

some examples extracted systemd documentation:

Sat,Thu,Mon-Wed,Sat-Sun → Mon-Thu,Sat,Sun *-*-* 00:00:00 Mon,Sun 12-*-* 2,1:23 → Mon,Sun 2012-*-* 01,02:23:00 Wed *-1 → Wed *-*-01 00:00:00 Wed-Wed,Wed *-1 → Wed *-*-01 00:00:00 Wed, 17:48 → Wed *-*-* 17:48:00 Wed-Sat,Tue 12-10-15 1:2:3 → Tue-Sat 2012-10-15 01:02:03 *-*-7 0:0:0 → *-*-07 00:00:00                    10-15 → *-10-15 00:00:00       monday *-12-* 17:00 → Mon *-12-* 17:00:00 Mon,Fri *-*-3,1,2 *:30:45 → Mon,Fri *-*-01,02,03 *:30:45 12,14,13,12:20,10,30 → *-*-* 12,13,14:10,20,30:00 mon,fri *-1/2-1,3 *:30:45 → Mon,Fri *-01/2-01,03 *:30:45 03-05 08:05:40 → *-03-05 08:05:40                 08:05:40 → *-*-* 08:05:40                     05:40 → *-*-* 05:40:00    Sat,Sun 12-05 08:05:40 → Sat,Sun *-12-05 08:05:40 Sat,Sun 08:05:40 → Sat,Sun *-*-* 08:05:40 2003-03-05 05:40 → 2003-03-05 05:40:00               2003-03-05 → 2003-03-05 00:00:00                     03-05 → *-03-05 00:00:00                    hourly → *-*-* *:00:00 daily → *-*-* 00:00:00 monthly → *-*-01 00:00:00 weekly → Mon *-*-* 00:00:00 *:2/3 → *-*-* *:02/3:00

Additional thinking
It would be cool in ceilometer to create a wsme type for 'duration' that convert time unit to seconds