Alert Rules¶
-
class
py42.modules.alertrules.
AlertRulesModule
(microservice_client_factory)¶ Bases:
object
-
add_user
(rule_id, user_id)¶ Update alert rule to monitor user aliases against the Uid for the given rule id.
- Parameters
rule_id (str) – Observer Id of a rule to be updated.
user_id (str) – The Code42 userUid of the user to add to the alert
- Returns
A collection of methods for managing cloud sharing alert rules.
-
property
exfiltration
¶ A collection of methods for managing exfiltration alert rules.
-
property
filetypemismatch
¶ A collection of methods for managing file type mismatch alert rules.
-
get_all
(sort_key='CreatedAt', sort_direction='DESC')¶ Fetch all available rules.
- Parameters
sort_key (str) – Sort results based by field. Defaults to ‘CreatedAt’.
sort_direction (str) –
ASC
orDESC
. Defaults to “DESC”
- Returns
An object that iterates over
py42.response.Py42Response
objects that each contain a page of rules.- Return type
generator
-
get_by_name
(rule_name)¶ Search for matching rules by name.
- Parameters
rule_name (str) – Rule name to search for, case insensitive search.
- Returns
- list
List of dictionary containing rule-details.
-
remove_all_users
(rule_id)¶ Update alert rule criteria to remove all users the from the alert rule.
- Parameters
rule_id (str) – Observer rule Id of a rule to be updated.
- Returns
-
remove_user
(rule_id, user_id)¶ Update alert rule criteria to remove a user and all its aliases from a rule.
- Parameters
rule_id (str) – Observer rule Id of a rule to be updated.
user_id (str) – The Code42 userUid of the user to remove from the alert
- Returns
-