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, parent_content_type_id, parent_object_id, user)[source]¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class promgen.models.AuthToken(digest, token_key, user, created, expiry, name)[source]¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class promgen.models.CustomLabel(id, label_name, display_name, description, model, is_required, is_added_to_metric)[source]¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class promgen.models.CustomLabelInstance(id, value, custom_label, content_type, object_id)[source]¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- 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, project)[source]¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- driver¶
Return configured driver for Farm model instance
- class promgen.models.Filter(id, sender, name, value)[source]¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class promgen.models.Group(id, name)[source]¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class promgen.models.Host(id, name, farm)[source]¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class promgen.models.Metric(id, name, type, description, labels)[source]¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class promgen.models.MetricSample(id, metric, labels, data)[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)[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¶
- override(content_type, object_id, **overrides)[source]¶
Make an overridden rule under a new content object
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¶
- clean()[source]¶
Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
- property driver¶
Return configured driver for Sender model instance
- 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
- 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.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¶