1package VM::EC2::ScalingPolicy;
2
3=head1 NAME
4
5VM::EC2::ScalingPolicy - Object describing an AutoScaling Policy
6
7=head1 SYNOPSIS
8
9  use VM::EC2;
10
11  $ec2  = VM::EC2->new(...);
12  @pols = $ec2->describe_policies();
13
14  $pol  = $pols[0];
15  $type = $pol->adjustment_type;
16
17=head1 DESCRIPTION
18
19This object represents an AutoScaling Policy. It's returned by
20C<VM::EC2->describe_policies()>.
21
22=head1 METHODS
23
24These properties are supported:
25
26  adjustment_type          -- Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity
27  alarms                   -- A list of CloudWatch Alarms related to the policy
28  auto_scaling_group_name  -- The name of the Auto Scaling group associated with this scaling policy
29  cooldown                 -- The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start
30  min_adjustment_step      -- Changes the DesiredCapacity of the Auto Scaling group by at least the specified number of instances
31  policy_arn               -- The Amazon Resource Name (ARN) of the policy
32  policy_name              -- The name of the scaling policy
33  scaling_adjustment       -- The number associated with the specified adjustment type. A positive value adds to the current capacity and a negative value removes from the current capacity
34  name                     -- Alias for policy_name
35
36=head1 SEE ALSO
37
38L<VM::EC2>
39L<VM::EC2::Generic>
40
41=head1 AUTHOR
42
43Jose Luis Martinez
44
45=cut
46
47use strict;
48use base 'VM::EC2::Generic';
49
50sub valid_fields {
51    my $self = shift;
52    return qw(AdjustmentType Alarms AutoScalingGroupName Cooldown
53      MinAdjustmentStep PolicyARN PolicyName ScalingAdjustment
54    );
55}
56
57# object methods
58
59sub args {
60    my $self               = shift;
61    my $default_param_name = shift;
62    return unless @_;
63    return @_ if $_[0] =~ /^-/;
64    return ($default_param_name => \@_);
65}
66
67sub name { shift->policy_name }
68
691;
70