def handle(self, **kwargs): if kwargs['out']: prometheus.write_rules( path=kwargs['out'], reload=kwargs['reload'], version=kwargs['version'] ) else: self.stdout.write(prometheus.render_rules(version=kwargs['version']))
def handle(self, **kwargs): if kwargs['out']: prometheus.write_rules(path=kwargs['out'], reload=kwargs['reload'], version=kwargs['version']) else: # Since we're already working with utf8 encoded data, we can skip # the newline ending here self.stdout.ending = None self.stdout.write( prometheus.render_rules(version=kwargs['version']))
def handle(self, **kwargs): prometheus.check_rules(models.Rule.objects.all()) if kwargs['out']: prometheus.write_rules(kwargs['out'], kwargs['reload']) else: self.stdout.write(prometheus.render_rules())
def post(self, request): prometheus.write_rules() return HttpResponse('OK', status=202)