moira-python-client 4.0.2__py3-none-any.whl → 4.1.1__py3-none-any.whl
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.
- moira_client/models/trigger.py +27 -15
- {moira_python_client-4.0.2.dist-info → moira_python_client-4.1.1.dist-info}/METADATA +2 -2
- {moira_python_client-4.0.2.dist-info → moira_python_client-4.1.1.dist-info}/RECORD +6 -6
- {moira_python_client-4.0.2.dist-info → moira_python_client-4.1.1.dist-info}/WHEEL +1 -1
- {moira_python_client-4.0.2.dist-info → moira_python_client-4.1.1.dist-info}/LICENSE +0 -0
- {moira_python_client-4.0.2.dist-info → moira_python_client-4.1.1.dist-info}/top_level.txt +0 -0
moira_client/models/trigger.py
CHANGED
|
@@ -12,6 +12,9 @@ RISING_TRIGGER = 'rising'
|
|
|
12
12
|
FALLING_TRIGGER = 'falling'
|
|
13
13
|
EXPRESSION_TRIGGER = 'expression'
|
|
14
14
|
|
|
15
|
+
GRAPHITE_LOCAL = 'graphite_local'
|
|
16
|
+
GRAPHITE_REMOTE = 'graphite_remote'
|
|
17
|
+
PROMETHEUS_REMOTE = 'prometheus_remote'
|
|
15
18
|
|
|
16
19
|
class Trigger(Base):
|
|
17
20
|
QUERY_PARAM_VALIDATE_FLAG = 'validate'
|
|
@@ -33,6 +36,7 @@ class Trigger(Base):
|
|
|
33
36
|
is_remote=False,
|
|
34
37
|
mute_new_metrics=False,
|
|
35
38
|
alone_metrics=None,
|
|
39
|
+
trigger_source=None,
|
|
36
40
|
**kwargs):
|
|
37
41
|
"""
|
|
38
42
|
|
|
@@ -52,6 +56,7 @@ class Trigger(Base):
|
|
|
52
56
|
:param mute_new_metrics: bool mute new metrics
|
|
53
57
|
:param alone_metrics: dict with targets of alone metrics
|
|
54
58
|
:param kwargs: additional parameters
|
|
59
|
+
:param trigger_source: str specify trigger source, overrides is_remote
|
|
55
60
|
"""
|
|
56
61
|
self._client = client
|
|
57
62
|
|
|
@@ -69,6 +74,7 @@ class Trigger(Base):
|
|
|
69
74
|
self.trigger_type = self.resolve_type(trigger_type)
|
|
70
75
|
|
|
71
76
|
self.is_remote = is_remote
|
|
77
|
+
self.trigger_source = trigger_source
|
|
72
78
|
self.mute_new_metrics = mute_new_metrics
|
|
73
79
|
self.alone_metrics = alone_metrics
|
|
74
80
|
|
|
@@ -145,6 +151,9 @@ class Trigger(Base):
|
|
|
145
151
|
'alone_metrics': self.alone_metrics,
|
|
146
152
|
}
|
|
147
153
|
|
|
154
|
+
if self.trigger_source:
|
|
155
|
+
data['trigger_source'] = self.trigger_source
|
|
156
|
+
|
|
148
157
|
if trigger_id:
|
|
149
158
|
data['id'] = trigger_id
|
|
150
159
|
api_response = TriggerManager(self._client).fetch_by_id(trigger_id)
|
|
@@ -519,6 +528,7 @@ class TriggerManager:
|
|
|
519
528
|
is_remote=False,
|
|
520
529
|
mute_new_metrics=False,
|
|
521
530
|
alone_metrics=None,
|
|
531
|
+
trigger_source=None,
|
|
522
532
|
**kwargs
|
|
523
533
|
):
|
|
524
534
|
"""
|
|
@@ -538,24 +548,26 @@ class TriggerManager:
|
|
|
538
548
|
:param mute_new_metrics: bool mute new metrics
|
|
539
549
|
:param alone_metrics: dict with targets of alone metrics
|
|
540
550
|
:param kwargs: additional trigger params
|
|
551
|
+
:param trigger_source: str specify trigger source, overrides is_remote
|
|
541
552
|
:return: Trigger
|
|
542
553
|
"""
|
|
543
554
|
return Trigger(
|
|
544
|
-
self._client,
|
|
545
|
-
name,
|
|
546
|
-
tags,
|
|
547
|
-
targets,
|
|
548
|
-
warn_value,
|
|
549
|
-
error_value,
|
|
550
|
-
desc,
|
|
551
|
-
ttl,
|
|
552
|
-
ttl_state,
|
|
553
|
-
sched,
|
|
554
|
-
expression,
|
|
555
|
-
trigger_type,
|
|
556
|
-
is_remote,
|
|
557
|
-
mute_new_metrics,
|
|
558
|
-
alone_metrics,
|
|
555
|
+
client=self._client,
|
|
556
|
+
name=name,
|
|
557
|
+
tags=tags,
|
|
558
|
+
targets=targets,
|
|
559
|
+
warn_value=warn_value,
|
|
560
|
+
error_value=error_value,
|
|
561
|
+
desc=desc,
|
|
562
|
+
ttl=ttl,
|
|
563
|
+
ttl_state=ttl_state,
|
|
564
|
+
sched=sched,
|
|
565
|
+
expression=expression,
|
|
566
|
+
trigger_type=trigger_type,
|
|
567
|
+
is_remote=is_remote,
|
|
568
|
+
mute_new_metrics=mute_new_metrics,
|
|
569
|
+
alone_metrics=alone_metrics,
|
|
570
|
+
trigger_source=trigger_source,
|
|
559
571
|
**kwargs
|
|
560
572
|
)
|
|
561
573
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: moira-python-client
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.1.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
|
|
@@ -19,7 +19,7 @@ Classifier: Topic :: Utilities
|
|
|
19
19
|
Classifier: Topic :: System :: Monitoring
|
|
20
20
|
Classifier: License :: OSI Approved :: MIT License
|
|
21
21
|
License-File: LICENSE
|
|
22
|
-
Requires-Dist: requests
|
|
22
|
+
Requires-Dist: requests >=2.4.3
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
Moira is a real-time alerting tool, based on Graphite data.
|
|
@@ -11,10 +11,10 @@ moira_client/models/notification.py,sha256=stk78RW0lENkBX7FHm9cTskHkz8SxdXmpcXP7
|
|
|
11
11
|
moira_client/models/pattern.py,sha256=Ef8Roupkjrs8gb41vrgBwvgpgTmJU4igsU58z19LHcg,1619
|
|
12
12
|
moira_client/models/subscription.py,sha256=xyB8MXM6mC0VjE_2aezBnSSaFER9u4LAQ0kJuzJsxas,7891
|
|
13
13
|
moira_client/models/tag.py,sha256=2sDmf9CKAzzZRqQykBdR3-jKgcfo62hGO7eivI1X_sc,4336
|
|
14
|
-
moira_client/models/trigger.py,sha256=
|
|
14
|
+
moira_client/models/trigger.py,sha256=FdRIo6139Xpi2gwmHer3pA-vphnQxrPj6YihpKkR44M,17559
|
|
15
15
|
moira_client/models/user.py,sha256=9zG7pbmEA9ESUWFMzvqfyLP0lqcjz1pc0n8U7mL1UMk,1767
|
|
16
|
-
moira_python_client-4.
|
|
17
|
-
moira_python_client-4.
|
|
18
|
-
moira_python_client-4.
|
|
19
|
-
moira_python_client-4.
|
|
20
|
-
moira_python_client-4.
|
|
16
|
+
moira_python_client-4.1.1.dist-info/LICENSE,sha256=HJk93uYDrJpwAa6G3ufYfC4ZgCKH2flOtdgOv1esxgI,1062
|
|
17
|
+
moira_python_client-4.1.1.dist-info/METADATA,sha256=WWlh7OIgNyhsF92eVh0lc6GyJnAXIfvxDtAQ7f5_bE4,1243
|
|
18
|
+
moira_python_client-4.1.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
19
|
+
moira_python_client-4.1.1.dist-info/top_level.txt,sha256=zBB6_FP28feugBNn2cLmi5nCniRPnuChI6HuXUqFdIA,13
|
|
20
|
+
moira_python_client-4.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|