Documentation for PythonAPI
5.0.1

API Reference

The packetlogic2 package contains the multiversion PacketLogic API.

This module provides a single entry point into the PacketLogic PythonAPI, the (packetlogic2.connect()) function.

>>> import packetlogic2
>>> pl = packetlogic2.connect("192.168.1.25", "admin", "pldemo00")
>>> print pl.remoteversion
12.1.2.70
>>> rt = pl.Realtime()
>>> rs = pl.Ruleset()

Functions defined here:

  • connect - Returns a PLConnection object using the appropriate protocol version

Classes defined here:

connect(host, username, password, port=None, versions=None, timeout=None)

Returns a PLConnection object using the appropriate protocol version.

Parameters:
  • username (str) - User to authenticate as
  • versions (list) - Used to specify explicit order of versions to try.
  • host (str) - PacketLogic host or IP address to connect to
  • timeout (float) - Timeout in seconds to use for connecting and performing actions.
  • password (str) - Password to authenticate with
  • port (int) - Connect to specified port instead of default port
Exceptions raised:
  • IOError - If connection to system fails.
  • RuntimeError - Couldn't log in: When authentication fails.

PLConnection

Returned by the connect() function. Wrapper for communication with a PacketLogic system.

This object does not keep any (TCP-level) connection to the PacketLogic system, it only stores the connection information. By invoking the different resource methods (e.g. Ruleset(), Realtime()) a new connection is made to the PacketLogic.

Methods:
Ungrouped Backup object Backup(self, port=None)
Get a connection to the PacketLogic's Backup resource
Channels object Channels(self)
Get a connection to the PacketLogic's channels resource
Config object Config(self)
Get a connection to the PacketLogic's Config resource
ConnLog object ConnLog(self)
Get a connection to the PacketLogic's ConnLog resource
Fileserv object Fileserv(self)
Get a connection to the PacketLogic's Fileserv resource
HostTriggers object HostTriggers(self)
Get a connection to the PacketLogic's host trigger resource
Realtime object Realtime(self, port=None)
Get a connection to the PacketLogic's realtime resource
ResourceEdit object ResourceEdit(self, port=None)
Get a connection to the PacketLogic's ResourceEdit resource
Ruleset object Ruleset(self)
Get a connection to the PacketLogic's Ruleset resource
Statistics object Statistics(self)
Get a connection to the PacketLogic's Statistics resource
SystemOverview object SystemOverview(self)
Get a connection to the PacketLogic's SystemOverview resource
Users object Users(self)
Get a connection to the PacketLogic's users resource
__init__(self, host, username, password, port, plversion, api, timeout, remoteversion='Unknown')
This class should not be instantiated directly, use the connect() function
Properties:
PLDBError This is a deprecated way to access the PLDBError exception
PLDError This is a deprecated way to access the PLDError exception
PLDNotAvailable This is a deprecated way to access the PLDNotAvailable exception
PLDPermissionError This is a deprecated way to access the PLDPermissionError exception
PLDServerError This is a deprecated way to access the PLDServerError exception
PLUnsupportedFeatureError This is a deprecated way to access the PLUnsupportedFeatureError exception
PL_API_VERSION The full API version string
StatsZone StatsZone class extracted from the specific API used in this connection
host The hostname or IP address of the PacketLogic system (The <host> argument)
plversion Protocolversion of connected PacketLogic system, and hence the API used in
remoteversion The version of the firmware running on the the PacketLogic system
Instance variables:
username The username used to connect to the PacketLogic system (The &lt;username&gt; argument).

Backup(self, port=None)

Get a connection to the PacketLogic's Backup resource.

For details about the Backup resource see documentation for the Backup object.

Returns:

Channels(self)

Get a connection to the PacketLogic's channels resource.

For details about the Channels resource see documentation for the Channels object.

Returns:

Config(self)

Get a connection to the PacketLogic's Config resource.

For details about the Config resource see documentation for the Config object.

Returns:

ConnLog(self)

Get a connection to the PacketLogic's ConnLog resource.

For details about the ConnLog resource see documentation for the ConnLog object.

Returns:

Fileserv(self)

Get a connection to the PacketLogic's Fileserv resource.

For details about the Fileserv resource see documentation for the Fileserv object.

Returns:

HostTriggers(self)

Get a connection to the PacketLogic's host trigger resource.

For details about the Host trigger resource see documentation for the HostTriggers object.

Realtime(self, port=None)

Get a connection to the PacketLogic's realtime resource.

For details about the Realtime resource see documentation for the Realtime object.

Returns:

ResourceEdit(self, port=None)

Get a connection to the PacketLogic's ResourceEdit resource.

For details about the ResourceEdit resource see documentation for the ResourceEdit object.

Ruleset(self)

Get a connection to the PacketLogic's Ruleset resource.

For details about the Ruleset resource see documentation for the Ruleset object.

For details about the resource see documentation for the Ruleset object.

Returns:

Statistics(self)

Get a connection to the PacketLogic's Statistics resource.

For details about the Statistics resource see documentation for the Statistics object.

SystemOverview(self)

Get a connection to the PacketLogic's SystemOverview resource.

For details about the SystemOverview resource see documentation for the SystemOverview object.

Users(self)

Get a connection to the PacketLogic's users resource.

For details about the Users resource see documentation for the Users object.

Returns:

PLDBError

This is a deprecated way to access the PLDBError exception.

PLDError

This is a deprecated way to access the PLDError exception.

PLDNotAvailable

This is a deprecated way to access the PLDNotAvailable exception.

PLDPermissionError

This is a deprecated way to access the PLDPermissionError exception.

PLDServerError

This is a deprecated way to access the PLDServerError exception.

PLUnsupportedFeatureError

This is a deprecated way to access the PLUnsupportedFeatureError exception.

PL_API_VERSION

The full API version string.

StatsZone

StatsZone class extracted from the specific API used in this connection.

host

The hostname or IP address of the PacketLogic system (The <host> argument).

plversion

Protocolversion of connected PacketLogic system, and hence the API used in this connection.

remoteversion

The version of the firmware running on the the PacketLogic system.