<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I have created a blueprint to capture the intention to simplify calling standard actions:<div><br></div><div><a href="https://blueprints.launchpad.net/mistral/+spec/mistral-shorthand-action-in-dsl">https://blueprints.launchpad.net/mistral/+spec/mistral-shorthand-action-in-dsl</a></div><div><br></div><div>DZ> </div><div><br><div><div>On Feb 11, 2014, at 7:40 AM, Dmitri Zimine <<a href="mailto:dz@stackstorm.com">dz@stackstorm.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Yes it makes sense, let's draft how it may look;<br><br>and also think over implementation implications - now we separate task parameters, action parameters, and service parameters, we may need to merge them when instantiating the action. <br><br>DZ. <br><br>On Feb 11, 2014, at 6:19 AM, Renat Akhmerov <<a href="mailto:rakhmerov@mirantis.com">rakhmerov@mirantis.com</a>> wrote:<br><br><blockquote type="cite">Dmitry, I think you are right here. I think for simple case we should be able to use in-place action definition without having to define the action separately. Like you said it’s only valuable if we need to reuse it.<br><br>The only difference I see between std:send-email and something like REST_API is that a set of parameters for the latter is dynamic (versus std:send-email where it’s always “recipients”, “subject”, “body”). Even though it’s still the same protocol (HTTP) but a particular request representation may be different (i.e. query string, headers, the structure of body in case POST etc.). But I think that doesn’t cancel the idea of being able to define the action along with the task itself.<br><br>So good point. As for the syntax itself, we need to think it over. In the snippet you provided “action: std:REST_API”, so we need to make sure not to have ambiguities in the ways how we can refer actions. A convention could be “if we don’t use a namespace we assume that there’s a separate action definition included into the same workbook, otherwise it should be considered in-place action definition and task property “action” refers to an action type rather than the action itself”. Does that make sense?<br></blockquote><br><blockquote type="cite"><br>Renat Akhmerov<br>@ Mirantis Inc.<br><br>On 11 Feb 2014, at 16:23, Dmitri Zimine <<a href="mailto:dz@stackstorm.com">dz@stackstorm.com</a>> wrote:<br><br><blockquote type="cite">Do we have (or think about) a shorthand to calling REST_API action, without defining a service? <br><br>FULL  DSL:<br><br>Services:<br>TimeService:<br><span class="Apple-tab-span" style="white-space:pre">    </span>type: REST_API<br><span class="Apple-tab-span" style="white-space:pre">    </span>parameters:<br><span class="Apple-tab-span" style="white-space:pre">       </span>  baseUrl:http://<a href="http://api.timezonedb.com">api.timezonedb.com</a><br><span class="Apple-tab-span" style="white-space:pre">    </span>  key:<my_api_key><br><span class="Apple-tab-span" style="white-space:pre">     </span>actions:<br><span class="Apple-tab-span" style="white-space:pre">  </span>  get-time:<br><span class="Apple-tab-span" style="white-space:pre">  </span>    task-parameters:<br><span class="Apple-tab-span" style="white-space:pre">       </span>      zone:<br>Workflow:<br> tasks:<br>    timeInToronto:<br>       action: TimeService:get-time<br>       parameters:<br>         zone: "America/Toronto"<br><br>SHORTCUT - may look something like this: <br><br>Workflow:<br> tasks:<br>     timeInToronto:<br><span class="Apple-tab-span" style="white-space:pre">  </span>    action:std:REST_API<br><span class="Apple-tab-span" style="white-space:pre">    </span>    parameters:<br><span class="Apple-tab-span" style="white-space:pre">    </span>      baseUrl: "<a href="http://api.timezonedb.com">http://api.timezonedb.com</a>"<br><span class="Apple-tab-span" style="white-space:pre">       </span>      method: "GET"<br><span class="Apple-tab-span" style="white-space:pre">    </span>      parameters: "zone=/America/Toronto&key=<my_api_key>"<br><span class="Apple-tab-span" style="white-space:pre">   </span>      <br>Why asking:  <br><br>1) analogy with std:send-email action. I wonder do we have to make user define Service for std:send-email? and I think that for standard tasks we shouldn't have to. If there is any thinking on REST_API, it may apply here. <br><br>2) For a one-off web service calls the complete syntax is may be overkill (but yes, it comes handy for reuse). See examples below. <br><br><br><br><br>_______________________________________________<br>OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev<br></blockquote><br><br>_______________________________________________<br>OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev<br></blockquote><br></blockquote></div><br></div></body></html>