Correct alarm timestamp field in unittest code

This patch corrects some code in unit test which relates to timestamp
issue. timestamp and state_timestamp fields will always be set, but
test code sometimes sets them to None, which will affect source code
to consider the scenario timestamp is None, in fact, this would never
happen in API call.

This patch adds a type check for timestamp and state_timestamp
in alarm.storage.models.Alarm, to prevent contributors to accidently
set these two fields to None.

Change-Id: I035b4f0f9c1ff7f4158c72acfddaf02e55891086
Alarms listing based on "timestamp"

Fixes are proposed for ordering alarms based
on "timestamp" in descending order.
Existing tests has been modified at storage
and api without breaking their functionality.

One test case has been provided with this patch.

Co-Authored-By: Ilya Tyaptin <ityaptin@mirantis.com>

Change-Id: Ie2bb950b6d32188f451f905e2cf07e4d938df1ac
Closes-Bug: #1287119
[MongoDB] Refactor time to live feature

This change adds ttl index to last_sample_timestamp field in resource
table, so data cleans in background after time to live is expired with
low priority and without blocking database, instead of reduce operation.

Change-Id: I13e336a9ad0d771962bf81a33818b4b233ae3e51
Closes-Bug: #1270779
Merge "Correct alarm timestamp field in unittest code"
Merge "Alarms listing based on "timestamp""