:py:mod:`laceworksdk.api.v2.policy_exceptions` ============================================== .. py:module:: laceworksdk.api.v2.policy_exceptions .. autoapi-nested-parse:: Lacework Exceptions API wrapper. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: laceworksdk.api.v2.policy_exceptions.PolicyExceptionsAPI .. py:class:: PolicyExceptionsAPI(session) Bases: :py:obj:`laceworksdk.api.crud_endpoint.CrudEndpoint` A class used to represent the `Policies Exceptions API endpoint `_ Policy exceptions are a mechanism used to maintain the policies but allow you to circumvent one or more restrictions. .. py:property:: session Get the :class:`HttpSession` instance the object is using. .. py:method:: create(policy_id, description, constraints, **request_params) A method to create a new Exceptions object. :param policy_id: The object policy ID. :type policy_id: str :param description: The object description. :type description: str, optional :param constraints: The object constraints. Dict fields are: - field_key (str): A string representing the constraint key. Values are: 'accountIds', 'resourceNames', 'regionNames' and 'resourceTags' - field_values (list of str): Constraint values :type constraints: list of dicts :param request_params: Use to pass any additional parameters the API :type request_params: dict, optional :returns: The created policy exception :rtype: dict .. py:method:: get(exception_id=None, policy_id=None) A method to get Exceptions objects. :param exception_id: A string representing the exception ID. (Default value = None) :type exception_id: str, optional :param policy_id: The ID of the policy for which to get the exceptions. :returns: The requested exception(s) :rtype: dict .. py:method:: get_by_id(exception_id, policy_id) A method to get a Exceptions object by policy ID. :param exception_id: A string representing the exception ID. (Default value = None) :type exception_id: str :param policy_id: The ID of the policy for which to get the exceptions. :returns: The requested exception(s) :rtype: dict .. py:method:: update(exception_id, policy_id, description=None, constraints=None, **request_params) A method to create a new Exceptions object. :param exception_id: The exception ID to update. :type exception_id: str :param policy_id: The object policy ID. :type policy_id: str :param description: The object description. :type description: str, optional :param constraints: The object constraints. Dict fields are: - field_key (str): A string representing the constraint key. Values are: 'accountIds', 'resourceNames', 'regionNames' and 'resourceTags' - field_values (list of str): Constraint values :type constraints: list of dicts, optional :param request_params: Use to pass any additional parameters the API :type request_params: dict, optional :returns: The updated policy exception :rtype: dict .. py:method:: delete(exception_id, policy_id) A method to delete a policy xception :param exception_id: The exception ID. :type exception_id: str :param policy_id: The policy ID. :type policy_id: str :returns: a Requests response object containing the response code :rtype: requests.models.Response .. py:method:: search(json=None) A method to search objects. See the API documentation for this API endpoint for valid fields to search against. NOTE: While the "value" and "values" fields are marked as "optional" you must use one of them, depending on the operation you are using. :param json: The desired search parameters: - timeFilter (dict, optional): A dict containing the time frame for the search: - startTime (str): The start time for the search - endTime (str): The end time for the search - filters (list of dict, optional): Filters based on field contents: - field (str): The name of the data field to which the condition applies - expression (str): The comparison operator for the filter condition. Valid values are: "eq", "ne", "in", "not_in", "like", "ilike", "not_like", "not_ilike", "not_rlike", "rlike", "gt", "ge", "lt", "le", "between" - value (str, optional): The value that the condition checks for in the specified field. Use this attribute when using an operator that requires a single value. - values (list of str, optional): The values that the condition checks for in the specified field. Use this attribute when using an operator that requires multiple values. - returns (list of str, optional): The fields to return :type json: dict :returns: returns a dict containing the search results :rtype: dict