/schedulers [ POST ]

Add a scheduler to an existing micro service.


Body Parameters


Name Optional Valid values
name Yes string: scheduler name. If not provided, the system will generate a name based on service name and creation time
service_id No string
agents No 1. agent identifier (string) : "agent_1" 2. agent identifiers (list) : ["agent_1", "agent_2"..] 3. "all" - creates a process on each and every valid agent (based on the service agents mapping) 4. "any" - randomly select an active agent to run on from the list of valid agents (based on the service agents mapping)
properties Yes List of input property values to run this service. A key-value json map (can be a nested json as the following): 
{
"key" : "value", 
"key2": 34, 
"key3": {
    "a" : "b",
    "c" : "d"
 },
 "key4" : false
}

 

cron No string: any valid cron specification (e.g. "* * * * *" to run every minute..).
active Yes boolean: a flag specifying if this scheduler should be active or not. Default for new schedulers is false.


Request Examples      

curl -k -u admin:admin -X POST -H "Content-Type: application/json" -d '{
    "service_id" : "my_service",
    "name": "my scheduler",
    "cron" : "* * * * *",
    "properties": [
            {"key" : "key1", "value":"value1"},
            {"key" : "key2", "value":"value2"}
        ],
    "agents": "any",
    "active": true
}' https://OPERETOHOST/schedulers

   

       

Response Example     

{"status": "success", "data": "jmIRFJ5c0uy"}