moira-python-client 5.1.1__tar.gz → 5.2.1__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.
Files changed (46) hide show
  1. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/CHANGELOG.md +8 -0
  2. {moira_python_client-5.1.1/moira_python_client.egg-info → moira_python_client-5.2.1}/PKG-INFO +1 -1
  3. moira_python_client-5.2.1/VERSION.txt +1 -0
  4. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/trigger.py +35 -2
  5. {moira_python_client-5.1.1 → moira_python_client-5.2.1/moira_python_client.egg-info}/PKG-INFO +1 -1
  6. moira_python_client-5.1.1/VERSION.txt +0 -1
  7. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/LICENSE +0 -0
  8. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/MANIFEST.in +0 -0
  9. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/README.md +0 -0
  10. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/__init__.py +0 -0
  11. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/client.py +0 -0
  12. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/__init__.py +0 -0
  13. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/base.py +0 -0
  14. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/config.py +0 -0
  15. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/contact.py +0 -0
  16. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/event.py +0 -0
  17. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/health.py +0 -0
  18. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/notification.py +0 -0
  19. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/pattern.py +0 -0
  20. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/subscription.py +0 -0
  21. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/system_tag.py +0 -0
  22. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/tag.py +0 -0
  23. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/__init__.py +0 -0
  24. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/_managers.py +0 -0
  25. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/_models.py +0 -0
  26. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/contact/__init__.py +0 -0
  27. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/contact/_managers.py +0 -0
  28. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/settings/__init__.py +0 -0
  29. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/settings/_managers.py +0 -0
  30. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/settings/_models.py +0 -0
  31. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/subscription/__init__.py +0 -0
  32. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/subscription/_managers.py +0 -0
  33. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/user/__init__.py +0 -0
  34. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/user/_managers.py +0 -0
  35. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/team/user/_models.py +0 -0
  36. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/models/user.py +0 -0
  37. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_client/moira.py +0 -0
  38. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_python_client.egg-info/SOURCES.txt +0 -0
  39. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_python_client.egg-info/dependency_links.txt +0 -0
  40. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_python_client.egg-info/requires.txt +0 -0
  41. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/moira_python_client.egg-info/top_level.txt +0 -0
  42. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/requirements.txt +0 -0
  43. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/setup.cfg +0 -0
  44. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/setup.py +0 -0
  45. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/test-requirements.txt +0 -0
  46. {moira_python_client-5.1.1 → moira_python_client-5.2.1}/tests/test_client.py +0 -0
@@ -1,3 +1,11 @@
1
+ # 5.2.1
2
+
3
+ In trigger model new fields were added: warn_for, warn_keep_firing_for, error_for, error_keep_firing_for
4
+
5
+ # 5.2.0
6
+
7
+ In trigger model new field was added: team_id
8
+
1
9
  # 5.1.1
2
10
 
3
11
  extra_message field in contact support
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moira-python-client
3
- Version: 5.1.1
3
+ Version: 5.2.1
4
4
  Summary: Client for Moira - Alerting system based on Graphite data
5
5
  Home-page: https://github.com/moira-alert/python-moira-client
6
6
  Author: Alexander Lukyanchenko
@@ -0,0 +1 @@
1
+ 5.2.1
@@ -25,8 +25,13 @@ class Trigger(Base):
25
25
  name,
26
26
  tags,
27
27
  targets,
28
+ team_id=None,
28
29
  warn_value=None,
30
+ warn_for=None,
31
+ warn_keep_firing_for=None,
29
32
  error_value=None,
33
+ error_for=None,
34
+ error_keep_firing_for=None,
30
35
  desc='',
31
36
  ttl=600,
32
37
  ttl_state=STATE_NODATA,
@@ -42,6 +47,7 @@ class Trigger(Base):
42
47
  """
43
48
 
44
49
  :param client: api client
50
+ :param team_id: str team id of a team that owns this trigger.
45
51
  :param name: str trigger name
46
52
  :param tags: list of str tags for trigger
47
53
  :param targets: list of str targets
@@ -63,11 +69,16 @@ class Trigger(Base):
63
69
  self._client = client
64
70
 
65
71
  self._id = kwargs.get('id', None)
72
+ self.team_id = team_id
66
73
  self.name = name
67
74
  self.tags = tags
68
75
  self.targets = targets
69
76
  self.warn_value = warn_value
77
+ self.warn_for = warn_for
78
+ self.warn_keep_firing_for = warn_keep_firing_for
70
79
  self.error_value = error_value
80
+ self.error_for = error_for
81
+ self.error_keep_firing_for = error_keep_firing_for
71
82
  self.desc = desc
72
83
  self.ttl = ttl
73
84
  self.ttl_state = ttl_state
@@ -139,10 +150,15 @@ class Trigger(Base):
139
150
  def _send_request(self, trigger_id=None):
140
151
  data = {
141
152
  'name': self.name,
153
+ 'team_id': self.team_id,
142
154
  'tags': self.tags,
143
155
  'targets': self.targets,
144
156
  'warn_value': self.warn_value,
157
+ 'warn_for': self.warn_for,
158
+ 'warn_keep_firing_for': self.warn_keep_firing_for,
145
159
  'error_value': self.error_value,
160
+ 'error_for': self.error_for,
161
+ 'error_keep_firing_for': self.error_keep_firing_for,
146
162
  'desc': self.desc,
147
163
  'ttl': self.ttl,
148
164
  'ttl_state': self.ttl_state,
@@ -338,13 +354,14 @@ class TriggerManager:
338
354
  elif not 'trigger_id' in result:
339
355
  raise ResponseStructureError("invalid api response", result)
340
356
 
341
- def search(self, only_problems, page, text):
357
+ def search(self, only_problems, page, text, team_id=''):
342
358
  """
343
359
  Search triggers
344
360
 
345
361
  :param only_problems: Restricts the result to errors only. Example: false
346
362
  :param page: Defines the number of the displayed page. E.g, page=2 would display the 2nd page. Example: 1
347
363
  :param text: Query to perform a search for. Example: cpu
364
+ :param team_id: str team id of a team that owns this trigger.
348
365
 
349
366
  :return: matching triggers list
350
367
 
@@ -354,8 +371,9 @@ class TriggerManager:
354
371
  'onlyProblems': only_problems,
355
372
  'page': page,
356
373
  'text': text,
374
+ 'teamID': team_id,
357
375
  }
358
- result = self._client.get(self._full_path(), params=params)
376
+ result = self._client.get(self._full_path('search'), params=params)
359
377
  if 'list' not in result:
360
378
  raise ResponseStructureError("list doesn't exist in response", result)
361
379
 
@@ -522,8 +540,13 @@ class TriggerManager:
522
540
  name,
523
541
  tags,
524
542
  targets,
543
+ team_id=None,
525
544
  warn_value=None,
545
+ warn_for=None,
546
+ warn_keep_firing_for=None,
526
547
  error_value=None,
548
+ error_for=None,
549
+ error_keep_firing_for=None,
527
550
  desc='',
528
551
  ttl=600,
529
552
  ttl_state=STATE_NODATA,
@@ -540,10 +563,15 @@ class TriggerManager:
540
563
  """
541
564
  Creates new trigger. To save it call save() method of Trigger.
542
565
  :param name: str trigger name
566
+ :param team_id: str team id of a team that owns this trigger.
543
567
  :param tags: list of str tags for trigger
544
568
  :param targets: list of str targets
545
569
  :param warn_value: float warning value (if T1 <= warn_value)
570
+ :param warn_for: float warning value; the condition must continuously evaluate to WARN status for this many seconds before the alert fires (0 = immediately).
571
+ :param warn_keep_firing_for: float warning value; the alert stays active WARN many seconds after the condition no longer evaluates to this status.
546
572
  :param error_value: float error value (if T1 <= error_value)
573
+ :param error_for: float error value; the condition must continuously evaluate to ERROR status for this many seconds before the alert fires (0 = immediately).
574
+ :param error_keep_firing_for: float error value; the alert stays active ERROR many seconds after the condition no longer evaluates to this status.
547
575
  :param desc: str trigger description
548
576
  :param ttl: int set ttl_state if has no value for ttl seconds
549
577
  :param ttl_state: str state after ttl seconds without data (one of STATE_* constants)
@@ -560,11 +588,16 @@ class TriggerManager:
560
588
  """
561
589
  return Trigger(
562
590
  client=self._client,
591
+ team_id=team_id,
563
592
  name=name,
564
593
  tags=tags,
565
594
  targets=targets,
566
595
  warn_value=warn_value,
596
+ warn_for=warn_for,
597
+ warn_keep_firing_for=warn_keep_firing_for,
567
598
  error_value=error_value,
599
+ error_for=error_for,
600
+ error_keep_firing_for=error_keep_firing_for,
568
601
  desc=desc,
569
602
  ttl=ttl,
570
603
  ttl_state=ttl_state,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moira-python-client
3
- Version: 5.1.1
3
+ Version: 5.2.1
4
4
  Summary: Client for Moira - Alerting system based on Graphite data
5
5
  Home-page: https://github.com/moira-alert/python-moira-client
6
6
  Author: Alexander Lukyanchenko
@@ -1 +0,0 @@
1
- 5.1.1