diff --git a/CHANGELOG.md b/CHANGELOG.md index e6d19f1..c89762d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,14 @@ +# 4.2.0 + +Add support for multiple clusters in trigger creation + +Now you can use `cluster_id` field in api to set non-default cluster for remote triggers. List of available clusters can be seen in api at `https://your-moira-url/api/config` + # 4.1.0 Add support for prometheus trigger creation. -Now you canuse `trigger_source` field in api that overrides `is_remote` field +Now you can use `trigger_source` field in api that overrides `is_remote` field # 4.0.2 diff --git a/VERSION.txt b/VERSION.txt index 9d086c6..ef8d756 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -4.1.4 \ No newline at end of file +4.2.0 \ No newline at end of file diff --git a/moira_client/models/trigger.py b/moira_client/models/trigger.py index a6430a6..01512bc 100644 --- a/moira_client/models/trigger.py +++ b/moira_client/models/trigger.py @@ -37,6 +37,7 @@ def __init__( mute_new_metrics=False, alone_metrics=None, trigger_source=None, + cluster_id=None, **kwargs): """ @@ -57,6 +58,7 @@ def __init__( :param alone_metrics: dict with targets of alone metrics :param kwargs: additional parameters :param trigger_source: str specify trigger source, overrides is_remote + :param cluster_id: str specify cluster id """ self._client = client @@ -75,6 +77,7 @@ def __init__( self.is_remote = is_remote self.trigger_source = trigger_source + self.cluster_id = cluster_id self.mute_new_metrics = mute_new_metrics self.alone_metrics = alone_metrics @@ -153,6 +156,8 @@ def _send_request(self, trigger_id=None): if self.trigger_source: data['trigger_source'] = self.trigger_source + if self.cluster_id: + data['cluster_id'] = self.cluster_id if trigger_id: data['id'] = trigger_id @@ -529,6 +534,7 @@ def create( mute_new_metrics=False, alone_metrics=None, trigger_source=None, + cluster_id=None, **kwargs ): """ @@ -549,6 +555,7 @@ def create( :param alone_metrics: dict with targets of alone metrics :param kwargs: additional trigger params :param trigger_source: str specify trigger source, overrides is_remote + :param cluster_id: str specify cluster id :return: Trigger """ return Trigger( @@ -568,6 +575,7 @@ def create( mute_new_metrics=mute_new_metrics, alone_metrics=alone_metrics, trigger_source=trigger_source, + cluster_id=cluster_id, **kwargs )