@@ -80,7 +80,7 @@ def add_alert_rule(self, alert_rule: AlertRule, disable_provenance: bool = False
8080 api_call : dict = Api (self .grafana_api_model ).call_the_api (
8181 f"{ APIEndpoints .ALERTING_PROVISIONING .value } /alert-rules" ,
8282 RequestsMethods .POST ,
83- json .dumps (self .__create_alert_rule_dictionary (alert_rule )),
83+ json .dumps (self ._create_alert_rule_dictionary (alert_rule )),
8484 response_status_code = True ,
8585 disable_provenance_header = disable_provenance ,
8686 )
@@ -116,7 +116,7 @@ def update_alert_rule(
116116 api_call : dict = Api (self .grafana_api_model ).call_the_api (
117117 f"{ APIEndpoints .ALERTING_PROVISIONING .value } /alert-rules/{ uid } " ,
118118 RequestsMethods .PUT ,
119- json .dumps (self .__create_alert_rule_dictionary (alert_rule )),
119+ json .dumps (self ._create_alert_rule_dictionary (alert_rule )),
120120 response_status_code = True ,
121121 disable_provenance_header = disable_provenance ,
122122 )
@@ -390,7 +390,7 @@ def add_notification_policies(self, route: Route, disable_provenance: bool = Fal
390390 api_call : dict = Api (self .grafana_api_model ).call_the_api (
391391 f"{ APIEndpoints .ALERTING_PROVISIONING .value } /policies" ,
392392 RequestsMethods .PUT ,
393- json .dumps (self .__create_alert_route_dictionary (route )),
393+ json .dumps (self ._create_alert_route_dictionary (route )),
394394 response_status_code = True ,
395395 disable_provenance_header = disable_provenance ,
396396 )
@@ -473,7 +473,7 @@ def add_mute_timing(
473473 api_call : dict = Api (self .grafana_api_model ).call_the_api (
474474 f"{ APIEndpoints .ALERTING_PROVISIONING .value } /mute-timings" ,
475475 RequestsMethods .POST ,
476- json .dumps (self .__create_mute_timing_dictionary (mute_time_interval )),
476+ json .dumps (self ._create_mute_timing_dictionary (mute_time_interval )),
477477 response_status_code = True ,
478478 disable_provenance_header = disable_provenance ,
479479 )
@@ -512,7 +512,7 @@ def update_mute_timing(
512512 api_call : dict = Api (self .grafana_api_model ).call_the_api (
513513 f"{ APIEndpoints .ALERTING_PROVISIONING .value } /mute-timings/{ name } " ,
514514 RequestsMethods .PUT ,
515- json .dumps (self .__create_mute_timing_dictionary (mute_time_interval )),
515+ json .dumps (self ._create_mute_timing_dictionary (mute_time_interval )),
516516 response_status_code = True ,
517517 disable_provenance_header = disable_provenance ,
518518 )
@@ -671,7 +671,7 @@ def delete_message_template(self, name: str):
671671 logging .error ("There is no name defined." )
672672 raise ValueError
673673
674- def __create_mute_timing_dictionary (
674+ def _create_mute_timing_dictionary (
675675 self , mute_time_interval : MuteTimeInterval
676676 ) -> dict :
677677 """The method includes a functionality to create the mute timing dictionary
@@ -686,13 +686,13 @@ def __create_mute_timing_dictionary(
686686 return dict (
687687 {
688688 "name" : mute_time_interval .name ,
689- "time_intervals" : self .__create_mute_timing_interval_list (
689+ "time_intervals" : self ._create_mute_timing_interval_list (
690690 mute_time_interval .time_intervals
691691 ),
692692 }
693693 )
694694
695- def __create_mute_timing_interval_list (
695+ def _create_mute_timing_interval_list (
696696 self , time_intervals : List [TimeInterval ]
697697 ) -> (list , None ):
698698 """The method includes a functionality to create the mute timing interval list
@@ -712,7 +712,7 @@ def __create_mute_timing_interval_list(
712712 {
713713 "days_of_month" : time_interval .days_of_month ,
714714 "months" : time_interval .months ,
715- "times" : self .__create_time_range_list (time_interval .times ),
715+ "times" : self ._create_time_range_list (time_interval .times ),
716716 "weekdays" : time_interval .weekdays ,
717717 "years" : time_interval .years ,
718718 }
@@ -723,7 +723,7 @@ def __create_mute_timing_interval_list(
723723 return time_intervals
724724
725725 @staticmethod
726- def __create_time_range_list (timing : List [TimeRange ]) -> (list , None ):
726+ def _create_time_range_list (timing : List [TimeRange ]) -> (list , None ):
727727 """The method includes a functionality to create the time range list
728728
729729 Args:
@@ -745,7 +745,7 @@ def __create_time_range_list(timing: List[TimeRange]) -> (list, None):
745745 else :
746746 return timing
747747
748- def __create_alert_route_dictionary (self , route : Route ) -> dict :
748+ def _create_alert_route_dictionary (self , route : Route ) -> dict :
749749 """The method includes a functionality to create the alert route dictionary
750750
751751 Args:
@@ -761,18 +761,18 @@ def __create_alert_route_dictionary(self, route: Route) -> dict:
761761 "group_by" : route .group_by_str ,
762762 "mute_time_intervals" : route .mute_time_intervals ,
763763 "receiver" : route .receiver ,
764- "routes" : self .__create_alert_routes_list (route .routes ),
764+ "routes" : self ._create_alert_routes_list (route .routes ),
765765 "group_interval" : route .group_interval ,
766766 "group_wait" : route .group_wait ,
767- "object_matchers" : self .__create_object_matcher_list (
767+ "object_matchers" : self ._create_object_matcher_list (
768768 route .object_matchers
769769 ),
770770 "provenance" : route .provenance ,
771771 "repeat_interval" : route .repeat_interval ,
772772 }
773773 )
774774
775- def __create_alert_routes_list (self , routes : List [Route ]) -> (list , None ):
775+ def _create_alert_routes_list (self , routes : List [Route ]) -> (list , None ):
776776 """The method includes a functionality to create the alert route list
777777
778778 Args:
@@ -786,14 +786,14 @@ def __create_alert_routes_list(self, routes: List[Route]) -> (list, None):
786786
787787 if routes is not None and isinstance (routes , list ):
788788 for route in routes :
789- routes_list .append (self .__create_alert_route_dictionary (route ))
789+ routes_list .append (self ._create_alert_route_dictionary (route ))
790790
791791 return routes_list
792792 else :
793793 return routes
794794
795795 @staticmethod
796- def __create_object_matcher_list (matchers : List [Matcher ]) -> (list , None ):
796+ def _create_object_matcher_list (matchers : List [Matcher ]) -> (list , None ):
797797 """The method includes a functionality to create the object matcher list
798798
799799 Args:
@@ -821,7 +821,7 @@ def __create_object_matcher_list(matchers: List[Matcher]) -> (list, None):
821821 else :
822822 return matchers
823823
824- def __create_alert_rule_dictionary (self , alert_rule : AlertRule ) -> dict :
824+ def _create_alert_rule_dictionary (self , alert_rule : AlertRule ) -> dict :
825825 """The method includes a functionality to create the alert rule dictionary
826826
827827 Args:
@@ -835,7 +835,7 @@ def __create_alert_rule_dictionary(self, alert_rule: AlertRule) -> dict:
835835 {
836836 "annotations" : alert_rule .annotations ,
837837 "condition" : alert_rule .condition ,
838- "data" : self .__create_alert_rule_query_list (alert_rule .data ),
838+ "data" : self ._create_alert_rule_query_list (alert_rule .data ),
839839 "execErrState" : alert_rule .exec_err_state ,
840840 "folderUID" : alert_rule .folder_uid ,
841841 "id" : alert_rule .id ,
@@ -851,7 +851,7 @@ def __create_alert_rule_dictionary(self, alert_rule: AlertRule) -> dict:
851851 }
852852 )
853853
854- def __create_alert_rule_query_list (self , alert_queries : List [AlertQuery ]) -> list :
854+ def _create_alert_rule_query_list (self , alert_queries : List [AlertQuery ]) -> list :
855855 """The method includes a functionality to create the alert rule query list
856856
857857 Args:
@@ -867,7 +867,7 @@ def __create_alert_rule_query_list(self, alert_queries: List[AlertQuery]) -> lis
867867 alert_query_dict : dict = dict (
868868 {
869869 "datasourceUID" : alert_query .datasource_uid ,
870- "model" : self .__create_alert_rule_query_model_dictionary (
870+ "model" : self ._create_alert_rule_query_model_dictionary (
871871 alert_query .model
872872 ),
873873 "queryType" : alert_query .query_type ,
@@ -883,7 +883,7 @@ def __create_alert_rule_query_list(self, alert_queries: List[AlertQuery]) -> lis
883883
884884 return alert_rule_queries_list
885885
886- def __create_alert_rule_query_model_dictionary (
886+ def _create_alert_rule_query_model_dictionary (
887887 self , alert_query_model : AlertRuleQueryModel
888888 ) -> dict :
889889 """The method includes a functionality to create the alert rule query model dictionary
@@ -897,7 +897,7 @@ def __create_alert_rule_query_model_dictionary(
897897
898898 return dict (
899899 {
900- "conditions" : self .__create_alert_rule_query_model_condition_list (
900+ "conditions" : self ._create_alert_rule_query_model_condition_list (
901901 alert_query_model .conditions
902902 ),
903903 "datasource" : alert_query_model .datasource ,
@@ -911,7 +911,7 @@ def __create_alert_rule_query_model_dictionary(
911911 )
912912
913913 @staticmethod
914- def __create_alert_rule_query_model_condition_list (
914+ def _create_alert_rule_query_model_condition_list (
915915 alert_rule_query_model_conditions : List [AlertRuleQueryModelCondition ],
916916 ) -> list :
917917 """The method includes a functionality to create the alert rule query model condition list
0 commit comments