Make Impl of mongodb and sqlalchemy consistent

SqlAlchemy connection inherits from base.Connection, which doesn't have session
parameter in its function get_resources(). And session of get_resources() in
SqlAlchemy is not used and it can be got from self.session. So remove it to make
them consistent.

Change-Id: I85d5094d53af3de40645fa828d73d1dbc2677f0b
Signed-off-by: Shane Wang <shane.wang@intel.com>
Merge "Make Impl of mongodb and sqlalchemy consistent"
Fix sqlalchemy for show_data and v1 web api

When sqlalchemy (e.g. mysql) is used for ceilometer, show_data.py and web api do
not work because some attributes and keys are different, such as meter/meters,
the patch is fix them and make both can work.

Change-Id: I4b827c3e6664213f1401b183ccbc3a1aaae872aa
Signed-off-by: Shane Wang <shane.wang@intel.com>
Implement /meters to make discovery "nicer" from the client

The point of this api is to make discovery (esp. from a casual user)
easier. So you don't really want to dump all the raw samples out
just to see what is there. So instead "ceilometer meter-list"
will GET /v1/meters (or /{proj|user|source}/{id}/meters) and
this will just return a description (name, type, resource, user, etc)
of the available meters, not each sample point. After this you will probably
go and look at the samples that you are actually interested in.

It is a kind of dynamic version of doc/source/measurements.rst

Change-Id: I58f2757874ab151632b6d87043d6327104c5b65c
Add test storage driver

Create a "test" storage driver to be used by the
API test code.

blueprint api-server-pecan-wsme

Change-Id: I99c7c82afa17ec5a9f36fd20d47b16011e64ffa9
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Move v1 API files into a subdirectory

Move all of the files for the v1 API together into a
single directory to make room for the v2 files.

blueprint api-server-pecan-wsme

Change-Id: Ic794581c677a0277924459ad8a34fd7daf2bc365
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Implement V2 API with Pecan and WSME

This changeset reimplements the API
using Pecan and WSME instead of Flask.

Pecan uses "object dispatch" instead of
declared routes. The controller classes
are chained together to implement the
API.  Most of what we have are simple
REST lookups, but a few cases required
custom methods.

WSME is used to define types of inputs
and outputs for each controller method.
The WSME layer handles serizlization and
deserialization in several formats. In
our case, only JSON and XML are
configured.

There are a few small changes to the
return types in the API, as well as to
error handling. Now all errors are
returned as JSON messages made up of a
mapping containing the key
'error_message' and the text of the
error. This will later be enhanced to
include XML support for XML requests.

This change also moves the script for
starting the V1 API to a new name and
replaces it with a script that starts
the V2 API. There is an open
bug/blueprint to fix that so both
versions of the API are loaded.

blueprint api-server-pecan-wsme

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Change-Id: I1b99a16de68f902370a8999eca073c56f9f14865
Start updating documentation for V2 API

Move the web API documentation into the 'webapi'
subdirectory to avoid conflicts with the auto-generated
'api' directory contents. Create a v2 doc file
as a placeholder until the automatic documentation
features of WSME are more complete.

blueprint api-server-pecan-wsme

Change-Id: Ide11ad0b4cebb29318b8bb977bc5165334e22a2c
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Remove debug print in V2 API

Remove the print statement in v2.py.

Change-Id: Id19d2424f382f0ae797af93c780bd849c67f9c4d
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Add sql db option to devstack for ceilometer

Ceilometer uses mongodb as the default storage.
This is one of the patches to support sql db option in devstack for
ceilometer, so users can easily choose and set up sql db environment
for ceilometer with 'stack.sh' by explicitly specifying the following
statement in localrc:

   use_database mysql

where mysql is taken as an example.

If users remove the above statement, mongodb is used and set up
by default.

This patch is for devstack to call dbsync to create ceilometer tables.

Change-Id: Idc9bffd0f389fa9760946b412c39210f60042d90
Signed-off-by: Shane Wang <shane.wang@intel.com>
Update documentation URL

This now points to docs.openstack.org

This fixes bug #1086652

Change-Id: Ic9cb1a7ebeb0bba062a427e8583e6a531af8039c
Signed-off-by: Julien Danjou <julien@danjou.info>
Merge "Update documentation URL"
Restore some metadata to the events and resources

Include "flattened" metadata about resources in queries
that ask for event and resource data.

Change-Id: Iddccc50cfb547f79d428507d42f55baf3c5e8998
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Change default os-username to 'ceilometer'

 'glance' is maybe not the best default value for os-username

Change-Id: I7f73e27a2f7a61bc06c6b7921c4b4dd37129dbaf
Change mysql schema from latin1 to utf8 .

fix bug #1086659

Change-Id: I599cf23f03ddec612b9f9c64fcb2c2558aaffba7
Move meter.py into collector directory

With multiple publisher support, metering becomes only one type of
publisher, thus move the meter.py into collector.

The publish.py should be moved to publisher directory as only meter
publisher in future.

Change-Id: I3b4f5dac3cd46c77dc077ff6acbba79284640428
Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
Merge "Restore some metadata to the events and resources"
Virt inspector directly layered over hypervisor API

Addresses BP nova-independent-virt

Add the concept of a pluggable virt inspector that allows
polling of the hypervisor layer without relying on any
nova internals.

Note that the test-requires dependency on the nova master
tarball remains in place for the moment, as it's required
by the nova notifier tests.

Also we must leave the dependency on the libvirt-python
RPM or python-libvirt Debian package to the distros which
end up packaging ceilometer.

Change-Id: I20700320dd7e3196507173c780ab598b479e4021
Merge "Move meter.py into collector directory"
Merge "Change mysql schema from latin1 to utf8 ."