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
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
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
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
Revert "Fix the floatingip pollster"

This reverts commit 8057b66c0b7ac87863f175d850414bc0ed260ab2.

This is spamming the nova-api logs in tempest runs.

Change-Id: Iafe20bbab45bff62470374eba2a6e0e4fa3be611
Closes-Bug: #1328694
Merge "Remove low-value logging from publication codepath"
Remove unused logging in tests

For now, there are some logging objects defined in tests module, but
they are never used, this patch removes them.

Change-Id: Icb6666c377c34ca69d512aff8cba09f76a2e2057
Fix incorrect trait initialization

Currently, when we try to get trait, the api service uses storage
data to directly initialize the trait model. However, the trait class
init method expects value field as wsme.text type, while in storage,
it could be int, float, or datetime. So, end user will get 400 error
in such scenarios.

The static method _convert_storage_trait() in Event class can convert
a storage trait data to api trait object, we can use it to fix this
bug. Also, this method should be in Trait class instead of Event class,
This patch does this refactor too.

Change-Id: Ia7bf667967a31a3cc6e8d457f3b6330ffc728471
Closes-Bug: #1324523
Merge "Change using of limit argument in get_sample"
Merge "Update doc for sample config file issue"