class documentation
class ActionManager:
This class defines functionalities to handle action triggerings, dependancies and other action related functionalities
| Method | check |
Check the operator for the given subject attribute. |
| Method | check |
Check the threshold value for the given subject attribute. |
| Method | check |
Check the evaluation criteria for a given subject resource. |
| Method | enter |
Enter the active state for a resource. |
| Method | enter |
Enter the disabled state for a resource. |
| Method | enter |
Enter the pause state for a resource. |
| Method | evaluate |
Eventhandler to evaluate actions for a resource in case a resource changes. |
| Method | evaluate |
Evaluate the dependencies of an action. |
| Method | evaluate |
Evaluate a single action for a resource. |
| Method | restart |
Restart the ActionManager service. |
| Method | schedule |
Schedule an action for execution. |
| Method | shutdown |
Shutdown the Action Manager. |
| Method | start |
Initialization of an ActionManager instance. |
| Method | unschedule |
Unschedule an action. |
| Method | update |
Update an existing action. |
| Class Variable | dispatcher |
Injected Dispatcher instance. |
| Class Variable | request |
Injected RequestManager instance. |
| Class Variable | storage |
Injected Storage instance. |
| Class Variable | validator |
Injected Validator instance. |
| Method | _evaluate |
Evaluate a single evaluation criteria. |
Check the operator for the given subject attribute.
| Parameters | |
optr:EvalCriteriaOperator | The operator. |
dataBasicType | The basic type of the attribute value. |
sbjt:str | The subject attribute name. |
| Raises | |
BAD_REQUEST | If the operator is not allowed for the given data type. |
Check the threshold value for the given subject attribute.
| Parameters | |
sbjt:str | The subject attribute name |
thld:Any | The threshold value. |
rtype:ResourceTypes | The resource type of the subject attribute. |
| Returns | |
BasicType | The basic type of the attribute value. |
| Raises | |
BAD_REQUEST | If the threshold value is invalid. |
def checkEvalCriteria(self, evc:
JSON, subject: str | Resource, originator: str, checkEvc: bool = True):
¶
Check the evaluation criteria for a given subject resource.
| Parameters | |
evc:JSON | The evaluation criteria to check. |
subject:str | Resource | The subject resource ID or the subject resource itself. |
originator:str | The originator of the request. |
checkbool | Check the evaluation criteria. Default is True. |
| Returns | |
| A tuple with a boolean indicating the success of the check and a possible error message. |
| Raises | |
BAD_REQUEST | If the evaluation criteria is invalid. |
Originator_HAS_NO_PRIVILEGE | If the originator has no access to the subject resource. |
NOT_FOUND | If the subject resource does not exist. |
Enter the active state for a resource.
| Parameters | |
resource:Resource | The resource to enter the active state. |
Enter the disabled state for a resource.
| Parameters | |
resource:Resource | The resource to enter the disabled state. |
Enter the pause state for a resource.
| Parameters | |
resource:Resource | The resource to enter the pause state. |
Eventhandler to evaluate actions for a resource in case a resource changes.
| Parameters | |
eventEventData | The event data containing the resource and the real resource ID in the payload. |
Evaluate the dependencies of an action.
| Parameters | |
action:JSON | The action to evaluate. |
| Returns | |
bool | Boolean that indicates the success of the evaluation. |