Business::SLA -
use Business::SLA; my $SLAObj = Business::SLA->new( BusinessHours => new Business::Hours, InHoursDefault => '2 real hours', OutOfHoursDefault => '1 business hour', ); # or set/change options later $SLAObj->SetBusinessHours( new Business::Hours ); $SLAObj->SetInHoursDefault('2 real hours'); $SLAObj->SetOutOfHoursDefault('1 business hour'); # add service levels $SLAObj->Add( '2 real hours' => RealMinutes => 2*60 ); $SLAObj->Add( '1 business hour' => BusinessMinutes => 60 ); $SLAObj->Add( 'next business minute' );
This module is a simple tool for handling operations related to Service Level Agreements.
Creates and returns new Business::SLA object.
Takes a hash with values of "BusinessHours", "InHoursDefault" and "OutOfHoursDefault" options. You can ommit these options and set them latter using methods (see below).
Sets a Business::Hours object to use for calculations. This module works without this option, but looses most functionality you can get with it.
It's possible use any object that API-compatible with Business::Hours.
Returns the current Business::Hours object or undef if it's not set.
Sets the default service level for times inside of business hours.
Takes a service level.
Returns the default service level for times inside of business hours.
Sets the default service level for times outside of business hours.
Note that "BusinessHours" are used for calculations, so this option makes not much sense without business hours have been set.
Returns the default service level for times outside of business hours.
Returns true if the date passed in is in business hours, and false otherwise. If no business hours have been set, returns true by default.
Takes a date in Unix time format (number of seconds since the epoch).
Returns the default servise level for the specified time.
Adds or replaces a service level definition.
Takes a service level and a hash with agreements. In the hash you can define BusinessMinutes, RealMinutes and StartImmediately boolean option.
The number of real minutes to add for the specified SLA.
The number of business minutes to add for the specified SLA.
Returns true if things should be started immediately for a service level. See also Add and "Starts".
Takes the service level.
Returns the starting time, given a date and a service level.
If the service level's been defined as StartImmediately then returns the same date, as well this also happens if business hours are not set.
Takes a date in Unix time format (number of seconds since the epoch) and a service level.
Returns the due time, given an SLA and a date.
Takes a date in Unix time format (number of seconds since the epoch) and the hash key for the SLA.
Send email to bug-business-sla@rt.cpan.org
Linda Julien Best Practical Solutions, LLC leira@bestpractical.com http://www.bestpractical.com
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl(1), Business::Hours.
To install Business::SLA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::SLA
CPAN shell
perl -MCPAN -e shell install Business::SLA
For more information on module installation, please visit the detailed CPAN module installation guide.