ETLp::Audit::Browser::Model::Schedule - Model Class for interacting with Runtime Process Audit Schedules
use ETLp::Audit::Browser::Model::Schedule; my $model = ETLp::Audit::Browser::Model::Schedule->new(); my $processes = $model->get_schedules( page => 1, config_name => 'ApacheLogs', section_name => 'NZServers' );
Returns a resultset on the ep_schedule table, based on the supplied criteria. It will grab 10 rows at a time, and is ordered by date_updated descending
* page. Optional, Integer. The page you wish to return. Defaults to 1. * config_name: Optional. The name of the configuration file * section_name. The name of the fection in the configuration file
* A DBIx::Class resultset
Returns an array ref consisting of the main schedule and associated time componnets
* page. Optional, Integer. The page you wish to return. Defaults to 1. * config_name: Optional. The name of the configuration file * section_name. The name of the fection in the configuration file * status. Optional. (1 = active, 0 = inactive)
An array ref of schedule details:
* schedule_id * minutes (cron format) * hours (cron format) * dom - day of month (cron format) * days - days of the week (cron format) * month - 1-12 * description - description of the schedule * comment - any comment provided by the suer who edited the schedule * status (1 = active, 0 = inactive) * config_name - name of the configuration tghe schedule is processing * section - the section inside the configuration file
Get the day names for a schedule
* schedule_id. Optional. The schedule's key
* An array ref of day names, in day-of-week order
Returns the schedule withe the supplied id
* schedule_id. Optional. 1
* A DBIx::Class row object
Returns all of the ep_months records
None
* An Array of DBIx::Class row objects
Gets all of the ep_days_of_month records
Gets the month that the job is scheduled to run for
* schedule_id. Integer
* A EtlpScheduleMonth resultset row
Gets all of the days of the week that the job is scheduled to run for
* A hashref, where the keys are the dow_ids that are scheduled
Gets all of the days of the week that the job is scheduled to run for. The days are indexed by the cron day ids (0-6 = Sun - Sat) not the scheduled day of week surrogate key
Gets all of the days of the month that the job is scheduled to run for
* A EtlpScheduleDayOfMonth resultset
Gets all of the minutes that the job is scheduled to run for
* A EtlpScheduleMinute resultset
Gets all of the hours that the job is scheduled to run for
* A EtlpScheduleHour resultset
Takes section of cron entries for a given element (e.g. minutes), and expands the into an array ref. If the section contains a range then these are expanded into indvidual entries.
'1-5,16-20,23'
becomes
[1,2,3,4,5,16,17.18.19.20.23]
* entries. String
* An array ref of scheduled times
Similar to expand_entries, Takes section of cron entries for the day of the week. Cron expects entries to run from Sun (0) t0 Sat (6). Our input runs from (1-7) so we simply subtact 1 from each entry
expand_entries
[1,2,3,4,5,16,17,18,19,20,23]
* A an arrarey of day elements
Takes a list of entries (Comma-separated values), and makes sure that each element is valid. The rules are
* each element must consist of one or two digits * each element must be greater than the previous one * no entry can be greater than the limit for the type of entry (e.g. minutes cannot be greater than 59, and hours can't be greater than 23)
An array consisting of the following entries:
* entries. Mandatory. A string of comma-delimited entries * upper_limit. Mandatory. The maximum value allowed * zero_allowed. Optional. Whether or not 0 is a valid element for this type of entry
* 1 (valid) or 0 (invalid)
Validates the cron entries for hours
* entries. Mandatory. A string of comma-delimited entries
Validates the cron entries for minutes
Validates the cron entries for days of the week
Validates the cron entries for days of the month
Validates the cron entries for the month entries
Takes an array ref of cron entries and turns them back into a cron string. Consectutive values are turned into ranges, i.e.
[1,4,5,6,10]
Becomes
'1,4-6,10'
Returns the days of month cron string for a given schedule.
* schedule_id. Integer. Optional. The primary key of the schedule
* cron entry string
Returns the days of the week cron string for a given schedule.
Returns thehours of execution cron string for a given schedule.
Returns the minutes of execution cron string for a given schedule.
Saves the schedule to the database
* params. A hashref of containing the schedule data
* Void
Sets the scheduler status
* An ep_app_config DBIx::Class row
Generates a crontab from the database schedues
* pipeline script. String. Full path to the etl-pipeline script
* crontab as a string
Get a list of configuration files in the application configuration directory
* config_dir. String. Mandatory. The directory that stores the config files
* An array ref of configuration files
A string
* The scheduler status
Get all of the sections in a configurations file
* configuration file. String. The *full* path to the configuration file
* An array ref of sections
Given a schedule (an EPSection record), returns the job (configuration file name, section name)
* An array; config name, section name
Given a config file, return the list of sections - each element will apear in HTML option tags
* configuration file. String. The configuration file name
* An HTML string
Determines whether a configuration file exists
* configuration file. String. The pull path to the configuration file name, excluding the .conf extension
* 1 = true, 0 = false
Deletes a schedule, and dependent records
* schedule_id. Integer. The surrogate key for the schedule
Returns the last of dependent jobs as specified by the "next" parameter in the application config.
A hashref:
* config_dir. String. The directory where the configuration files are found * config_file. String. The root config file * section. The section on the config file that we wish to derive the dependencies from
* dependencies as an array
To install ETLp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ETLp
CPAN shell
perl -MCPAN -e shell install ETLp
For more information on module installation, please visit the detailed CPAN module installation guide.