Promgen Models

class promgen.models.Alert(id, created, body, sent_count, error_count)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.AlertError(id, alert, created, message)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.AlertLabel(id, alert, name, value)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.Audit(id, body, created, data, old, content_type, object_id, user)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.BaseExporter(*args, **kwargs)[source]
class promgen.models.DefaultExporter(id, job, port, path, scheme)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.Exporter(id, job, port, path, scheme, project, enabled)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.Farm(id, name, source)[source]
exception DoesNotExist
exception MultipleObjectsReturned
driver

Return configured driver for Farm model instance

classmethod driver_set()[source]

Return the list of drivers for Farm model

class promgen.models.Filter(id, sender, name, value)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.Host(id, name, farm)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.Probe(id, module, description)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.Project(id, name, description, owner, service, shard, farm)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.Prometheus(id, shard, host, port)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.Rule(id, name, clause, duration, enabled, parent, content_type, object_id, description, labels, annotations)[source]
exception DoesNotExist
exception MultipleObjectsReturned
copy_to(content_type, object_id)[source]

Make a copy under a new service

It’s important that we set pk to None so a new object is created, but we also need to ensure the new name is unique by appending some unique data to the end of the name

save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

class promgen.models.Sender(id, sender, value, alias, content_type, object_id, owner, enabled)[source]
exception DoesNotExist
exception MultipleObjectsReturned
property driver

Return configured driver for Sender model instance

classmethod driver_set()[source]

Return the list of drivers for Sender model

filtered(alert)[source]

Check filters for a specific sender

If no filters are defined, then we let the message through If filters are defined, then we check to see if at least one filter matches If no filters match, then we assume it’s filtered out

test()[source]

Test sender plugin

Uses the same test json from our unittests but subs in the currently tested object as part of the test data

class promgen.models.Service(id, name, description, owner)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.Shard(id, name, url, authorization, proxy, enabled, samples, targets)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.Site(id, domain, name)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class promgen.models.URL(id, url, project, probe)[source]
exception DoesNotExist
exception MultipleObjectsReturned