Skip to content

dp3.common.entityspec

ImmortalLifetime

Bases: SpecModel

Immortal lifetime specification.

The entity is never deleted.

TimeToLiveLifetime

Bases: SpecModel

TTL lifetime specification.

The entity is deleted after all of its TTL tokens expire. TTL tokens can be attached to new data datapoints on per-attribute basis (see AttrSpecGeneric), set to mirror the lifetime of the data (mirror_data), or sent explicitly using the API (see /entity/{etype}/{eid}/ttl).

Attributes:

Name Type Description
on_create ParsedTimedelta

The base lifetime of an entity.

mirror_data bool

If True (default), the lifetime of the entity is extended by the max_age of the incoming observations and timeseries data-points.

WeakLifetime

Bases: SpecModel

Weak entity lifetime specification

EntitySpec

Bases: SpecModel

Entity specification

This class represents specification of an entity type (e.g. ip, asn, ...)

Attributes:

Name Type Description
id str

Entity type identifier

id_data_type EidDataType

Entity type identifier data type

name str

User-friendly entity type name for display

snapshot bool

If True, the entity type supports snapshots

lifetime Union[ImmortalLifetime, TimeToLiveLifetime, WeakLifetime]

Entity lifetime specification

description str

Entity type description

fill_validator

fill_validator()

Fill the eid_validator attribute.

Source code in dp3/common/entityspec.py
@model_validator(mode="after")
def fill_validator(self):
    """Fill the `eid_validator` attribute."""
    self._eid_validator = self.id_data_type.data_type
    return self