Rewrite get_secgroup_uuids to avoid resource_by_refid

get_secgroup_uuids has changed in the following ways:
* No longer attempts to find a security group name via
  a resource_by_refid lookup. resource_by_refid only exists
  as a workaround for AWS compatibility resource which are
  not backed by an API. Usage of resource_by_refid should be
  avoided in native resources if at all possible.
* If the security group looks like a UUID, assume it is
  a UUID for a security group that exists
* Call client.list_security_groups only once, and only if
  there is a non-uuid security group specified
* Do not attempt to reduce duplicate security groups to a unique
  list. If that is important for resources it can be done in
  validation.
* Raise PhysicalResourceNotFound if name maps to no group
* Raise PhysicalResourceNameAmbiguity if name maps to more than one
  group

Change-Id: I106adc15a7882192884d37c0806947470d139434
Closes-Bug: #1250286
Use get_secgroup_uuids in Instance

Instance._get_security_groups_id serves the same
purpose as neutron.get_secgroup_uuids. This change switches
Instance to using get_secgroup_uuids instead.

Updating the test has the side-effect on getting full test
coverage on get_secgroup_uuids, albeit indirectly.

Change-Id: I8cdc51692fd8d96e68c6c947891c9708f77d54c3
Related-Bug: #1250286
Managed Cloud compatibility for Cloud Servers

Make the Cloud Servers resource aware of the Managed Cloud automation.
The Cloud Servers resource should wait for the Managed Cloud automation
to complete before proceeding with the server configuration.

Blueprint managed-cloud
Change-Id: Iea331f1b275026d6189012528d376e01c986b0cb
Move resource doc generation to doc/source/ext

This is similar to other projects, and removes this
code from the withering gaze of coverage reports.

Change-Id: Ie0acb2a203f2e69a7d84aba3915a8499ab51ecb6
Fix some direct imports from sqlalchemy

Directly import sqlalchemy might result in some inconsistent
behaviors. It would bypass the db_backend configuration.

Change-Id: Ic07c5d9f4898add6629a296ee1dff22be0e75262
Implement Tags for S3 bucket

Use the metadata to hold the tags.

Change-Id: I52d8bb9429a90529431622c72ff2484e6c38c58e
Add support for limiting and sorting stacks

This adds support to the stacks index call for limit, sort_keys,
sort_dir, and marker query parameters, allowing users of the API to
retrieve a subset of stacks.

With this commit, stacks are also sorted by created_at DESC by default.

blueprint pagination

Change-Id: Ib20cfae183475ff42deda82168b8b9c8d043ecd0
Add links section to the stacks index response

Add a `links` section to the stacks index response that will contain
pagination links for the collection - this commit includes adding a
`next` link to the section.

blueprint pagination
Change-Id: I76451a101e7c417a485da78dd7fb19229d91861d
Merge "Move resource doc generation to doc/source/ext"
Merge "Rewrite get_secgroup_uuids to avoid resource_by_refid"
Merge "Managed Cloud compatibility for Cloud Servers"
Add _() to fix i18N compliance (part 1)

In heat, almost 200 log message and at least 30 exception
message are not processed by _(), and will not been translated.
We should use '_("STRING ...")' to enable i18n support.

I will split to two parts for review easier because the files
lost of _() are too much.

Closes-Bug: #1249217

Change-Id: I2c86dc7770a7f6f107ba16711b9cba363ef9b906
Merge "Use get_secgroup_uuids in Instance"
Merge "Implement Tags for S3 bucket"
Merge "Fix some direct imports from sqlalchemy"
Merge "Add support for limiting and sorting stacks"
Merge "Add links section to the stacks index response"
Database changes for multi-engine support

Add a stack_lock database table to use as a distributed stack lock to
avoid race conditions when multiple engines are deployed.

Blueprint multiple-engines

Change-Id: I0b8e244a73295dca307cb09ea5da2ebe709134b1