server::action::Action Class Reference
Execute commands.
More...
List of all members.
Detailed Description
Execute commands.
This class reads the failures from the Jail queue and decide if an action has to be taken. A BanManager take care of the banned IP addresses.
Definition at line 40 of file action.py.
Member Function Documentation
| def server::action::Action::__init__ |
( |
|
self, |
|
|
|
name | |
|
) |
| | |
| def server::action::Action::delCInfo |
( |
|
self, |
|
|
|
key | |
|
) |
| | |
Removes a "CInfo".
- Parameters:
-
Definition at line 99 of file action.py.
| def server::action::Action::execActionBan |
( |
|
self, |
|
|
|
aInfo | |
|
) |
| | |
Executes the action "ban" command.
- Returns:
- True if the command succeeded
Definition at line 153 of file action.py.
| def server::action::Action::execActionStart |
( |
|
self |
) |
|
Executes the action "start" command.
Replaces the tags in the action command with value of "cInfo" and executes the resulting command.
- Returns:
- True if the command succeeded
Definition at line 127 of file action.py.
| def server::action::Action::execActionStop |
( |
|
self |
) |
|
Executes the action "stop" command.
Replaces the tags in the action command with value of "cInfo" and executes the resulting command.
- Returns:
- True if the command succeeded
Definition at line 223 of file action.py.
| def server::action::Action::execActionUnban |
( |
|
self, |
|
|
|
aInfo | |
|
) |
| | |
Executes the action "unban" command.
- Returns:
- True if the command succeeded
Definition at line 178 of file action.py.
Executes a command.
We need a shell here because commands are mainly shell script. They contain pipe, redirection, etc.
- Todo:
Force the use of bash!?
Kill the command after a given timeout
- Parameters:
-
| realCmd | the command to execute |
- Returns:
- True if the command succeeded
Definition at line 302 of file action.py.
| def server::action::Action::getActionBan |
( |
|
self |
) |
|
Get the "ban" command.
- Returns:
- the command
Definition at line 145 of file action.py.
| def server::action::Action::getActionCheck |
( |
|
self |
) |
|
Get the "check" command.
- Returns:
- the command
Definition at line 195 of file action.py.
| def server::action::Action::getActionStart |
( |
|
self |
) |
|
Get the "start" command.
- Returns:
- the command
Definition at line 116 of file action.py.
| def server::action::Action::getActionStop |
( |
|
self |
) |
|
Get the "stop" command.
- Returns:
- the command
Definition at line 212 of file action.py.
| def server::action::Action::getActionUnban |
( |
|
self |
) |
|
Get the "unban" command.
- Returns:
- the command
Definition at line 170 of file action.py.
| def server::action::Action::getCInfo |
( |
|
self, |
|
|
|
key | |
|
) |
| | |
Returns a "CInfo".
- Parameters:
-
Definition at line 91 of file action.py.
| def server::action::Action::getName |
( |
|
self |
) |
|
Returns the action name.
- Returns:
- the name of the action
Definition at line 70 of file action.py.
Replaces tags in query with property values in aInfo.
- Parameters:
-
| query | the query string with tags |
| aInfo | the properties |
- Returns:
- a string
Definition at line 235 of file action.py.
| def server::action::Action::setActionBan |
( |
|
self, |
|
|
|
value | |
|
) |
| | |
Set the "ban" command.
- Parameters:
-
Definition at line 136 of file action.py.
| def server::action::Action::setActionCheck |
( |
|
self, |
|
|
|
value | |
|
) |
| | |
Set the "check" command.
- Parameters:
-
Definition at line 186 of file action.py.
| def server::action::Action::setActionStart |
( |
|
self, |
|
|
|
value | |
|
) |
| | |
Set the "start" command.
- Parameters:
-
Definition at line 107 of file action.py.
| def server::action::Action::setActionStop |
( |
|
self, |
|
|
|
value | |
|
) |
| | |
Set the "stop" command.
- Parameters:
-
Definition at line 203 of file action.py.
| def server::action::Action::setActionUnban |
( |
|
self, |
|
|
|
value | |
|
) |
| | |
Set the "unban" command.
- Parameters:
-
Definition at line 161 of file action.py.
| def server::action::Action::setCInfo |
( |
|
self, |
|
|
|
key, |
|
|
|
value | |
|
) |
| | |
Sets a "CInfo".
CInfo are statically defined properties. They can be definied by the user and are used to set e-mail addresses, port, host or anything that should not change during the life of the server.
- Parameters:
-
| key | the property name |
| value | the property value |
Definition at line 83 of file action.py.
| def server::action::Action::setName |
( |
|
self, |
|
|
|
name | |
|
) |
| | |
Sets the action name.
- Parameters:
-
| name | the name of the action |
Definition at line 62 of file action.py.
Member Data Documentation
The documentation for this class was generated from the following file: