Add support for listing claimed messages (transport)

This patch adds a query parameter, "include_claimed", to
the GET messages operation, to allow the caller to specify
whether it wants to include claimed messages in the
listing (as opposed to the default of only listing active
messages).

Change-Id: Ie0ee4a435420fbc3c94a339836853a49b4196460
Fixes: bug #1202430
Update tests to reflect queue metadata changes

This patch updates the system tests to align with the changes in the
create queue endpoint. This also adds tests for the new queue/metadata
endpoint.

Change-Id: I2654b531952f4a87031082dd7bd686448e6739fb
Tests: blueprint metadata-resource
feat(api): GET and HEAD methods on queue

To allow

    GET/HEAD /queues/a-queue

gives users an intuitive approach to test whether the queue exits,
while the URI above is returned as the Location header by a queue's
PUT method.

Implements: blueprint queue-get-and-head
Fixes: bug #1207075

Change-Id: Iefd3236a739b1a5d959efb489fc2b966ee893599
Merge "Update tests to reflect queue metadata changes"
Test for bulk delete of messages

This patch adds the test for bulk delete of messages.

Change-Id: I9dc230661cd79e59e066b156eb5334a69826442c
Tests: blueprint message-bulk-delete
Use queue's name and project to get messages

Mongodb's driver currently queries the queue's collection to get queue
id and then filter messages with it. Instead of storing the id, this
patches stores the queue name and the project in the message collection
and use that for querying messages.

It's safe to assume that the queue exists when messages are returned by
the query, however, posts operation will still verify queue's existence.

Fixes bug: #1207018

Change-Id: Iaa7bc3f1300b3349a5cfad5a9f6ecabb2f75e95e
Don't check for active messages

Instead of counting to check whether there are active messages, try to
fetch ids right away and use len on the result. This removes 1 query
from the claim process.

Fixes bug: #1207759

Change-Id: I579d09ed026d0889ded2463d4807154c8259109d
Merge "feat(api): GET and HEAD methods on queue"
Merge "Test for bulk delete of messages"
Merge "Use queue's name and project to get messages"
Merge "Don't check for active messages"
Merge "Add support for listing claimed messages (transport)"
feat(transport): place request size limit for JSON

To not deserialize over-sized requests with content body,
we also need transport-specific size restrictions.  They are
come before input validation, and are also configurable.

Change-Id: I06434431b3df9250c05472b4d91a53dfedb682d2
Update oslo-incubator requirements

The patch pulls in the latest versions of Oslo's modules being used by
Marconi. The main reason triggering this update is local.py not
depending on eventlet anymore.

Change-Id: Icec75a8e220e81de2ea183a95d1bbe0cded4fcb8
Add Tests for GET/HEAD queue

This patch adds tests for the new API endpoint for GET/HEAD queue.

Change-Id: Ife61b838ccc518f11e443a4daeddec650c956d6b
Tests: blueprint queue-get-and-head
feat(wsgi): claim creation returns 201

The API used to return 200, but 201 seems to be a better choice
for an action with modification.

Change-Id: I392d3e8fa821c7c1ace549187af4c6ca18457e09
Fixes: bug #1210301
Merge "Add Tests for GET/HEAD queue"
Merge "feat(wsgi): claim creation returns 201"
Merge "Update oslo-incubator requirements"
Add "total", "oldest" and "newest" to queue stats

This patch introduces three new queue stats in order to expose
a better user experience via control panels. Also included in
the changes is a bug fix for calculating timestamp differences,
as well as a renaming of 'queue' to 'queue_name' for consistency
within the MongoDB driver.

Note that there are several remaining stats identified in the
associated blueprint. This may be addressed in a future
patch.

Implements: blueprint extra-queue-stats
Change-Id: I31e48a581ccdd014ec97674af0c0dd43c808c42c