Documentation for PythonAPI
22.40.00py2

trafficobject

This module contains TrafficObject implementation.

There is no need to import this module directly. Use the methods of the Ruleset object to create and manipulate TrafficObjects.

>>> o = r.trafficobject_add('Test TrafficObject')

Classes defined here:

TrafficObject

Base class for TrafficObjects.

This class should not be instantiated and should instead be created and accessed through:

  • Ruleset.trafficobject_add
  • Ruleset.trafficobject_find
  • Ruleset.trafficobject_find_id
  • Ruleset.trafficobject_list
  • Ruleset.trafficobject_remove

Class variables are read-only, use methods to alter the object.

Methods:
Ungrouped rename(self, newname)
Rename the current object
set_dimensions(self, new_dimensions)
Set 'dimensions' class variable
set_export_format(self, new_export_format)
Set 'export_format' class variable
set_flags(self, *reset, **flags)
Set or reset one or more of the flags of the TrafficObject
set_metrics(self, new_metrics)
Set 'metrics' class variable
set_partition_key(self, new_partition_key)
Set 'partition_key' class variable
set_table_name(self, new_table_name)
Set 'table_name' class variable
Properties:
creation_date Date and time when this object was created
creator Username that created this object
dimensions Comma separated string with the dimensions to be collected for this
export_format Export type
flags TrafficObjectFlags object containing the flags set on this TrafficObject
id id number of this object
is_global True if this object resides on another system
metrics Comma separated string with the metrics to be collected for this
modification_date Date and time when this object was last modified
modified_by Username that last modified this object
name Name of the TrafficObject
partition_key Comma separated string with with the dimensions that will for the
systemid System ID of the PacketLogic this object belongs to
table_name Name of table that the TrafficObject will be published to

rename(self, newname)

Rename the current object

destroys netobject cache

Parameters:
  • newname (str) - The name that the object should have after rename process

set_dimensions(self, new_dimensions)

Set 'dimensions' class variable

Parameters:
  • new_dimensions (str ) - The dimensions that should be set for the object

set_export_format(self, new_export_format)

Set 'export_format' class variable

Parameters:
  • new_export_format (int ) - The export format that should be set for the object

set_flags(self, *reset, **flags)

Set or reset one or more of the flags of the TrafficObject. You may also reset all flags with the single argument None, or clone an existing flags object. You may combine them.

If only keyword argument(s) are used, only the specified flags will be affected. For a list of valid flags see the TrafficObjectFlags class. Use a trueish value to set the flag, or falseish value to reset it.

>>> obj.set_flags(insights=True, kafka=False)
>>> obj.flags
TrafficObjectFlags(insights=True)
>>> obj.set_flags(None)
>>> obj.flags
TrafficObjectFlags(None)
>>> obj.set_flags(another_shobj.flags)
>>> obj.flags
TrafficObjectFlags(dump_to_disk=True)
>>> obj.set_flags(None, kafka=True)
>>> obj.flags
TrafficObjectFlags(insights=True)

set_metrics(self, new_metrics)

Set 'metrics' class variable

Parameters:
  • new_metrics (str ) - The metrics that should be set for the object

set_partition_key(self, new_partition_key)

Set 'partition_key' class variable

Parameters:
  • new_partition_key (str ) - The partition key that should be set for the object

set_table_name(self, new_table_name)

Set 'table_name' class variable

Parameters:
  • new_table_name () - The table name that should be set for the object
  • new_export_format (int ) -

creation_date

Date and time when this object was created

creator

Username that created this object

dimensions

Comma separated string with the dimensions to be collected for this TrafficObject

export_format

Export type

flags

TrafficObjectFlags object containing the flags set on this TrafficObject

id

id number of this object

is_global

True if this object resides on another system

metrics

Comma separated string with the metrics to be collected for this TrafficObject

modification_date

Date and time when this object was last modified

modified_by

Username that last modified this object

name

Name of the TrafficObject

partition_key

Comma separated string with with the dimensions that will for the Partition key for this TrafficObject

systemid

System ID of the PacketLogic this object belongs to.

table_name

Name of table that the TrafficObject will be published to

TrafficObjectDimension

Undocumented!
Properties:
column The column name used when exporting the data
display_name Descriptive name of the TrafficObject dimension
doc Documentation for the TrafficObject dimension
flags TrafficObject dimension flags
id id number of the TrafficObject dimension
name Name of the TrafficObject dimension in exports

column

The column name used when exporting the data

display_name

Descriptive name of the TrafficObject dimension

doc

Documentation for the TrafficObject dimension

flags

TrafficObject dimension flags

id

id number of the TrafficObject dimension

name

Name of the TrafficObject dimension in exports

TrafficObjectFlags

Used internaly to represent the flags on a TrafficObject.

Use TrafficObjects.set_flags to change the flags.

Inherits from: BaseFlags
Methods:
Inherited from BaseFlags items(self)
Return a list of (prop, value) tuples, similar to dict.items()
Properties:
dump_to_disk Enable dump to disk for object
ipfix Enable export of object to Insights Data Storage
kafka Enable export of object over Kafka

items(self)

Return a list of (prop, value) tuples, similar to dict.items().

dump_to_disk

Enable dump to disk for object

ipfix

Enable export of object to Insights Data Storage

kafka

Enable export of object over Kafka

TrafficObjectMetric

Undocumented!
Properties:
display_name Descriptive name of the TrafficObject metric
doc Documentation for the TrafficObject metric
flags TrafficObject metric flags
id id number of the TrafficObject metric
name Name of the TrafficObject metric in exports

display_name

Descriptive name of the TrafficObject metric

doc

Documentation for the TrafficObject metric

flags

TrafficObject metric flags

id

id number of the TrafficObject metric

name

Name of the TrafficObject metric in exports