akips 0.4.2__tar.gz → 0.4.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: akips
3
- Version: 0.4.2
3
+ Version: 0.4.4
4
4
  Summary: Module to interact with the AKiPS Network Monitoring Software API interface
5
5
  Home-page: https://github.com/unc-network/akips
6
6
  License: MIT
@@ -1,15 +1,16 @@
1
1
  """This akips python module provides a simple way for python scripts to interact with
2
2
  the AKiPS Network Monitoring Software Web API interface."""
3
3
 
4
- __version__ = "0.4.2"
4
+ __version__ = "0.4.4"
5
5
 
6
+ import csv
6
7
  import io
7
- import re
8
8
  import logging
9
+ import re
9
10
  from datetime import datetime
10
- import requests
11
+
11
12
  import pytz
12
- import csv
13
+ import requests
13
14
 
14
15
  from akips.exceptions import AkipsError
15
16
 
@@ -208,7 +209,7 @@ class AKIPS:
208
209
  [any|all|not group {group name} ...]`
209
210
  """
210
211
  params = {
211
- "cmds": f"mgroup {device} *",
212
+ "cmds": f"mgroup * {device}",
212
213
  }
213
214
  if groups:
214
215
  group_list = " ".join(groups)
@@ -282,7 +283,7 @@ class AKIPS:
282
283
  [any|all|not group {group name} ...]`
283
284
  """
284
285
  params = {
285
- "cmds": f"mget * {device} {child} {attribute}/",
286
+ "cmds": f"mget * {device} {child} {attribute}",
286
287
  }
287
288
  if value:
288
289
  # [value {text|/regex/|integer|ipaddr}]
@@ -311,7 +312,9 @@ class AKIPS:
311
312
  return data
312
313
  return None
313
314
 
314
- def get_events(self, event_type="all", period="last1h"):
315
+ def get_events(
316
+ self, event_type="all", period="last1h", group_filter="any", groups=[]
317
+ ):
315
318
  """
316
319
  Pull a list of events.
317
320
 
@@ -322,6 +325,10 @@ class AKIPS:
322
325
  [any|all|not group {group name} ...]`
323
326
  """
324
327
  params = {"cmds": f"mget event {event_type} time {period}"}
328
+ if groups:
329
+ # [any|all|not group {group name} ...]
330
+ group_list = " ".join(groups)
331
+ params["cmds"] += f" {group_filter} group {group_list}"
325
332
  text = self._get(params=params)
326
333
  if text:
327
334
  data = []
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "akips"
3
- version = "0.4.2"
3
+ version = "0.4.4"
4
4
  description = "Module to interact with the AKiPS Network Monitoring Software API interface"
5
5
  authors = ["William E Whitaker <will.whitaker@unc.edu>"]
6
6
  readme = "README.md"
File without changes
File without changes
File without changes