File based publisher

Ceilometer logs metering data into a database by default. In some cases
it is ideal to have the metering data go into a file which can be
examined easily. This patch adds the file based publisher. One can
make changes to pipeline.yaml file to add the file publisher to
an existing pipeline or a new pipeline so that metering data can not
only be saved in database but also can be saved in a file.

The following example shows how it can be configured in pipeline.

    -
        name: meter_file
        interval: 600
        counters:
            - "*"
        transformers:
        publishers:
            - file:///tmp/meters?max_bytes=10000000&backup_count=5

With the above configuration, a set of files named meters can be
found in the /tmp directory. The file names should be meters, meters.1,
meters.2 etc. These files will contain the metering data. Since the
implementation uses rotating log file when max_bytes and backup_count
are specified, one can increase the backup_count and max_bytes to keep
the file for a longer period or use the path to point the file to a
desired location. If no file path specified, the publisher will log an
error and not record any metering data.

Change-Id: If85ad95f837b2d178527eb7de16707f8af2c4ce2
Imported Translations from Transifex

Change-Id: I9b45b4e74f7993d5ad962bdeb9bc35bfa8444841
Implement a basic REST alarm notification

This change adds schemes http:// to the alarm notifier.

The URL is called as a POST request.
The body of request contains a json dictionnary with alarm state and the
reason.

Change-Id: I0dbdd6afdef1a88602c9fbc55d651d3d8f6ad3e0
Blueprint: alarm-notifier
Allow to enable time to live on metering sample

The collector start the metering sample cleanup
process every 'database_clear_expired_data_interval' seconds to
remove sample according the 'database_time_to_live'

If the backend support ttl natively (mongodb >= 2.2), the cleanup
function in the backend is just a dump, and the backend handles the TTL
itself.

If the backend doesn't support ttl at all, it will raise a
NotImplementedException caught by collector to fill the log correctly.

Blueprint: db-ttl

Change-Id: I869ce6f50065d0ae8d7095a260efbfcd33165eef
Added alembic migrations

Added alembic dependency to requirements
Created alembic config files

To create alembic migration:
$ cd ./ceilometer/storage/sqlalchemy/alembic
$ alembic revision -m "migration_description"

Related to blueprint convert-to-alembic

Change-Id: I59cf409106e0ba8bb819f7fc6aeddd0a837fee4c
Merge "Imported Translations from Transifex"
Disable mongod prealloc, wait for it to start

No prealloc should make mongod starts faster, and the while loop will
wait it is listening before running the tests.

Change-Id: Ia2ff201c0cfa882aa00bb7ce8ce990525f18339e
Merge "Implement a basic REST alarm notification"
Merge "File based publisher"
Merge "Allow to enable time to live on metering sample"
make publisher procedure call configurable

allow configurable publisher to cast to procedure other than
record_metering_data

Change-Id: I69d0ba99b4f31b293e4d372dd85b663bc60042ff
Merge "Disable mongod prealloc, wait for it to start"
Merge "Added alembic migrations"
Fix the argument of UnknownArgument exception

This change sets the real UnknownArgument instead of the last
valid one in the exception raised by the API.

Fixes bug #1201839

Change-Id: I22e1dadbe9a90e03e8ccfbcc6e0e8dc3f17c5a3e
api: build the storage connection once and for all

Fixes: bug#1178845

Change-Id: Ic0c639224ba87c3e11f3e1eeba4915e3c8ba0e88
Merge "make publisher procedure call configurable"
doc: add a bunch of functional examples for the API

Change-Id: I364208c87e450e7cb0443774e80916845dbfb32a
Add index for db.meter by descending timestamp

Fixes bug #1193906

Added an index for db.meter to sort by descending time stamp for class
Connection in ceilometer/storage/impl_mongodb.py

ensure_index() is used rather than create_index() to be more efficient.

This index is needed because get_samples() in
ceilometer/storage/impl_mongodb.py sorts by descending timestamp.  Without an
index, MongoDB will fail to sort if the database is too large.

Change-Id: I23070f153ce03a8d6d8c9f17f05e2d5dae38647e
Merge "doc: add a bunch of functional examples for the API"
Merge "Fix the argument of UnknownArgument exception"