<div dir="ltr">Hi, Ifat,<div><br></div><div>The static configuration contains definitions of `entities` and <b>their</b> `relationships while the scenario templates contains a definition section which includes `entities` and `relationships` <b>between them</b>. An outline of these two format are as below.</div><div><br></div><div>static configuration</div><div><br></div><div><font face="monospace">- entities</font></div><div><font face="monospace">  - {entity}</font></div><div><font face="monospace">  - {entity}</font></div><div><font face="monospace"><br></font></div><div>for each entity</div><div><font face="monospace"><br></font></div><div><font face="monospace">- name: </font></div><div><font face="monospace">  id:</font></div><div><font face="monospace">  relationship:</font></div><div><font face="monospace">    - {relationship}</font></div><div><font face="monospace">    - {relationship}</font></div><div><font face="monospace"><br></font></div><div>scenario templates</div><div><font face="monospace"><br></font></div><div><font face="monospace">- definitions</font></div><div><font face="monospace">  - entities</font></div><div><font face="monospace">    - {entity}</font></div><div><font face="monospace">    - {entity}</font></div><div><font face="monospace">  - relationships</font></div><div><font face="monospace">    - {relationship}</font></div><div><font face="monospace">    - {relationship}</font></div><div><span style="line-height:1.5"><font face="monospace">      </font></span></div><div>Though serving different purpose, they both </div><div><ol><li><span style="line-height:1.5">describe entities and relationships</span></li><li><span style="line-height:1.5">use a dedicated key (</span><font face="monospace">id/template_id</font><span style="line-height:1.5">) to reference the items</span><br></li><li><span style="line-height:1.5">include a source entity and target entity in relationship</span></li></ol><div>The main differences between the two are</div></div><div><br></div><div><ul><li>scenario <b>defines rules </b>(entity and relationship matching)<b>, </b>graph update is triggered when entities are added by datasource.</li><li>static configuration <b>defines rules</b> and also <b>add entities</b> to graph</li></ul><div>The rule definition are common to these two modules. We may define the static configuration using the same format as scenario template. And then simulate an entity discovery from the same file.</div></div><div><br></div><div>By reusing the template parsing engine and workflow, we may reduce the work in maintenance and bring in new features more easily.</div><div><br></div><div>We may discuss it further if anything unclear.</div><div><br></div><div class="gmail_quote"><div dir="ltr">On Tue, Aug 30, 2016 at 11:07 PM Afek, Ifat (Nokia - IL) <<a href="mailto:ifat.afek@nokia.com" target="_blank">ifat.afek@nokia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>Hi Yujun,</div>
<div><br>
</div>
</div>
<span>
<div style="font-family:Calibri;font-size:12pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>Yujun Zhang<br>
<span style="font-weight:bold">Date: </span>Monday, 29 August 2016 at 11:59<br>
</div></span></div><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><span>
<blockquote style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5">
<div>
<div>
<div dir="ltr">
<div>
<pre style="font-family:menlo;font-size:9pt"><span style="background-color:rgb(237,252,237)">entities:<br></span><span style="background-color:rgb(237,252,237)"> - type: switch<br></span><span style="background-color:rgb(237,252,237)">   name: switch-1<br></span><span style="background-color:rgb(237,252,237)">   id: switch-1 # should be same as name<br></span><span style="background-color:rgb(237,252,237)">   state: available<br></span><span style="background-color:rgb(237,252,237)">   relationships:<br></span><span style="background-color:rgb(237,252,237)">     - type: nova.host<br></span><span style="background-color:rgb(237,252,237)">       name: host-1<br></span><span style="background-color:rgb(237,252,237)">       id: host-1 # should be same as name
</span><span style="font-size:9pt;line-height:1.5;background-color:rgb(237,252,237)"><b>       is_source: true # entity is `source` in this relationship
</b></span><span style="font-size:9pt;line-height:1.5;background-color:rgb(237,252,237)">       relation_type: attached
</span><span style="font-size:9pt;line-height:1.5;background-color:rgb(237,252,237)">     - type: switch
</span><span style="font-size:9pt;line-height:1.5;background-color:rgb(237,252,237)">       name: switch-2
</span><span style="font-size:9pt;line-height:1.5;background-color:rgb(237,252,237)">       id: switch-2 # should be same as name
</span><b><span style="font-size:9pt;line-height:1.5;background-color:rgb(237,252,237)">       is_source: false # </span><span style="font-size:9pt;line-height:1.5;background-color:rgb(237,252,237)">entity is `target` in this relationship</span><span style="font-size:9pt;line-height:1.5;background-color:rgb(237,252,237)"><br></span></b><span style="font-size:9pt;line-height:1.5;background-color:rgb(237,252,237)">       relation_type: backup</span></pre>
</div>
</div>
</div>
</div>
</blockquote>
</span></div><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><span></span>
<div><br>
</div>
<div>
<div>I think that’s the idea, instead of making this assumption in the code.</div>
</div></div><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div><br>
</div>
<span>
<blockquote style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5">
<div>
<div>
<div dir="ltr">
<div>But I wonder why the static physical configuration file use a different format from vitrage template definitions[1]
<div><br>
</div>
<div>[1] <a href="https://github.com/openstack/vitrage/blob/master/doc/source/vitrage-template-format.rst" target="_blank">https://github.com/openstack/vitrage/blob/master/doc/source/vitrage-template-format.rst</a></div>
</div>
</div>
</div>
</div>
</blockquote>
</span>
<div><br>
</div>
</div><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div>What do you mean? The purpose of the templates is to describe the condition-action behaviour, wheres the purpose of the static configuration is to define resources to be added to vitrage graph. Can you please explain how you would make the formats more
 similar? </div>
<div></div>
<div><br>
</div>
<div>Best Regards,</div>
<div>Ifat.</div>
<div><br>
</div>
</div>

__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div></div>