extract_action_param
Related Concepts: Integration Configuration & Script Parameters
Get the value of an action parameter. Each action has parameters that are filled when the action is configured (in playbook or as manual action). This method allows extracting the value of a selected parameter of the currently running action.
param_value= siemplify.extract_action_param(
param_name,
default_value=None,
input_type=str,
is_mandatory=False,
print_value=False)
Parameters:
Param Name | Param Type | Possible Values | Comments | Mandatory Parameter |
---|---|---|---|---|
param_name | string | Any of the parameters names available for the action | The name of the parameter to fetch | Yes |
default_value |
|
Any desired value | The default value of the parameter. The given value will be returned if the parameter was not set (if is_mandatory is set to False). Defaults to None. | No |
input_type |
|
Any valid python type | The type of the parameter. The returned value will be cast to the selected input type. Defaults to str. | No |
is_mandatory | boolean | True/False | Whether the parameter is mandatory. If set to True and the parameter was not filled, an exception will be raised. Default to False. | No |
print_value | boolean | True/False | Whether to output the fetched value of the parameter to the logs. Default to False. | No |
Return Type
As passed in input_type
Sample Code
from SiemplifyAction import SiemplifyAction
siemplify = SiemplifyAction()
param_value= siemplify.extract_action_param(
"Threshold",
default_value=-1,
input_type=int,
is_mandatory=False,
print_value=False)
Result Behavior
The value of the selected parameter will be returned, casted to selected type.
Result Value
20