StackResource add show_deleted option to nested() accessor method

Adds the option to return a stack object even if the stack has been
deleted, which is slightly more convenient when polling for DELETE
COMPLETE state, as you no longer have to handle NotFound when the
delete happens.

Change-Id: I9074bfcec84836cc789cf9f5ecd0a904f020ccb9
blueprint: decouple-nested
engine service add user_creds_id to create_stack interface

Adds the option to pass user_creds_id to create_stack in the service.py
so we can pass the parent user_creds reference in to nested stacks when
creating them via RPC, for compatibility with the way nested stacks
are currently created.

Change-Id: I127628d9af4c148ad7eaf6f0fc8cdb754cc9d6fe
blueprint: decouple-nested
Add user_creds_id to _create_stack RPC interface

Adds the ability to pass the parent user_creds_id into nested stacks
when creating them via RPC, so we can maintain the current behavior
in StackResource, where the parent user_creds record is used by all
nested stacks.

Change-Id: Ifed93860db68a7d23b0c05bd9ec83619e109e386
blueprint: decouple-nested
Implement update of AWS::EC2::SecurityGroup rules

Such functionality is supported by AWS [1], is present in
OS::Neutron::SecurityGroup but was missing from AWS::EC2::SecurityGroup.
Updates for both Neutron and Nova-Network security groups are
implemented.
Updates are performed on per-rule basis with minimal interruption.
The implementation splits the code in two helper classes implementing
Nova and Neutron API orchestraion.

Also, security groups APIs mocks are brought closer to reality.

[1] http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html

Change-Id: I86a04612567bd6080d1b825bc58acc9a08f0c2a4
Implements: blueprint handle-update-for-security-groups
Correct validation for timeout when rolling update

Using effective capacity not the current capacity to calculate
whether the update action will in result timeout.

Change-Id: I718e19c197efa5ca3add270a7470ed26e0f705db
Closes-Bug: #1388695
Add snapshot restore HTTP API

This adds the external HTTP API and the RPC methods to invoke stack
restore.

blueprint stack-snapshot
Co-Authored-By: ala.rezmerita@cloudwatt.com

Change-Id: Id1ec0c11c9f12c23b3eec12a853db6ee4ff90277
Improve error response in cfn Outputs validation

Relying on discussion in commit
I0d7e3e57e479ddb658645b8664bc847866180cda, this patch
improve error message for a better understanding of
error in Outputs and Resources sections.

Change-Id: I2a16093a57b474ef4636975b5fc0df4103678a08
Implement handle_check for CloudWatch

This allows CloudWatch resources to be checked as part of a
stack.check() operation.

Implements: blueprint stack-check
Change-Id: I974a68cc5df6baaa1f0ad594a758747773e52373
Implement handle_check for OS::Nova::Server

This allows OS::Nova::Server to perform a sanity check when running a
stack.check()

Implements: blueprint stack-check
Change-Id: Ie2f5805c7b482ee00a3ad53fef1994bb9df51e45
Implement handle_check for OS::Trove::Instance

This allows OS::Trove::Instance to perform a sanity check when
performing a stack.check()

Implements: blueprint stack-check
Change-Id: Idf694cbe9119c268fb27cdc090d0edff7e4a3607
Implement handle_check for OS::Swift::Container

This allows OS::Swift::Container to perform a sanity check when
performing a stack.check()

Implements: blueprint stack-check
Change-Id: I1821c8067a5cf41b2100ab500ce7cfbe6fadeb34
Implement handle_check for OS::Nova::KeyPair

This allows OS::Nova::KeyPair to perform a sanity check when performing
a stack.check()

Implements: blueprint stack-check
Change-Id: I2091df2eb6d8b4fa05fbeb07c6e92d95131b8e0b
Implement handle_check for Cinder and EC2 Volumes

This allows OS::Cinder::Volume and AWS::EC2::Volume to perform a sanity
check when performing a stack.check()

Change-Id: I5bb5a25b05391076c998a91f877ccd3986da81ef
Implements: blueprint stack-check
Use environment file in template-validate

Use the -e parameter in template-validate to override any
Default values specified in the template.  This has the desirable
effect of making Horizon use parameters updated from the environment
file.

Change-Id: I84405d1d2f5245ab7cb8b909c2ea1407d5b2973e
Closes-Bug: #1388985
Implement custom constraint for nova server

Many resources have 'InstanceId' property related
with nova server, add nova server custom constraint
to validate the existent of the server.

Change-Id: I4ee5a392488f26b2de708412d58f9c206d6f2c43
Implements: blueprint nova-custom-constraints
Remove KeypairConstraint and FlavorConstraint to nova.py

All nova custom constraints should be defined in
nova.py as neutron custom constraints.
And this change also remove the corresponding tests
to test_nova_client.py

Change-Id: Ie40192b5d53d60d2d4e152801cbd8583e6c45dac
Implements: blueprint nova-custom-constraints
Move ImageConstraintTest to test_glance_client.py

Move image constraint tests to test_glance_client.py
for uniform.

Change-Id: I5cccd344a9c8decbea6638a780607f16d7895354
RandomString don't skip superclass validation

Ensure the superclass validation happens as well as the class-local
additional stuff.

Change-Id: I3fdc6e5d6a4ca741cdd12ca0ed6ceb908c03ae9f
Closes-Bug: #1392754
Add ModelSMigrationSync classes

Add classes for testing correspondence between migration scripts
and metadata.

Implements bp: db-sync-models-with-migrations

Change-Id: Ia007a3b218302f9462b152fa98ad177c4cfff24d
Remove duplication on stack resource operations

Move resource existence and availability check to a single place to
avoid duplication.  This is prep work for the blueprint
detailed-resource-show.

Change-Id: Ie923516d11307fc5efdbfbe728fb842137915b28