| 1 | package VM::EC2::ELB::HealthCheck; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | VM::EC2::ELB:HealthCheck - Load Balancer Health Check Parameters | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | use VM::EC2; | ||
| 10 | |||
| 11 | $lb = $ec2->describe_load_balancers('my-lb'); | ||
| 12 | my $hc = $lb->HealthCheck; | ||
| 13 | my $interval = $hc->Interval; | ||
| 14 | my $target = $hc->Target; | ||
| 15 | my $healthy_threshold = $hc->HealthyThreshold; | ||
| 16 | my $unhealthy_threshold = $hc->UnhealthyThreshold; | ||
| 17 | my $timeout = $hc->Timeout; | ||
| 18 | |||
| 19 | =head1 DESCRIPTION | ||
| 20 | |||
| 21 | This object is used to describe the parameters used to perform | ||
| 22 | healthchecks on a load balancer. Generally you will not call | ||
| 23 | this directly, as all its methods are passed through by the | ||
| 24 | VM::EC2::ELB object returned from the HealthCheck() call. | ||
| 25 | |||
| 26 | =head1 METHODS | ||
| 27 | |||
| 28 | The following object methods are supported: | ||
| 29 | |||
| 30 | Interval -- The time interval between health checks | ||
| 31 | Target -- The target protocol protocol and port of the check | ||
| 32 | HealthyThreshold -- The number of successive positive health checks that | ||
| 33 | need to be completed to be marked as healthy | ||
| 34 | UnhealthyThreshold -- The number of successive negative health checks that | ||
| 35 | need to be completed to be marked as unhealthy | ||
| 36 | Timeout -- The time interval of what is considered a timeout | ||
| 37 | |||
| 38 | =head1 STRING OVERLOADING | ||
| 39 | |||
| 40 | When used in a string context, this object will interpolate object | ||
| 41 | parameters as a series of Key:Value strings | ||
| 42 | |||
| 43 | =head1 SEE ALSO | ||
| 44 | |||
| 45 | L<VM::EC2> | ||
| 46 | L<VM::EC2::Generic> | ||
| 47 | L<VM::EC2::Snapshot> | ||
| 48 | L<VM::EC2::ELB> | ||
| 49 | |||
| 50 | =head1 AUTHOR | ||
| 51 | |||
| 52 | Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>. | ||
| 53 | |||
| 54 | Copyright (c) 2012 Loyalty Methods, Inc. | ||
| 55 | |||
| 56 | This package and its accompanying libraries is free software; you can | ||
| 57 | redistribute it and/or modify it under the terms of the GPL (either | ||
| 58 | version 1, or at your option, any later version) or the Artistic | ||
| 59 | License 2.0. Refer to LICENSE for the full license text. In addition, | ||
| 60 | please see DISCLAIMER.txt for disclaimers of warranty. | ||
| 61 | |||
| 62 | =cut | ||
| 63 | |||
| 64 | use strict; | ||
| 65 | use base 'VM::EC2::Generic'; | ||
| 66 | |||
| 67 | # allow pretty print of parameters when printing the object | ||
| 68 | use overload | ||
| 69 | '""' => sub { | ||
| 70 | my $self = shift; | ||
| 71 | return "Target: " . $self->Target . "\nInterval: " . $self->Interval . | ||
| 72 | "\nHealthyThreshold: " . $self->HealthyThreshold . | ||
| 73 | "\nUnhealthyThreshold: " . $self->UnhealthyThreshold . | ||
| 74 | "\nTimeout: " . $self->Timeout}, | ||
| 75 | fallback => 1; | ||
| 76 | |||
| 77 | sub valid_fields { | ||
| 78 | my $self = shift; | ||
| 79 | return qw(HealthyThreshold Interval Target Timeout UnhealthyThreshold); | ||
| 80 | } | ||
| 81 | |||
| 82 | 1; |