This switch can be specified multiple times in the case of
multiple time constraints.
With update commands, time constraints are updated by name,
e.g. --time-constraint name=constraint1;duration=500 updates
the constraint 'constraint1' with a new duration 500.
Time constraints can be removed with update commands using the
switch --remove-time-constraint=constraint1,constraint2 .
Example of display outputs:
> ceilometer alarm-list
+--------------------------------------+-------+-------------------+---------+------------+----------------------------+--------------------------------------------------------------+
| Alarm ID | Name | State | Enabled | Continuous | Alarm condition | Time constraints |
+--------------------------------------+-------+-------------------+---------+------------+----------------------------+--------------------------------------------------------------+
| 2ead776d-2fc7-47a2-b0bb-0f88dcefa457 | test2 | insufficient data | True | False | cpu == 50.0 during 1 x 60s | cons1 at 0 11 * * * for 300s, cons2 at 0 23 * * * for 600s |
+--------------------------------------+-------+-------------------+---------+------------+----------------------------+--------------------------------------------------------------+
> ceilometer alarm-show -a
+---------------------------+-----------------------------------------------------------------------+
| Property | Value |
+---------------------------+-----------------------------------------------------------------------+
| alarm_actions | [] |
| alarm_id | 2ead776d-2fc7-47a2-b0bb-0f88dcefa457 |
| comparison_operator | eq |
| description | Alarm when cpu is eq a avg of 50.0 over 60 seconds |
| enabled | True |
| evaluation_periods | 1 |
| exclude_outliers | False |
| insufficient_data_actions | [] |
| meter_name | cpu |
| name | test2 |
| ok_actions | [] |
| period | 60 |
| project_id | 962f75ad22c24cbf99d40d7b82718505 |
| query | |
| repeat_actions | False |
| state | insufficient data |
| statistic | avg |
| threshold | 50.0 |
| time_constraints | [{name: cons1, |
| | description: Time constraint at 0 11 * * * lasting for 300 seconds, |
| | start: 0 11 * * *, |
| | duration: 300}, |
| | {name: cons2, |
| | description: Time constraint at 0 23 * * * lasting for 600 seconds, |
| | start: 0 23 * * *, |
| | duration: 600}] |
| type | threshold |
| user_id | 76f335df8e2f4c7e9e8185e26ea85759 |
+---------------------------+-----------------------------------------------------------------------+
> ceilometer alarm-history -a 2ead776d-2fc7-47a2-b0bb-0f88dcefa457
+----------+----------------------------+--------------------------------------------------------------------------------+
| Type | Timestamp | Detail |
+----------+----------------------------+--------------------------------------------------------------------------------+
| creation | 2014-03-06T07:41:35.362050 | name: test2 |
| | | description: Alarm when cpu is eq a avg of 50.0 over 60 seconds |
| | | type: threshold |
| | | rule: cpu == 50.0 during 1 x 60s |
| | | time_constraints: cons1 at 0 11 * * * for 300s, cons2 at 0 23 * * * for 600s |
+----------+----------------------------+--------------------------------------------------------------------------------+
Reviewed: https:/ /review. openstack. org/78356 /git.openstack. org/cgit/ openstack/ python- ceilometerclien t/commit/ ?id=7146571b702 579fa1367598ab2 78ca2f8ec1e156
Committed: https:/
Submitter: Jenkins
Branch: master
commit 7146571b702579f a1367598ab278ca 2f8ec1e156
Author: Uros Jovanovic <email address hidden>
Date: Wed Mar 5 18:49:14 2014 +0000
Adds alarm time constraint support to ceilometer CLI
Time constraints can be specified for create and update
families of commands with the following format:
--time- constraint name=constraint 1;start= '0 11 * * *';duration=300
This switch can be specified multiple times in the case of
multiple time constraints.
With update commands, time constraints are updated by name, 1;duration= 500 updates
e.g. --time-constraint name=constraint
the constraint 'constraint1' with a new duration 500.
Time constraints can be removed with update commands using the time-constraint =constraint1, constraint2 .
switch --remove-
Example of display outputs:
> ceilometer alarm-list ------- ------- ------- ------- ------- -+----- --+---- ------- ------- -+----- ----+-- ------- ---+--- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- ------- ------- ------- ----+ ------- ------- ------- ------- ------- -+----- --+---- ------- ------- -+----- ----+-- ------- ---+--- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- ------- ------- ------- ----+ 2fc7-47a2- b0bb-0f88dcefa4 57 | test2 | insufficient data | True | False | cpu == 50.0 during 1 x 60s | cons1 at 0 11 * * * for 300s, cons2 at 0 23 * * * for 600s | ------- ------- ------- ------- ------- -+----- --+---- ------- ------- -+----- ----+-- ------- ---+--- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- ------- ------- ------- ----+
+--
| Alarm ID | Name | State | Enabled | Continuous | Alarm condition | Time constraints |
+--
| 2ead776d-
+--
> ceilometer alarm-show -a ------- ------- ------- ----+-- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ ------- ------- ------- ----+-- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ 2fc7-47a2- b0bb-0f88dcefa4 57 | data_actions | [] | f99d40d7b827185 05 | e9e8185e26ea857 59 | ------- ------- ------- ----+-- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+
+--
| Property | Value |
+--
| alarm_actions | [] |
| alarm_id | 2ead776d-
| comparison_operator | eq |
| description | Alarm when cpu is eq a avg of 50.0 over 60 seconds |
| enabled | True |
| evaluation_periods | 1 |
| exclude_outliers | False |
| insufficient_
| meter_name | cpu |
| name | test2 |
| ok_actions | [] |
| period | 60 |
| project_id | 962f75ad22c24cb
| query | |
| repeat_actions | False |
| state | insufficient data |
| statistic | avg |
| threshold | 50.0 |
| time_constraints | [{name: cons1, |
| | description: Time constraint at 0 11 * * * lasting for 300 seconds, |
| | start: 0 11 * * *, |
| | duration: 300}, |
| | {name: cons2, |
| | description: Time constraint at 0 23 * * * lasting for 600 seconds, |
| | start: 0 23 * * *, |
| | duration: 600}] |
| type | threshold |
| user_id | 76f335df8e2f4c7
+--
> ceilometer alarm-history -a 2ead776d- 2fc7-47a2- b0bb-0f88dcefa4 57 ------- -+----- ------- ------- ------- --+---- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ ------- -+----- ------- ------- ------- --+---- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ 06T07:41: 35.362050 | name: test2 | ------- -+----- ------- ------- ------- --+---- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+
+--
| Type | Timestamp | Detail |
+--
| creation | 2014-03-
| | | description: Alarm when cpu is eq a avg of 50.0 over 60 seconds |
| | | type: threshold |
| | | rule: cpu == 50.0 during 1 x 60s |
| | | time_constraints: cons1 at 0 11 * * * for 300s, cons2 at 0 23 * * * for 600s |
+--
Change-Id: I3953276537b452 6e46e5e6d229d6f a154f8ab0fc
Closes-Bug: #1288246