Fix project authorization check

Currently, project authorization check in _verify_query_segregation
only checks query field 'project_id', so normal user can pass the check
with query field 'project'. And the check also checks query operator, which
seems not right, because user will get 401 when project is his own but with
wrong operator, 400 wrong operator can be more precise.

This patch adds project field check and remove the operator check which can
be done in _validate_query.

Change-Id: I82439e4c02afd04d26ab5d419ef67bde1f4aa1ca
Closes-Bug: #1322111
Synced jsonutils from oslo-incubator

The sync includes change that makes sure we get unicode-only dicts from
jsonutils no matter which json module implementation is selected.

The latest commit in oslo-incubator:
- 0f4586c0076183c6356eec682c8a593648125abd

Change-Id: Ic815ca3df94c33edec9104172048b2cd94b92e3f
Closes-Bug: 1314129
use LOG instead of logger as name for the Logger object

Change-Id: I2997a33b1039dd4ab4b28b16f87d200bec9bfad7
Corrects a flaw in the treatment of swift endpoints

When keystone has a registered swift endpoint of which the url does not start
with '/v1', the object-store pollster is not able to use it correctly.
This commit fixes it's behaviour to provide more flexibility in endpoint urls.

Change-Id: I579b1cf450f16853ac49f1d248a64a179e6443d9
Closes-Bug: #1325591
Update doc for sample config file issue

Since we have removed the ceilometer.conf.sample file, we should
update the documentation too.

Change-Id: I93ff8bf2f3332d15495d45a5e55e6252da639302
Closes-Bug: #1320761
Use TYPE_GAUGE rather than TYPE_CUMULATIVE

For hardware network bandwidth metering, it uses TYPE_CUMULATIVE, but
the oid "1.3.6.1.2.1.2.2.1.5"(in file ceilometer/hardware/inspector/snmp.py)
it walks in net-snmp.org is representing ifSpeed and the type is GAUGE.

Cumulative definition: Increasing over time, but when i run
`ceilometer sample-list --meter hardware.network.bandwidth.bytes`
the output is not increasing over time.

reference:
http://docs.openstack.org/developer/ceilometer/measurements.html
http://www.net-snmp.org/docs/mibs/interfaces.html

Change-Id: Ic8a8280695c25db103fe4e4592fe00622728655d
Closes-Bug: #1326723
Fix ceilometer.alarm.notifier.trust import

Import ceilometer.alarm.notifier.rest instead of
ceilometer.alarm.notifier to be able to use the rest module.

Change-Id: I82eea5c2f3ec0a8c5f33307d41df45111788c50f
Closes-Bug: #1327818
Change using of limit argument in get_sample

Use 'limit' as argument in scan method instead of self written approach.

Change-Id: I2576b3bf3bb210ba0f21391766e62e19c23b21a0
Update Measurement Docs for LBaaS

Partially Implements: blueprint ceilometer-meter-lbaas

Change-Id: I3f2c0590ef665405c15b7c01523003af7042538b
Respect $TMPDIR environment variable to run tests

On Fedora 20, /tmp now uses the tmpfs file system which means that all
files are stored in memory. Running Ceilometer tests write 1.2 GB in
/tmp.

This patch allows to set the TMPDIR environment variable to run tests in
a different temporary directoy. So I can use a directory on disk to not
use all my memory.

Change-Id: Ib87a988a4acb3cb568d3f3dda641f5a824f986da
Skipping central agent pollster when keystone not available

When keystone is not available, instead of skipping all central agent
pollsters, we should let the pollsters decide whether to skip or not,
because not all central agent pollsters requires keystone.

Closes-Bug: #1316532

Change-Id: Ib34f9838bd128e1b357937f0c177d8a09f19b13f
[HBase] Implement events on HBase

In this change events are written into HBase and read from it.

For this purpose were implemented several methods:
1. record_events --- store events into HBase
2. get_events, get_event_types, get_trait_types and get_traits --- get events
from db.

Add new filters in mock HBase part, that were used in new methods.

Change-Id: I787eeaf998c36a6829f17f0c6ea27b786979edd1
Implements: blueprint hbase-events-feature
Adds caches for image and flavor in compute agent

Currently to obtain image and flavor data,
compute agent always calls nova api, even for the same id of image/flavor.
In order to reduce the number of nova-client call, caches for image and flavor
are introduced.

The caches only live in a local scope of _with_flavor_and_image: created every
single polling interval and thrown away at the end of the interval.
Although the caches only live in a short time, they are effective because same
flavors are used many times in one compute-node in typical use cases.

Change-Id: I63b6a59f06be4911f39073e34cfc3a2a7b832c51
Closes-bug: #1293337
Merge "Update Measurement Docs for LBaaS"
Merge "[HBase] Implement events on HBase"
Merge "Skipping central agent pollster when keystone not available"
Adding alarm list filtering by state and meter

Adding alarm list filtering by state for SQLAlchemy, PyMongo and
HBase drivers
Adding alarm list filtering by meter only for SQLAlchemy and PyMongo
drivers.

Closes-Bug: #1224298

Change-Id: I393e2988142878d33363438671c240199ede65a4
Fix the meter type for LB Bytes

This fixes the type on bytes in/out to cumulative.
Eventually when connections are fixed in LBaaS side,
those would be cumulative too. Also update the
measurement docs to reflect the newest changes.

Closes-Bug: 1328573

Change-Id: Iab221829702ab36a844d0ae65c6a3312a311a92b
Fix LBaaS connection meter docs

Change-Id: Ib775093929ab3ac076a498e7f3413a3d21c96e42
Closes-Bug: 1328590
Remove low-value logging from publication codepath

Previously, the pipeline publish codepath emitted log messages
with almost no diagnostic value other than a "comfort bump".
However the sheer volume of these message was overwhelming
logstash in the CI gate.

We remove the worst offenders from that codepath.

Change-Id: If630593e8f755ccc1ede16941459daac30d284ff
Closes-Bug: #1328596