<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I would like to propose a change in the behavior of the OS::Mistral::Workflow resource signal.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">CURRENT:<o:p></o:p></p>
<p class="MsoNormal">The OS::Mistral::Workflow resource type is expecting the following request body on resource signal request:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">{<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "input": {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> ...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> },<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "params": {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> ...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">}<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The input section is optional and if exists it will be passed to the workflow execution as inputs<o:p></o:p></p>
<p class="MsoNormal">The params section is also optional and if exists it will be passed to the workflow execution as parameters.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The problem this approach creates is that external systems many times send a predefined body that you cannot control and it is obviously not in the format the resource is expecting.<o:p></o:p></p>
<p class="MsoNormal">So you basically have no way to pass the information from the request body to the workflow execution.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">SUGGESTION:<o:p></o:p></p>
<p class="MsoNormal">OS::Mistral::Workflow will treat the root of the JSON request body as input parameters.<o:p></o:p></p>
<p class="MsoNormal">That way you will be able to use external systems by making sure your WF inputs are aligned with what the external system sends.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For example, if you try to put the WF alarm_url as a Ceilometer alarm action - Ceilometer will send a request similar to:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">{<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "severity": "low",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "alarm_name": "my-alarm",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "current": "insufficient data",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "alarm_id": "895fe8c8-3a6e-48bf-b557-eede3e7f4bbd",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "reason": "1 datapoints are unknown",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "reason_data": {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "count": 1,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "most_recent": null,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "type": "threshold",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "disposition": "unknown"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> },<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> "previous": "ok"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">}<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The WF could get this info as input if it will be defined like so:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> my_workflow:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> type: OS::Mistral::Workflow<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> properties:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> input:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> current: !!null<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> alarm_id: !!null<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> reason: !!null<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> previous: !!null<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> severity: !!null<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> alarm_name: !!null<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> reason_data: !!null<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The (least used) “params” section can be passed in an custom HTTP header and the OS::Mistral::Workflow will read those from the header and pass it to the WF execution.<o:p></o:p></p>
<p class="MsoNormal">Remember, we are trying to solve the problem where you can’t influence the request format – so in any case the signal will not get the params in the request body.<o:p></o:p></p>
<p class="MsoNormal">If the WF of the user must receive params, the user will always be able to create a wrapper WF with only inputs that starts the orig WF with inputs and params.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In order to make this non-backward compatible change, I suggest to add a property “params_alarm_http_header_name” to the OS::Mistral::Workflow. If null the params are expected to be in the body as today.<o:p></o:p></p>
<p class="MsoNormal">If not null – the request should have a header with that name and the value will be a string representing a JSON dict.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I would really like to hear your opinion and comments.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks.<o:p></o:p></p>
</div>
</body>
</html>