Change resource.resource_metadata to text type

The existing resource.resource_metadata column size is 5k chars,
which is not enough for some large JSON metadata payload,
so change to as Text column to make sure store all JSON string
without truncating.

Fixes bug #1220683

(cherry picked from commit 7f3e7cea0ec9d8eb7095c2790fe0ba327c2df242)

Change-Id: I898ff2706cbaccafec6060bbdb0bbf68a4209edd
Avoid leaking admin-ness into threshold-oriented alarms

Fixes bug 1237567

Previously when an admin created a threshold-oriented alarm on
behalf of an non-admin identity, this had the effect of leaking
visibility onto statistics for resources that would not normally
be visible to the non-admin tenant.

Now we ensure that an additional implicit threshold rule query
constraint is added on the project ID of the non-admin indentity
that will ultimately own the alarm.

This is acheived by splitting the query validation from the
construction of the kwargs from the query. The addition of the
implicit query constraint to the threshold rule can then be
delayed to a later point in the dispatch path where the full
context of the alarm is known (so that we can check for the case
where the alarm is created by an admin on behalf of another tenant).

Change-Id: I1adae8c899112e7c3eb4e94f3f68262c84a98574
(cherry picked from commit 7ee6f6d29451be4f2c9d5146e4cfbc147f33ee04)
Merge "Avoid leaking admin-ness into threshold-oriented alarms" into milestone-proposed
Merge "Change resource.resource_metadata to text type" into milestone-proposed