original_docstring: Update all scrape configuration jobs in all downstreams.
docstring: Update all scrape configuration jobs in all downstreams.
docstring_tokens: Update all scrape configuration jobs in all downstreams .
code: def _update_all_downstreams(self, _):
          """Update all scrape configuration jobs in all downstreams."""
          if not self.unit.is_leader():
              return
  
          if (
              "metrics-endpoint" not in self.model.relations
              or not self.model.relations["metrics-endpoint"]
          ):
              self.unit.status = BlockedStatus("downstream relations missing")
              return
  
          self.unit.status = MaintenanceStatus(
              "Updating scrape jobs and alert rules to all downstreams"
          )
  
          self._update_downstream_relations(self.model.relations[self._prometheus_relation_name])
  
          self.unit.status = ActiveStatus()
code_tokens: def _update_all_downstreams ( self , _ ) : if not self . unit . is_leader ( ) : return if ( "metrics-endpoint" not in self . model . relations or not self . model . relations [ "metrics-endpoint" ] ) : self . unit . status = BlockedStatus ( "downstream relations missing" ) return self . unit . status = MaintenanceStatus ( "Updating scrape jobs and alert rules to all downstreams" ) self . _update_downstream_relations ( self . model . relations [ self . _prometheus_relation_name ] ) self . unit . status = ActiveStatus ( )
short_docstring: Update all scrape configuration jobs in all downstreams.
short_docstring_tokens: Update all scrape configuration jobs in all downstreams .
comment: """Update all scrape configuration jobs in all downstreams."""