api: add support for timestamp in _list_resources()

Change-Id: I683bcbc2072b782eb94739aaa99e151ee9d0df3e
Signed-off-by: Julien Danjou <julien@danjou.info>

Conflicts:

	tests/api/v1/test_list_resources.py
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>
optimize resources query

added multi column index and tuned the query