fix help message of deprecated command

Adds command name instead of deprecated command to help message.

Change-Id: Ib6cbbcd24bbf015cf3656be9cbdf7de25d4d9cf7
Fix the ceilometer trait-description-list command

command ceilometer trait-description-list is unavailable.

Change-Id: Ib6d03b11194d6a0bef190c815d948649ada6c260
Closes-Bug: #1284548
Add complex query support for samples

Change-Id: I88c4eb6fa32514100187dbbca9777c7a5974fac6
Deprecate 'alarm-update'

Like deprecating alarm-create, we can use alarm-threshold-update and
alarm-combination-update instead of alarm-update.
So, mark alarm-update as 'Deprecated'.

Change-Id: I8c9718d76e40729dc6094611a055c904e27619ba
Checking the type of auth_token, and fixing it if necessary

When creating a new Client object by calling the get_client function,
if the ceilometer_url is not passed as a parameter, but the token is
passed, the auth_token is converted to a lambda function.
However, when both the ceilometer_url and the auth_token are passed,
this conversion does not take place.
This fix checks if the auth_token is a lambda function or not.
If it is not, it creates a new lambda function which returns the
token.
Without this check, if a token was passed as a string, the
python client would throw and error, when trying to call
self.auth_token() in ceilomenterclient/common/http.py.

Change-Id: I3e564fcf17ce497546b75f0ab8c7ca0f6f2099df
Closes-Bug: #1254186
Add complex query support for alarms

Change-Id: I3305d679d128562f7794a5cf460093981a601f7c
Add complex query support for alarm history

Change-Id: Ie41d9a0be73a525ae105262fb5859960bf9f9df6
Fix temporary pypy gate issue with setuptools

Adding a fix proposed in https://bugs.launchpad.net/openstack-ci/+bug/1290562
to avoid continuous gate failures because of setuptools issue reported in the
bug linked above.

Temporary Fixes-bug: #1290562

Change-Id: Id7ff477c4168f42bee2c3c9a8fc70ff7953bf10a
Merge "Add complex query support for samples"
Merge "Checking the type of auth_token, and fixing it if necessary"
Merge "fix help message of deprecated command"
Merge "Deprecate 'alarm-update'"
Updated from global requirements

Change-Id: I2232c0c00179dd604dbe789b72ce721ded7c5622
Merge "Add complex query support for alarms"
Merge "Add complex query support for alarm history"
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=constraint1;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,
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 |
+----------+----------------------------+--------------------------------------------------------------------------------+

Change-Id: I3953276537b4526e46e5e6d229d6fa154f8ab0fc
Closes-Bug: #1288246
Merge "Adds alarm time constraint support to ceilometer CLI"
Implementation of statistics aggregators

This corresponds to do API calls on:
/v2/meters/meter-name/statistics?aggregate.func=func-name

Usage:
aggregates = [{'func': 'cardinality', 'param': 'resource_id'}])
client.statistics.list(meter_name="instance", aggregates=aggregates)

CLI:
ceilometer statistics -m instance -a "cardinality<-resource_id"

Change-Id: I0096668585a5c7e7985973f07049eb91f44413fe
Statistics groupby handling improvement

The groupby parameter for statistics now handle single string as a
parameter. It fixes the bug where every characters of the string where
interpreted as a groupby value.

Change-Id: Ia763741d7ad5717be381b0ac2f0acb57e9f46cac
Closes-Bug: #1291935
Ensure statistics aggregates are ordered with parameterized first

Fixes bug 1298528

Due to WSME re-ordering of query parameters, in the mixed case
any parameterized aggregates must be specified in the URL first,
prior to any unparameterized aggregates.

Otherwise the aggregate parameter will be associated with the
wrong aggregate function.

Change-Id: Ib2c76d03a4fc91d13074a03caade2c776d2309b3