Greg, 

This is really not a new discussion. Particularly, we’ve already discussed 
EventScheduler thing before with heat folks 
(http://lists.openstack.org/pipermail/openstack-dev/2013-November/019150.html). 
We agreed that EventScheduler doesn’t make a lot of sense alone after Mistral 
came into play. It’s because EventScheduler only describes calling webhooks on 
schedule and nothing else. Mistral already has this functionality just because 
it’s a part of its core idea. Timer events is just one of the event types 
Mistral is going to support (there will also be others like Ceilometer alarms). 
And one of the simple use case of Mistral would be exactly “calling a webhook 
on schedule”. Since Mistral uses DSL as a main interaction means with a user 
the team decided to implement ideas of EventScheduler as a part of Mistral DSL 
as well. Here’s the simple Mistral DSL that describes basically the same as 
described in EventScheduler:

Services:
   MyRest:
     type: REST_API
     parameters:
         baseUrl: http://localhost:8988/my_service
     actions:
         my-action:
           parameters:
               url: /my-action
               method: GET

Workflow:
   tasks:
     my-task:
         action: MyRest:my-action

   events:
     my-task:
        type: periodic
        tasks: my-task
        parameters:
            cron-pattern: "*/1 * * * *"

I really hope it’s self-explaining enough (if not, let us know what is not 
clear or what you don’t like, we’ll improve it). Basically, to make this simple 
DSL snippet work we just need to upload it to Mistral via REST API. Just want 
to repeat: this already works. To simplify this even more for use cases like 
yours we also have an idea of providing some API sugar like scheduling webhook 
calls using special REST API action like:

http POST /webhooks

{
        “name”: “my every minute webhook”,
        “webhook": “http://my.webhook.host/someurl”,
        “schedule”: {
                        “cron”: “* * * * *"
                }
}

And under the hood Mistral would just generate a workflow definition similar to 
provided above.

So my main point here that I was trying to make is that EventScheduler is just 
a special case of Mistral capabilities. We can just provide a convenience for 
scheduling webhook calls on the API (a couple of hours to implement).

Thanks! Happy New Year to everyone! 

Renat Akhmerov
@ Mirantis Inc.



_______________________________________________
OpenStack-dev mailing list
[email protected]
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to