| 1 | package VM::EC2::PlacementGroup; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | VM::EC2::PlacementGroup - Object describing an Amazon EC2 cluster | ||
| 6 | placement group | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | use VM::EC2; | ||
| 11 | |||
| 12 | $ec2 = VM::EC2->new(...); | ||
| 13 | $group = $ec2->describe_placement_groups(-group_name=>'clusterXYZ'); | ||
| 14 | $state = $group->state; | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | This object represents a cluster placement group. | ||
| 19 | |||
| 20 | =head1 METHODS | ||
| 21 | |||
| 22 | These object methods are supported: | ||
| 23 | |||
| 24 | groupName -- the group's name | ||
| 25 | strategy -- the placement strategy | ||
| 26 | valid values: | ||
| 27 | cluster | ||
| 28 | state -- the state of the placement group | ||
| 29 | valid values: | ||
| 30 | pending | available | deleting | deleted | ||
| 31 | |||
| 32 | In addition, this object supports the delete() method. | ||
| 33 | |||
| 34 | =head1 STRING OVERLOADING | ||
| 35 | |||
| 36 | When used in a string context, this object will interpolate the | ||
| 37 | groupName. | ||
| 38 | |||
| 39 | =head1 SEE ALSO | ||
| 40 | |||
| 41 | L<VM::EC2> | ||
| 42 | L<VM::EC2::Object> | ||
| 43 | L<VM::EC2::Generic> | ||
| 44 | |||
| 45 | =head1 AUTHOR | ||
| 46 | |||
| 47 | Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>. | ||
| 48 | |||
| 49 | Copyright (c) 2012 Loyalty Methods, Inc. | ||
| 50 | |||
| 51 | This package and its accompanying libraries is free software; you can | ||
| 52 | redistribute it and/or modify it under the terms of the GPL (either | ||
| 53 | version 1, or at your option, any later version) or the Artistic | ||
| 54 | License 2.0. Refer to LICENSE for the full license text. In addition, | ||
| 55 | please see DISCLAIMER.txt for disclaimers of warranty. | ||
| 56 | |||
| 57 | =cut | ||
| 58 | |||
| 59 | use strict; | ||
| 60 | use base 'VM::EC2::Generic'; | ||
| 61 | |||
| 62 | sub valid_fields { | ||
| 63 | my $self = shift; | ||
| 64 | return $self->SUPER::valid_fields, | ||
| 65 | qw(groupName strategy state); | ||
| 66 | } | ||
| 67 | |||
| 68 | sub primary_id { shift->groupName } | ||
| 69 | |||
| 70 | sub delete { | ||
| 71 | my $self = shift; | ||
| 72 | $self->aws->delete_placement_group($self->groupName) | ||
| 73 | } | ||
| 74 | |||
| 75 | 1; | ||
| 76 |