Class: Lumberg::Cpanel::Cron
- Defined in:
- lib/lumberg/cpanel/cron.rb
Instance Attribute Summary
Attributes inherited from Base
Attributes inherited from Whm::Base
Instance Method Summary collapse
-
#add(options = {}) ⇒ Object
Public: Add a cron job.
-
#edit(options = {}) ⇒ Object
Public: Edit a crontab entry.
-
#email(options = {}) ⇒ Object
Public: Get the default cron notification email address.
-
#list(options = {}) ⇒ Object
Public: Get list of cron jobs.
-
#remove(options = {}) ⇒ Object
Public: Remove a cron job.
-
#set_email(options = {}) ⇒ Object
Public: Set default cron notification email address.
Methods inherited from Base
api_module, #initialize, #perform_request
Methods inherited from Whm::Base
Constructor Details
This class inherits a constructor from Lumberg::Cpanel::Base
Instance Method Details
#add(options = {}) ⇒ Object
Public: Add a cron job.
options - Hash options for API call params (default: {}):
:command - String command to execute.
:day - String day value.
:hour - String hour value.
:minute - String minute value.
:month - String month value.
:weekday - String weekday value.
Returns Hash API response.
49 50 51 52 53 |
# File 'lib/lumberg/cpanel/cron.rb', line 49 def add( = {}) perform_request({ api_function: "add_line" }.merge()) end |
#edit(options = {}) ⇒ Object
Public: Edit a crontab entry.
options - Hash options for API call params (default: {}):
:command - String command to execute.
:day - String day value.
:hour - String hour value.
:minute - String minute value.
:month - String month value.
:weekday - String weekday value.
:commandnumber - Integer Line of cron entry to edit (optional).
If not present, :linekey is required.
:linekey - String Linekey for entry to edit (optional).
If not present, :commandnumber is required.
Returns Hash API response.
82 83 84 85 86 |
# File 'lib/lumberg/cpanel/cron.rb', line 82 def edit( = {}) perform_request({ api_function: "edit_line" }.merge()) end |
#email(options = {}) ⇒ Object
Public: Get the default cron notification email address.
options - Hash options for API call params (default: {})
Returns Hash API response.
21 22 23 24 25 |
# File 'lib/lumberg/cpanel/cron.rb', line 21 def email( = {}) perform_request({ api_function: "get_email" }.merge()) end |
#list(options = {}) ⇒ Object
Public: Get list of cron jobs.
options - Hash options for API call params (default: {})
Returns Hash API response.
32 33 34 35 36 |
# File 'lib/lumberg/cpanel/cron.rb', line 32 def list( = {}) perform_request({ api_function: "listcron" }.merge()) end |
#remove(options = {}) ⇒ Object
Public: Remove a cron job.
options - Hash options for API call params (default: {}):
:linekey - String linekey of the crontab entry to remove.
Returns Hash API response.
61 62 63 64 65 |
# File 'lib/lumberg/cpanel/cron.rb', line 61 def remove( = {}) perform_request({ api_function: "remove_line" }.merge()) end |
#set_email(options = {}) ⇒ Object
Public: Set default cron notification email address.
options - Hash options for API call params (default: {}):
:email - String email address to receive notifications.
Returns Hash API response.
10 11 12 13 14 |
# File 'lib/lumberg/cpanel/cron.rb', line 10 def set_email( = {}) perform_request({ api_function: "set_email" }.merge()) end |