Skip to content

Function that removes all filtered streaming rules #87

@mr-devs

Description

@mr-devs

Since it seems like filtered streaming rules persist unless the user removes them (see #85 for an issue seeking to confirm this is true), a simple function that removes all existing filter rules seems like it would be useful.

Something like the below

def remove_all_filter_rules(ot)
    current_rules = ot.get_filtered_stream_rule()
    print(f'The current filtered stream rules are:\n{current_rules}\n')
    
    # Get all streaming rule ids and then remove them
    all_rules = [rule["id"] for rule in current_rules["data"]]
    delete_rule = {'delete': {'ids': all_rules}}
    response = ot.set_filtered_stream_rule(rules=delete_rule)
    print(f"API response from deleting rules:\n{response}\n")

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions