| 46 | |
| 47 | |
| 48 | class ActionExecutionAPI(BaseAPI): |
| 49 | model = ActionExecutionDB |
| 50 | SKIP = ["start_timestamp", "end_timestamp"] |
| 51 | schema = { |
| 52 | "title": "ActionExecution", |
| 53 | "description": "Record of the execution of an action.", |
| 54 | "type": "object", |
| 55 | "properties": { |
| 56 | "id": {"type": "string", "required": True}, |
| 57 | "trigger": TriggerAPI.schema, |
| 58 | "trigger_type": TriggerTypeAPI.schema, |
| 59 | "trigger_instance": TriggerInstanceAPI.schema, |
| 60 | "rule": RuleAPI.schema, |
| 61 | "action": REQUIRED_ATTR_SCHEMAS["action"], |
| 62 | "runner": REQUIRED_ATTR_SCHEMAS["runner"], |
| 63 | "liveaction": REQUIRED_ATTR_SCHEMAS["liveaction"], |
| 64 | "status": { |
| 65 | "description": "The current status of the action execution.", |
| 66 | "type": "string", |
| 67 | "enum": LIVEACTION_STATUSES, |
| 68 | }, |
| 69 | "start_timestamp": { |
| 70 | "description": "The start time when the action is executed.", |
| 71 | "type": "string", |
| 72 | "pattern": isotime.ISO8601_UTC_REGEX, |
| 73 | }, |
| 74 | "end_timestamp": { |
| 75 | "description": "The timestamp when the action has finished.", |
| 76 | "type": "string", |
| 77 | "pattern": isotime.ISO8601_UTC_REGEX, |
| 78 | }, |
| 79 | "elapsed_seconds": { |
| 80 | "description": "Time duration in seconds taken for completion of this execution.", |
| 81 | "type": "number", |
| 82 | "required": False, |
| 83 | }, |
| 84 | "web_url": { |
| 85 | "description": "History URL for this execution if you want to view in UI.", |
| 86 | "type": "string", |
| 87 | "required": False, |
| 88 | }, |
| 89 | "parameters": { |
| 90 | "description": "Input parameters for the action.", |
| 91 | "type": "object", |
| 92 | "patternProperties": { |
| 93 | r"^\w+$": { |
| 94 | "anyOf": [ |
| 95 | {"type": "array"}, |
| 96 | {"type": "boolean"}, |
| 97 | {"type": "integer"}, |
| 98 | {"type": "number"}, |
| 99 | {"type": "object"}, |
| 100 | {"type": "string"}, |
| 101 | ] |
| 102 | } |
| 103 | }, |
| 104 | "additionalProperties": False, |
| 105 | }, |
no outgoing calls