Documentation for PythonAPI
22.40.00py2

flowobject

This module contains FlowObject implementation.

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

>>> o = r.flowobject_add('Test FlowObject')

Classes defined here:

FlowObject

Base class for FlowObjects.

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

  • Ruleset.flowobject_add
  • Ruleset.flowobject_find
  • Ruleset.flowobject_find_id
  • Ruleset.flowobject_list
  • Ruleset.flowobject_remove

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

Methods:
Ungrouped rename(self, newname)
Rename the current object
set_collectors(self, new_collectors)
Set 'collectors' 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 FlowObject
set_partition_key(self, new_partition_key)
Set 'partition_key' class variable
set_templatestring(self, new_templatestring)
Set 'templatestring' class variable
Properties:
collectors IPFIX collectors
creation_date Date and time when this object was created
creator Username that created this object
export_format Export type
flags FlowObjectFlags object containing the flags set on this FlowObject
id id number of this object
is_global True if this object resides on another system (always false in 12.1)
machineid Use of property 'machineid' is deprecated since v11.0beta5, use 'systemid'
modification_date Date and time when this object was last modified
modified_by Username that last modified this object
name Name of the FlowObject
partition_key Partition key
systemid System ID of the PacketLogic this object belongs to
templatestring Template string

rename(self, newname)

Rename the current object

destroys netobject cache

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

set_collectors(self, new_collectors)

Set 'collectors' class variable

>>> flowobject.set_collectors("[172.21.54.23]:4739,[172.21.54.38]:2055")
Parameters:
  • new_collectors (str ) - The collectors 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 FlowObject. 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 FlowObjectFlags class. Use a trueish value to set the flag, or falseish value to reset it.

>>> obj.set_flags(ipfix=True, kafka=False)
>>> obj.flags
FlowObjectFlags(ipfix=True)
>>> obj.set_flags(None)
>>> obj.flags
FlowObjectFlags(None)
>>> obj.set_flags(another_shobj.flags)
>>> obj.flags
FlowObjectFlags(dump_to_disk=True)
>>> obj.set_flags(None, kafka=True)
>>> obj.flags
FlowObjectFlags(ipfix=True)

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_templatestring(self, new_templatestring)

Set 'templatestring' class variable

Parameters:
  • new_templatestring (str ) - The templatestring that should be set for the object

collectors

IPFIX collectors

creation_date

Date and time when this object was created

creator

Username that created this object

export_format

Export type

flags

FlowObjectFlags object containing the flags set on this FlowObject.

id

id number of this object

is_global

True if this object resides on another system (always false in 12.1)

machineid

Use of property 'machineid' is deprecated since v11.0beta5, use 'systemid' instead.

modification_date

Date and time when this object was last modified

modified_by

Username that last modified this object

name

Name of the FlowObject

partition_key

Partition key

systemid

System ID of the PacketLogic this object belongs to. (Replaces machineid)

templatestring

Template string

FlowObjectField

Undocumented!
Properties:
flags FlowObject field flags
id id number of the FlowObject field
name Name of the FlowObject field

flags

FlowObject field flags

id

id number of the FlowObject field

name

Name of the FlowObject field

FlowObjectFlags

Used internaly to represent the flags on a FlowObject.

Use FlowObjects.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 over Ipfix
kafka Enable export of object over Kafka
start_record Enable export of start record

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 over Ipfix

kafka

Enable export of object over Kafka

start_record

Enable export of start record