Updates Topology to correctly handle resources in the INIT state.

Before resources are pushed to create_in_progress,
they now exist as init_complete.
This allows us to draw the entire topology at
instantiation instead of waiting for
resources to start creating before they can be seen
in the topology.

Change-Id: I9c5ea164ec13f1b89633c4b10c04e0c1941649b7
Implements: blueprint init-state-heat-topology
This commit is contained in:
Tim Schnell 2013-07-24 15:32:02 -05:00
parent fe2554a7d6
commit 4898dd9846
4 changed files with 48 additions and 6 deletions

View File

@ -57,9 +57,11 @@ def d3_data(request, stack_id=''):
for resource in resources:
resource_image = get_resource_image(resource.resource_status,
resource.resource_type)
in_progress = True if (
get_resource_status(resource.resource_status)
== 'IN_PROGRESS') else False
resource_status = get_resource_status(resource.resource_status)
if resource_status in ('IN_PROGRESS', 'INIT'):
in_progress = True
else:
in_progress = False
resource_node = {
'name': resource.logical_resource_id,
'status': resource.resource_status,

View File

@ -88,22 +88,27 @@ resource_images = {
'LB_FAILED': '/static/dashboard/img/lb-red.svg',
'LB_DELETE': '/static/dashboard/img/lb-red.svg',
'LB_IN_PROGRESS': '/static/dashboard/img/lb-gray.gif',
'LB_INIT': '/static/dashboard/img/lb-gray.svg',
'LB_COMPLETE': '/static/dashboard/img/lb-green.svg',
'DB_FAILED': '/static/dashboard/img/db-red.svg',
'DB_DELETE': '/static/dashboard/img/db-red.svg',
'DB_IN_PROGRESS': '/static/dashboard/img/db-gray.gif',
'DB_INIT': '/static/dashboard/img/db-gray.svg',
'DB_COMPLETE': '/static/dashboard/img/db-green.svg',
'STACK_FAILED': '/static/dashboard/img/stack-red.svg',
'STACK_DELETE': '/static/dashboard/img/stack-red.svg',
'STACK_IN_PROGRESS': '/static/dashboard/img/stack-gray.gif',
'STACK_INIT': '/static/dashboard/img/stack-gray.svg',
'STACK_COMPLETE': '/static/dashboard/img/stack-green.svg',
'SERVER_FAILED': '/static/dashboard/img/server-red.svg',
'SERVER_DELETE': '/static/dashboard/img/server-red.svg',
'SERVER_IN_PROGRESS': '/static/dashboard/img/server-gray.gif',
'SERVER_INIT': '/static/dashboard/img/server-gray.svg',
'SERVER_COMPLETE': '/static/dashboard/img/server-green.svg',
'UNKNOWN_FAILED': '/static/dashboard/img/unknown-red.svg',
'UNKNOWN_DELETE': '/static/dashboard/img/unknown-red.svg',
'UNKNOWN_IN_PROGRESS': '/static/dashboard/img/unknown-gray.gif',
'UNKNOWN_INIT': '/static/dashboard/img/unknown-gray.svg',
'UNKNOWN_COMPLETE': '/static/dashboard/img/unknown-green.svg',
}
@ -111,9 +116,9 @@ resource_images = {
def get_resource_type(type):
if re.search('LoadBalancer', type):
return 'LB'
elif re.search('DBInstance', type):
elif re.search('DBInstance', type) or re.search('Database', type):
return 'DB'
elif re.search('Instance', type):
elif re.search('Instance', type) or re.search('Server', type):
return 'SERVER'
elif re.search('stack', type):
return 'STACK'
@ -128,6 +133,8 @@ def get_resource_status(status):
return 'FAILED'
elif re.search('DELETE', status):
return 'DELETE'
elif re.search('INIT', status):
return 'INIT'
else:
return 'COMPLETE'

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]>
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
x="0px" y="0px" width="92px" height="92px" viewBox="-3.1 -2.67 92 92" enable-background="new -3.1 -2.67 92 92"
xml:space="preserve">
<defs>
</defs>
<g id="XMLID_1_">
<g>
<path fill="#FFFFFF" d="M43.33,1.5c23.11,0,41.839,18.73,41.839,41.83c0,23.1-18.729,41.83-41.839,41.83
c-23.1,0-41.83-18.73-41.83-41.83C1.5,20.23,20.23,1.5,43.33,1.5z"/>
</g>
<g>
<path fill="none" stroke="#808080" stroke-width="3" stroke-miterlimit="10" d="M85.169,43.33c0,23.1-18.729,41.83-41.839,41.83
c-23.1,0-41.83-18.73-41.83-41.83C1.5,20.23,20.23,1.5,43.33,1.5C66.44,1.5,85.169,20.23,85.169,43.33z"/>
</g>
</g>
<rect x="26.899" y="28.166" fill="none" stroke="#808080" stroke-miterlimit="10" width="13.333" height="13.333"/>
<rect x="40.232" y="40.966" fill="none" stroke="#808080" stroke-miterlimit="10" width="13.334" height="13.333"/>
<rect x="26.899" y="40.966" fill="#636565" stroke="#808080" stroke-miterlimit="10" width="13.334" height="13.333"/>
<rect x="40.232" y="28.166" fill="#636565" stroke="#808080" stroke-miterlimit="10" width="13.334" height="13.333"/>
<rect x="46.634" y="35.5" fill="#FFFFFF" stroke="#808080" stroke-miterlimit="10" width="13.332" height="13.334"/>
<rect x="33.833" y="48.832" fill="#FFFFFF" stroke="#808080" stroke-miterlimit="10" width="13.334" height="13.334"/>
<rect x="33.833" y="35.5" fill="#636565" stroke="#808080" stroke-miterlimit="10" width="13.334" height="13.334"/>
<rect x="46.634" y="48.832" fill="#636565" stroke="#808080" stroke-miterlimit="10" width="13.332" height="13.334"/>
<line fill="none" stroke="#808080" stroke-miterlimit="10" x1="33.833" y1="62.166" x2="26.899" y2="54.299"/>
<line fill="none" stroke="#808080" stroke-miterlimit="10" x1="33.833" y1="35.5" x2="26.899" y2="28.166"/>
<line fill="none" stroke="#808080" stroke-miterlimit="10" x1="59.966" y1="35.5" x2="53.566" y2="28.166"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -2103,7 +2103,7 @@ div.network {
}
/**** Resource Topology CSS ****/
.link {stroke: #000;stroke-width: 1.5px;}
.link {stroke: #999;stroke-width: 1.5px;}
.node {cursor:pointer;}
.node text {font: 12px sans-serif;}