| 1 | package VM::EC2::ASG; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | VM::EC2::ASG - Object describing an AutoScaling Group | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | use VM::EC2; | ||
| 10 | |||
| 11 | $ec2 = VM::EC2->new(...); | ||
| 12 | @asgs = $ec2->describe_autoscaling_groups(); | ||
| 13 | |||
| 14 | $asg = $asgs[0]; | ||
| 15 | $name = $asg->auto_scaling_group_name; | ||
| 16 | @azs = $asg->availability_zones; | ||
| 17 | |||
| 18 | =head1 DESCRIPTION | ||
| 19 | |||
| 20 | This object represents an AutoScaling Group. It is returned by | ||
| 21 | C<VM::EC2->describe_autoscaling_groups()>. | ||
| 22 | |||
| 23 | =head1 METHODS | ||
| 24 | |||
| 25 | These properties are supported: | ||
| 26 | |||
| 27 | auto_scaling_group_arn -- ARN of the group | ||
| 28 | auto_scaling_group_name -- Name | ||
| 29 | availability_zones -- Zones in which this group auto scale | ||
| 30 | created_time -- Time of creation | ||
| 31 | default_cooldown | ||
| 32 | desired_capacity | ||
| 33 | enabled_metrics | ||
| 34 | health_check_type | ||
| 35 | health_check_grace_period | ||
| 36 | instance -- List of instances active in this group | ||
| 37 | launch_configuration -- Launch configuration name | ||
| 38 | load_balancer_names -- List of load balancers | ||
| 39 | max_size | ||
| 40 | min_size | ||
| 41 | placement_group | ||
| 42 | status | ||
| 43 | suspended_processes | ||
| 44 | tags | ||
| 45 | termination_policies | ||
| 46 | vpc_zone_identifier | ||
| 47 | |||
| 48 | =head1 SEE ALSO | ||
| 49 | |||
| 50 | L<VM::EC2> | ||
| 51 | L<VM::EC2::Generic> | ||
| 52 | |||
| 53 | =head1 AUTHOR | ||
| 54 | |||
| 55 | Jose Luis Martinez | ||
| 56 | |||
| 57 | =cut | ||
| 58 | |||
| 59 | use strict; | ||
| 60 | use base 'VM::EC2::Generic'; | ||
| 61 | |||
| 62 | sub valid_fields { | ||
| 63 | my $self = shift; | ||
| 64 | return qw(AutoScalingGroupARN AutoScalingGroupName AvailabilityZones | ||
| 65 | CreatedTime DefaultCooldown DesiredCapacity EnabledMetrics | ||
| 66 | HealthCheckGracePeriod HealthCheckType Instances LaunchConfigurationName | ||
| 67 | LoadBalancerNames MaxSize MinSize PlacementGroup Status | ||
| 68 | SuspendedProcesses Tags TerminationPolicies VPCZoneIdentifier | ||
| 69 | ); | ||
| 70 | } | ||
| 71 | |||
| 72 | # object methods | ||
| 73 | |||
| 74 | sub args { | ||
| 75 | my $self = shift; | ||
| 76 | my $default_param_name = shift; | ||
| 77 | return unless @_; | ||
| 78 | return @_ if $_[0] =~ /^-/; | ||
| 79 | return ($default_param_name => \@_); | ||
| 80 | } | ||
| 81 | |||
| 82 | 1; |