Support arbitrary json format in os::mistral::workflow handle signal
Currently, os::mistral:
signal request body.
{
"input": {
...
},
"params": {
...
}
}
Since external systems (or even the ceilometer project)
tend to have predefined bodies in their requests,
which are not compatible with this format,
we need to add support so that signals from these systems can pass
information to the workflows being signaled.
The suggestion is to except any json format as a map where all the keys
will be treated as inputs to the workflow.
After the change, optionally, in order to pass parameters to the workflow,
the request will send them using a specific header instead of the request body.
the change will not break current behavior, as explained later.
Example:
Ceilometer signal request body looks like this:
"{
"severity": "low",
"alarm_name": "my-alarm",
"current": "insufficient data",
"alarm_id": "895fe8c8-
"reason": "1 datapoints are unknown",
"reason_data": {
"count": 1,
"type": "threshold",
},
"previous": "ok"
}
"
Currently mistral can't use any of this information, after the change the user will
be able to define the appropriate inputs in the workflow and they will be
filled when the signal is called.
"my_workflow:
type: OS::Mistral:
properties:
input:
current: !!null
alarm_id: !!null
reason: !!null
previous: !!null
severity: !!null
alarm_name: !!null
"
In order to keep backward compatibility, we should add a new property to the
os::mistral:
if this property is null or undefined, the old behaviour will be used.
in case this property was given a value, the request body will be
treated as a simple json (no format), and any data passed in the specific header
will be passed as a parameter to the workflow.
Blueprint information
- Status:
- Complete
- Approver:
- Sergey Kraynev
- Priority:
- Medium
- Drafter:
- noa
- Direction:
- Needs approval
- Assignee:
- noa
- Definition:
- Approved
- Series goal:
- None
- Implementation:
-
Implemented
- Milestone target:
-
mitaka-2
- Started by
- Sergey Kraynev
- Completed by
- Sergey Kraynev
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Enable simple json format in workflow signal
It is worth noting that if the workflow resource is created using the new property, there is no ability to override the workflow params using heat resource-signal API call.
Addressed by: https:/
Enable simple json format in workflow signal
Addressed by: https:/
Enable simple json format in workflow signal