Delete a stack without deleting the resources

Registered by Steve Baker

This blueprint is partnered with blueprint adopt-stack to allow stacks to be moved from one heat instance to another in a 2 step process:
* a stack is abandoned, deleting the stack but leaving the resources running
* the state returned from the abandon action is used to do a stack adopt. This creates a stack which adopts the passed resources, and does not create any new resources

This blueprint may be useful on its own for users who want to use heat to use heat to invoke openstack resources but don't want to use heat to manage those resources.

Abandoning a stack would do the following:
* Collect all the resource state (resource IDs, resource data, metadata?)
* Delete the stack with DeletionPolicy on all resources overridden to 'Retain'
* Return a json structure to the user containing the abandoned template, plus the resource state

The json structure will be in a format that can be consumed by blueprint adopt-stack

Blueprint information

Status:
Complete
Approver:
Steve Baker
Priority:
Medium
Drafter:
Steve Baker
Direction:
Approved
Assignee:
Vijendar Komalla
Definition:
Approved
Series goal:
Accepted for icehouse
Implementation:
Implemented
Milestone target:
milestone icon 2014.1
Started by
Steve Baker
Completed by
Steve Baker

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/abandon-stack,n,z

Addressed by: https://review.openstack.org/56696
    heat engine changes for abandon-stack

Addressed by: https://review.openstack.org/56697
    Add REST endpoint for stack-abandon

format of jason data returned from abandon-stack;
{
"action": "CREATE",
"status": "COMPLETE",
"name": "my-test-stack-name",
"resources": {
 "res-name1": {
  "status": "COMPLETE",
  "name": "db",
  "resource_data": {
   "private_key": "xyz"
  },
  "metadata": {},
  "resource_id": "xxxxx-xxxx-xxxx-xxxx-xxxxxx",
  "action": "CREATE",
  "type": "Rackspace::Cloud::Instance"
 },
 "res-name-2": {
  "status": "COMPLETE",
  "name": "webserver",
  "resource_data": { },
 "metadata": {},
 "resource_id": "xxxxxx-xxxx-xxxx-xxxx-xxxxx",
 "action": "CREATE",
 "type": "Rackspace::Cloud::DBInstance"
 }
},
"id": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxx",
"template": {"valid heat template"}
}

Addressed by: https://review.openstack.org/57491
    Define deletion policy constants

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.