fail2ban.server.jail module
***************************

class fail2ban.server.jail.Jail(name, backend='auto', db=None)

   Bases: "object"

   Fail2Ban jail, which manages a filter and associated actions.

   The class handles the initialisation of a filter, and actions. It's
   role is then to act as an interface between the filter and actions,
   passing bans detected by the filter, for the actions to then act
   upon.

   Parameters:
      **name** : str
         Name assigned to the jail.

      **backend** : str
         Backend to be used for filter. "auto" will attempt to pick
         the most preferred backend method. Default: "auto"

      **db** : Fail2BanDb
         Fail2Ban persistent database instance. Default: *None*

   Attributes:
      "name"
         Name of jail.

      "database"
         The database used to store persistent data for the jail.

      "filter"
         The filter which the jail is using to monitor log files.

      "actions"
         Actions object used to manage actions for jail.

      "idle"
         A boolean indicating whether jail is idle.

      "status"
         The status of the jail.

   -[ Methods ]-

   +------------+--------------------------------------------------------------------------------------------+
   | "getFailT  | Get a fail ticket from the jail.                                                           |
   | icket"(se  |                                                                                            |
   | lf)        |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "getMaxBa  | Returns max possible ban-time of jail.                                                     |
   | nTime"(se  |                                                                                            |
   | lf)        |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "isAlive"  | Check jail "isAlive" by checking filter and actions threads.                               |
   | (self)     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "putFailT  | Add a fail ticket to the jail.                                                             |
   | icket"(se  |                                                                                            |
   | lf,        |                                                                                            |
   | ticket)    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "restoreC  | Restore any previous valid bans from the database.                                         |
   | urrentBan  |                                                                                            |
   | s"(self[,  |                                                                                            |
   | correctBa  |                                                                                            |
   | nTime])    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "start"(s  | Start the jail, by starting filter and actions threads.                                    |
   | elf)       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "status"(  | The status of the jail.                                                                    |
   | self[,     |                                                                                            |
   | flavor])   |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "stop"(se  | Stop the jail, by stopping filter and actions threads.                                     |
   | lf[, stop, |                                                                                            |
   | join])     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+

   +---------------------+------------+
   | **getBanTimeExtra** |            |
   +---------------------+------------+
   | **setBanTimeExtra** |            |
   +---------------------+------------+

   property actions

      Actions object used to manage actions for jail.

   property database

      The database used to store persistent data for the jail.

   property filter

      The filter which the jail is using to monitor log files.

   getBanTimeExtra(self, opt=None)

   getFailTicket(self)

      Get a fail ticket from the jail.

      Used by actions to get a failure for banning.

   getMaxBanTime(self)

      Returns max possible ban-time of jail.

   property hasFailTickets

      Retrieve whether queue has tickets to ban.

   property idle

      A boolean indicating whether jail is idle.

   isAlive(self)

      Check jail "isAlive" by checking filter and actions threads.

   property name

      Name of jail.

   putFailTicket(self, ticket)

      Add a fail ticket to the jail.

      Used by filter to add a failure for banning.

   restoreCurrentBans(self, correctBanTime=True)

      Restore any previous valid bans from the database.

   setBanTimeExtra(self, opt, value)

   start(self)

      Start the jail, by starting filter and actions threads.

      Once stated, also queries the persistent database to reinstate
      any valid bans.

   status(self, flavor='basic')

      The status of the jail.

   stop(self, stop=True, join=True)

      Stop the jail, by stopping filter and actions threads.
