Refactor Stack timestamps

Stack.created_time and Stack.updated_time were always fetched in real
time using db_api.stack_get, which was inefficient.
This code also assumed that the user also had access to stack_get on
the listed stacks, which is not true in the case of an unscoped
stack_list.

This removes this behavior in favor of the stack's created_at and
updated_at attributes already present when the stack is retrieved.

Co-Authored-By: Anderson Mesquita <andersonvom@gmail.com>
Implements: blueprint management-api (partial)
Change-Id: I1fd6586b827b3f2babb5af5c85f9de25da74fbb6
fix bug whatever

Change-Id: I52b75d9bdda3551694fb056f5bbbdf5e359eb428
WIP: fixig tests

Change-Id: Icbb990f24eb17adac90e6149911fe36b9482fb0c
Fix stack_get_all call on stack watcher

The patch Ifdcfc44a3483a089ae803cfd044151262957674a missed this line
when updating the stack_get_all signature and behavior.  This reverts
the Engine.start() behavior to what it was before.

Co-Authored-By: Richard Lee <rblee88@gmail.com>
Implements: blueprint management-api (partial)
Change-Id: I47891c41fd345fe614675aeb9f82ff5d74d50a76
Alter stack_count_all_by_tenant to stack_count_all

Preparing the database for the unscoped list stacks, this removes
stack_count_all_by_tenant in favor of a single function that is tenant
aware.  This way, you can call stack_count_all(tenant_safe=False) and
count all stacks, regardless of the tenants.

tenant_safe defaults to True.

Implements: blueprint management-api (partial)
Change-Id: Ic44b884120290b6ceaf4936e015ef6661aaf6694
Unscoped List Stacks

This allows non tenant-scoped list of stacks for the management api
blueprint. A user allowed by the policy stacks:global_index will be
able to make a call to "/:tenant_id/stacks?global_tenant=true" and get
all stacks in Heat, and not just the ones owned by the user,
effectively bypassing tenant scoping.

If the user is not authorized by the policy and they pass the
global_tenant param, the request will get denied by the policy enforcer
and 403 Forbidden is returned.

Implements: blueprint management-api
Change-Id: I973a7ad2726eb6d9c972d08abe15e241aa120ec3
Add tenant to unscoped stack list response

For an unscoped stack list, stacks will possibly belong to several
different tenants.  As a user who can see all stacks, it is useful to be
able to distinguish which stacks belong to which tenants.

Change-Id: I4148a298ef7a41b815b477c49ff4aaf331845129
Implements: blueprint management-api