Traffic Object

class activelogic.TrafficObject

Object representing a dataset for export to Insights Data Storage or Kafka.

Parameters:
  • name (str) – Name of the object.

  • TrafficObjectFlags – Object flags.

  • id (int) – Id of the object.

  • export_format (TrafficObjectExportFormat) – Export format.

  • table_name (str) – Name of Insights Data Storage table to write data to.

  • dimensions (str) – Dimensions.

  • partition_key (str) – Which of the dimensions that should serve as partition key.

  • metrics (str) – Metrics.

  • min_bytes_in (int) – Min bytes in (default 0).

  • min_bytes_out (int) – Min bytes out (default 0).

dimensions, partition_keys and metrics are all given as comma-separated strings. Some dimensions may expect data that is given within angular brackets. Use Ruleset.list() to list available dimensions and metrics. See also TrafficObjectDimension and TrafficObjectMetric.

>>> [d for d in rs.list(TrafficObjectDimension) if d.name.startswith('ip')]
[TrafficObjectDimension(id=1, flags=0, name='ip_address', display_name='IP Address'), ... ]
>>> rs.add(TrafficObject('myobj', TrafficObjectFlags.DUMP_TO_DISK,
...     dimensions='subscriber<subscriber>,ip_address',
...     partition_key='subscriber<subscriber>',
...     metrics='bytes_in,bytes_out'))
class activelogic.TrafficObjectExportFormat

Defines file format for exportation.

Variables:
  • CSV – Data will be exported in CSV format.

  • JSON – Data will be exported in JSON format.

class activelogic.TrafficObjectFlags

Defines a set of flags to tell where to export the data.

Variables:
  • NONE – Data will not be exported.

  • INSIGHTS – Data will be written to Insights Data Storage table.

  • KAFKA – Data will be exported via Kafka.

  • DUMP_TO_DISK – Data will be dumped to disk.

class activelogic.TrafficObjectDimension

Object representing definition of a dimension.

Parameters:
  • id (int) – The ID of the dimension.

  • flags (int) – Flags. Nonzero flag typically means that dimension takes data.

  • name (str) – The name of the dimension.

  • display_name (str) – The display name of the dimension.

  • doc (str) – Additional documentation of the dimension.

class activelogic.TrafficObjectMetric

Object representing definition of a metric.

Parameters:
  • id (int) – The ID of the metric.

  • flags (int) – Flags.

  • name (str) – The name of the metric.

  • display_name (str) – The display name of the metric.

  • doc (str) – Additional documentation of the metric.