Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
docs: Added compare intent docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjeff07 committed Dec 16, 2021
1 parent 8562048 commit f8ee33d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ipfabric/intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ def get_results(self, intent: IntentCheck, color: Union[str, int], snapshot_id:
return self.client.fetch_all(intent.api_endpoint, snapshot_id=snapshot_id, reports=intent.web_endpoint,
filters={intent.column: ['color', 'eq', color]})

def compare_snapshot(self, snapshot_id: str = None, reverse: bool = False):
def compare_snapshot(self, snapshot_id: str, reverse: bool = False):
"""
Compares all intents against another snapshot.
Current is the snapshot loaded into the class
Other is the snapshot specified in this method. Use reverse=True to flip them.
:param snapshot_id: str: Snapshot ID to compare against this will be the "other" key
:param reverse: bool: Default False, setting to true will flip current and other.
:return: list: List of dictionaries
"""
new_intents = {i.name: i for i in self.get_intent_checks(snapshot_id)}
comparison = list()
for name, intent in new_intents.items():
Expand Down

0 comments on commit f8ee33d

Please sign in to comment.