This module contains functionality for accessing Host triggers.
Do NOT import this module directly. The PLConnection object should be used, e.g:
>>> import packetlogic2 >>> pl = packetlogic2.connect("192.168.1.25", "admin", "password") >>> ht = pl.HostTriggers()
Information about a Host trigger.
Returned in a list by HostTriggers.hosttrigger_list.
Methods: | ||
---|---|---|
Ungrouped | remove(self) Remove this host trigger from the system |
|
update(self, script=None, in_bw=None, out_bw=None, in_cps=None, out_cps=None, conns=None, uconns=None, uconn_rate=None, out_ttls=None, qoe_in_int=None, qoe_in_ext=None, qoe_out_int=None, qoe_out_ext=None, netobject=None, trigtype=None, subitem_count=None, view_name=None) Updates the host trigger properties |
Properties: | |
---|---|
conns | Number of concurrent connections to trigger on |
id | ID Number of the host trigger |
in_bw | Inbound bandwidth limit to trigger on in Kbps |
in_cps | Inbound connections per second to trigger on |
in_fwd | Inbound forwarded bandwidth limit to trigger on in Kbps |
name | Name of the host trigger |
netobject | Netobject id the trigger is configured for when trigtype in |
out_bw | Outbound bandwidth limit to trigger on in Kbps |
out_cps | Outbound connections per second to trigger on |
out_fwd | Outbound forwarded bandwidth limit to trigger on in Kbps |
out_ttls | Number of different TTL values seen on outbound traffic to trigger on |
qoe_in_ext | QoE for inbound traffic on external interface to trigger on |
qoe_in_int | QoE for inbound traffic on internal interface to trigger on |
qoe_out_ext | QoE for outbound traffic on external interface to trigger on |
qoe_out_int | QoE for outbound traffic on internal interface to trigger on |
script | Script filename to execute |
subitem_count | Number of subitems in view tree to trigger on |
trigtype | Trigger type |
uconn_rate | Unest |
uconns | Number of concurrent unest |
view_name | DynamicLiveView the trigger is configured for when trigtype is |
Remove this host trigger from the system.
Updates the host trigger properties.
str
) - The script filename to execute
int
) - in bandwidth limit to trigger on in Kbps
int
) - out bandwidth limit to trigger on in Kbps
int
) - in connections per second to trigger on
int
) - out connections per second to trigger on
int
) - no of concurrent connections to trigger on
int
) - no of unest. connections to trigger on
int
) - unest. connection rate to trigger on
int
) - out number of different used ttls to trigger on
int
) - QoE for in traffic on internal interface
int
) - QoE for in traffic on external interface
int
) - QoE for out traffic on internal interface
int
) - QoE for out traffic on external interface
int
) - Netobject id the trigger is configured for when trigtype in
(TRIGTYPE_HOST_IN_NETOBJECT, TRIGTYPE_HOST_IN_NETOBJECT,
TRIGTYPE_HOST_IN_NETOBJECT)
int
) - Trigger type. One of TRIGTYPE_HOST, TRIGTYPE_HOST_IN_NETOBJECT,
TRIGTYPE_HOST_IN_NETOBJECT, TRIGTYPE_HOST_IN_NETOBJECT, TRIGTYPE_VIEW
int
) - Number of subitems in view tree
str
) - DynamicLiveView the trigger is configured for when trigtype is
TRIGTYPE_VIEW
Number of concurrent connections to trigger on
ID Number of the host trigger
Inbound bandwidth limit to trigger on in Kbps
Inbound connections per second to trigger on
Inbound forwarded bandwidth limit to trigger on in Kbps. (Deprecated and unused in firmware version v12.0 and newer)
Name of the host trigger
Netobject id the trigger is configured for when trigtype in (TRIGTYPE_HOST_IN_NETOBJECT, TRIGTYPE_HOST_IN_NETOBJECT, TRIGTYPE_HOST_IN_NETOBJECT) (Requires firmware version v14.1 or newer)
Outbound bandwidth limit to trigger on in Kbps
Outbound connections per second to trigger on
Outbound forwarded bandwidth limit to trigger on in Kbps. (Deprecated and unused in firmware version v12.0 and newer)
Number of different TTL values seen on outbound traffic to trigger on
QoE for inbound traffic on external interface to trigger on. (Requires firmware version v14.1 or newer)
QoE for inbound traffic on internal interface to trigger on. (Requires firmware version v14.1 or newer)
QoE for outbound traffic on external interface to trigger on. (Requires firmware version v14.1 or newer)
QoE for outbound traffic on internal interface to trigger on. (Requires firmware version v14.1 or newer)
Script filename to execute
Number of subitems in view tree to trigger on.
Trigger type. One of TRIGTYPE_HOST, TRIGTYPE_HOST_IN_NETOBJECT, TRIGTYPE_HOST_IN_NETOBJECT, TRIGTYPE_HOST_IN_NETOBJECT (Requires firmware version v14.1.2 or newer)
Unest. connection rate to trigger on
Number of concurrent unest. connections to trigger on
DynamicLiveView the trigger is configured for when trigtype is TRIGTYPE_VIEW
Methods: | ||
---|---|---|
add(self, name, script, in_bw=0, out_bw=0, in_fwd=0, out_fwd=0, in_cps=0, out_cps=0, conns=0, uconns=0, out_ttls=0, qoe_in_int=0, qoe_in_ext=0, qoe_out_int=0, qoe_out_ext=0, netobject=0, trigtype=0, uconn_rate=0, subitem_count=0, view_name='') Adds a new host trigger to the system |
||
close(self) Immediately disconnects the resource |
||
commit(self, message='PythonAPI commit') Store the current transaction to the database |
||
list of HostTrigger
|
list(self) List all host triggers in the PacketLogic system |
|
ping(self, string='') Send a command to server to test if it is up |
||
tuple of (str , int )
|
protocol(self, protocol, strict=False) Translate protocol name OR number to tuple with name AND number |
|
dict of str :int and
int :str
|
protocols_dict(self) Returns a dictionary with name:nr and nr:name items for IP protocols |
|
rollback(self) Abort the current transaction and discard the data |
||
services_cmd(self, services=[], props=[]) Send services to pldbd |
||
list of str
|
services_list(self) List all services |
|
list of str
|
services_prop_list(self) List all properties |
|
wait_for_commit(self, pinginterval=60) Wait for new data to be committed on resource |
||
list of str
|
xfb_flags_list(self) List all XFB (Transfer Behaviour) flags, that can be used in FlagObjects |
Properties: | |
---|---|
commitid | The CommitID associated with this session |
hosttrigger_add | Deprecated alias for add |
hosttrigger_list | Deprecated alias for list |
Adds a new host trigger to the system.
QoE (Quality of Experience) triggers can have values from 100 to 0 (Corresponding to 100% to 0%). It will trigger when QoE goes below configured value. See product guide for a detailed definition of QoE values.
str
) - The new triggers name
str
) - The script filename to execute
int
) - Inbound bandwidth limit to trigger on in Kbps
int
) - Outbound bandwidth limit to trigger on in Kbps
int
) - Inbound forwarded bandwidth limit to trigger on in Kbps (not available in
firmware versions v12.0 and newer)
int
) - Outbound forwarded bandwidth limit to trigger on in Kbps (not available in
firmware versions v12.0 and newer)
int
) - Inbound connections per second to trigger on
int
) - Outbound connections per second to trigger on
int
) - Number of concurrent connections to trigger on
int
) - Number of concurrent unestablished connections to trigger on
int
) - Number of different TTL values seen on outbound traffic to trigger on
(requires firmware 13.1 or newer)
int
) - QoE for in traffic on internal interface. (requires firmware 14.1 or newer)
int
) - QoE for in traffic on external interface. (requires firmware 14.1 or newer)
int
) - QoE for out traffic on internal interface. (requires firmware 14.1 or
newer)
int
) - QoE for out traffic on external interface. (requires firmware 14.1 or
newer)
int
) - Netobject id the trigger is configured for when trigtype in
(TRIGTYPE_HOST_IN_NETOBJECT, TRIGTYPE_NETOBJECT or
TRIGTYPE_NETOBJECT_CHILD)
int
) - Trigger type. One of TRIGTYPE_HOST, TRIGTYPE_HOST_IN_NETOBJECT,
TRIGTYPE_NETOBJECT, TRIGTYPE_NETOBJECT_CHILD or TRIGTYPE_VIEW
int
) - Unestablished connection rate to trigger on. (requires firmware 15.0 or
newer)
int
) - Number of subitems in view tree
str
) - DynamicLiveView the trigger is configured for when trigtype is
TRIGTYPE_VIEW
Immediately disconnects the resource.
After this method has been called this object becomes useless.
It may be used to force a disconnect when the garbage collector can't be trusted to do a timely disconnect.
Store the current transaction to the database.
When you do this PacketLogic will reload the ruleset. This will take a lot of CPU resources from the system, try to do this in batches.
Observe that if you don't commit the changes you've made, no other resource (including the client) will see your changes.
str
) - Message recorded in the commit log. Ignored in v12.1 and earlier.
List all host triggers in the PacketLogic system.
>>> ht.hosttrigger_list() [<HostTrigger #1 'filter hosts with 100 CPS'>]
list
of HostTrigger
Send a command to server to test if it is up.
Translate protocol name OR number to tuple with name AND number. Can be used to e.g translate numerical protocol in connlog.search() result to protocol name.
An unknown protocol will be translated to e.g '#7' or -1, unless strict is set to True, in which case ValueError is raised for unknown protocols.
tuple
of (str
, int
)
int
, str
or a ProtocolObject
Item) - Name or number of an IP protocol
bool
) - If True
, ValueError is raised for an unknown protocol, if
False
(default), an unknown protocol translates to number -1
or name '#7' (where 7 is the supplied unknown protocol number).
Returns a dictionary with name:nr and nr:name items for IP protocols. Can be used to e.g translate numerical protocol in connlog.search() result to protocol name.
dict
of str
:int
and
int
:str
Abort the current transaction and discard the data.
This will also automatically happen if your connection drops or that you exit the program without commit.
Send services to pldbd
Sets stringtable for services and properties. Do NOT use this unless you know exactly what you are doing.
list
of str
) - List of services
list
of str
) - List of service properties
Wait for new data to be committed on resource.
This method returns as soon as the server signals that another client has committed new data to the resource. It also periodically tests the connection to the server. If connection is broken (or any other error happens) an exception is raised.
List all XFB (Transfer Behaviour) flags, that can be used in FlagObjects.
list
of str
The CommitID associated with this session. (14.0 or newer only)
Deprecated alias for add
Deprecated alias for list