File Coverage

blib/lib/WebService/Amazon/ElasticBeanstalk.pm
Criterion Covered Total %
statement 32 115 27.8
branch 0 16 0.0
condition 0 9 0.0
subroutine 11 27 40.7
pod 12 12 100.0
total 55 179 30.7


line stmt bran cond sub pod time code
1             package WebService::Amazon::ElasticBeanstalk;
2 1     1   21747 use base qw( WebService::Simple );
  1         2  
  1         827  
3              
4 1     1   80868 use 5.006;
  1         5  
5 1     1   5 use strict;
  1         6  
  1         31  
6 1     1   5 use warnings FATAL => 'all';
  1         1  
  1         37  
7              
8             #binmode STDOUT, ":encoding(UTF-8)";
9              
10 1     1   824 use AWS::Signature4;
  1         25807  
  1         18  
11 1     1   38 use Carp;
  1         2  
  1         70  
12 1     1   893 use HTTP::Request::Common;
  1         2335  
  1         70  
13 1     1   6 use LWP;
  1         2  
  1         12  
14 1     1   858 use Params::Validate qw( :all );
  1         10261  
  1         227  
15 1     1   934 use Readonly;
  1         2978  
  1         66  
16             #use Smart::Comments '###';
17             #use Smart::Comments '###', '####';
18             #use Smart::Comments '###', '####', '#####';
19             require XML::Simple;
20              
21             =encoding utf-8
22              
23             =head1 NAME
24              
25             WebService::Amazon::ElasticBeanstalk - Basic interface to Amazon ElasticBeanstalk
26              
27             =head1 VERSION
28              
29             Version 0.0.8
30              
31             =cut
32              
33 1     1   845 use version;
  1         2065  
  1         7  
34             our $VERSION = version->declare("v0.0.8");
35              
36             =head1 SYNOPSIS
37              
38             This module provides a Perl wrapper around Amazon's
39             ( L ) ElasticBeanstalk API. You will need
40             to be an AWS customer with an ID and Secret which has been provided
41             access to Elastic Beanstalk.
42              
43             B Some parameter validation is purposely lax. The API will
44             generally fail when invalid params are passed. The errors may not
45             be helpful.
46              
47             =cut
48              
49             # From: http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region
50             # FIXME: use an array and assemble the URL in the constructor?
51             Readonly our %REGIONS => (
52             'us-east-1' => 'https://elasticbeanstalk.us-east-1.amazonaws.com',
53             'us-west-1' => 'https://elasticbeanstalk.us-west-1.amazonaws.com',
54             'us-west-2' => 'https://elasticbeanstalk.us-west-2.amazonaws.com',
55             'eu-west-1' => 'https://elasticbeanstalk.eu-west-1.amazonaws.com',
56             'eu-central-1' => 'https://elasticbeanstalk.eu-central-1.amazonaws.com',
57             'ap-southeast-1' => 'https://elasticbeanstalk.ap-southeast-1.amazonaws.com',
58             'ap-southeast-2' => 'https://elasticbeanstalk.ap-southeast-2.amazonaws.com',
59             'ap-northeast-1' => 'https://elasticbeanstalk.ap-northeast-1.amazonaws.com',
60             'sa-east-1' => 'https://elasticbeanstalk.sa-east-1.amazonaws.com'
61             );
62              
63             # Global API Version and Default Region
64             Readonly our $API_VERSION => '2010-12-01';
65             Readonly our $DEF_REGION => 'us-east-1';
66              
67             # some defaults
68             __PACKAGE__->config(
69             base_url => $REGIONS{'us-east-1'},
70             );
71              
72             # Global patterns for param validation
73             Readonly our $REGEX_ID => '^[A-Z0-9]{20}$';
74             Readonly our $REGEX_REGION => '^[a-z]{2}-[a-z].*?-\d$';
75             Readonly our $REGEX_SECRET => '^[A-Za-z0-9/+]{40}$';
76              
77             Readonly our $REGEX_CONDITIONS => '^(haveAtLeastOneUnapproved|haveAtLeastOneApproved|haveAtLeastOneTranslated|haveAllTranslated|haveAllApproved|haveAllUnapproved)$';
78             Readonly our $REGEX_FILETYPES => '^(android|docx|ios|gettext|html|xlsx|javaProperties|json|pptx|xliff|xlsx|xml|yaml)$';
79             Readonly our $REGEX_FILEURI => '^\S+$';
80             Readonly our $REGEX_INT => '^\d+$';
81             Readonly our $REGEX_RETYPE => '^(pending|published|pseudo)$';
82             Readonly our $REGEX_URL => '^(https?|ftp|file)://.+$';
83             # From: http://www.pelagodesign.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/
84             Readonly our $REGEX_DATE_ISO8601 => '^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$';
85              
86             =head1 INTERFACE
87              
88             =head2 new
89              
90             Inherited from L, and takes all the same arguments.
91             You B provide the Amazon required arguments of B, and B
92             in the param hash:
93              
94             my $ebn = WebService::Amazon::ElasticBeanstalk->new( param => { id => $AWS_ACCESS_KEY_ID,
95             region => 'us-east-1',
96             secret => $AWS_ACCESS_KEY_SECRET } );
97              
98             =over 4
99              
100             =item B
101              
102             =item id B<(required)>
103              
104             You can find more information in the AWS docs:
105             L
106              
107             =item region I<(optional)> - defaults to us-east-1
108              
109             You can find available regions at:
110             L
111              
112             =item secret B<(required)>
113              
114             You can find more information in the AWS docs:
115             L
116              
117             =back
118              
119             =cut
120              
121             # apiKey => { type => SCALAR, regex => qr/$REGEX_APIKEY/, },
122             # approved => { type => SCALAR, },
123             # callbackUrl => { type => SCALAR, regex => qr/$REGEX_URL/, },
124             # conditions => { type => ARRAYREF },
125             # file => { type => SCALAR,
126             # callbacks => {
127             # 'readable file' => sub { my( $f ) = shift(); return "$f" ne "" && -r "$f" },
128             # 'less than 5MB' => sub { my( $f ) = shift(); return "$f" ne "" && -r "$f" && (sprintf( "%.2f", (-s "$f") / 1024 / 1024) < 5 ); };
129             # },
130             # untaint => 1
131             # },
132             # fileType => { type => SCALAR, regex => qr/$REGEX_FILETYPES/, },
133             # fileTypes => { type => ARRAYREF, regex => qr/$REGEX_FILETYPES/, },
134             # fileUri => { type => SCALAR, regex => qr/$REGEX_FILEURI/, },
135             # lastUploadedAfter => { type => SCALAR, regex => qr/$REGEX_DATE_ISO8601/, },
136             # lastUploadedBefore => { type => SCALAR, regex => qr/$REGEX_DATE_ISO8601/, },
137             # limit => { type => SCALAR, regex => qr/$REGEX_INT/, },
138             # locale => { type => SCALAR, regex => qr/$REGEX_FILEURI/, },
139             # newFileUri => { type => SCALAR, regex => qr/$REGEX_FILEURI/, },
140             # offset => { type => SCALAR, regex => qr/$REGEX_INT/, },
141             # projectId => { type => SCALAR, regex => qr/$REGEX_PROJID/, },
142             # retrievalType => { type => SCALAR, regex => qr/$REGEX_RETYPE/, },
143             # uriMask => { type => SCALAR, },
144             # );
145              
146             our( %API_SPEC );
147              
148             $API_SPEC{'new'} = {
149             id => { type => SCALAR, regex => qr/$REGEX_ID/, },
150             region => { type => SCALAR, regex => qr/$REGEX_REGION/, optional => 1, default => $DEF_REGION, },
151             secret => { type => SCALAR, regex => qr/$REGEX_SECRET/, },
152             };
153              
154             # #################################################################################################
155             #
156             # Override WebService::Simple methods
157             #
158              
159             # Override valid options, set API version and create XML parser
160             sub new {
161             ### Enter: (caller(0))[3]
162 0     0 1   my( $class, %args ) = @_;
163 0           my $self = $class->SUPER::new(%args);
164            
165             # this is silly, but easier for validation
166 0           my( @temp_params ) = %{ $self->{basic_params} };
  0            
167 0           my %params = validate( @temp_params, $API_SPEC{'new'} );
168             ##### %params
169            
170             # set our API version
171 0           $self->{api_version} = $API_VERSION;
172            
173             # for parsing the responses
174 0           $self->{xs} = XML::Simple->new();
175            
176             # store a request signer for later
177             $self->{signer} = AWS::Signature4->new( -access_key => $self->{basic_params}{id},
178 0           -secret_key => $self->{basic_params}{secret} );
179              
180             # store a user agent for later
181 0           $self->{ua} = LWP::UserAgent->new( agent => "$class/$VERSION" );
182            
183             # change the endpoint for the requested region
184 0 0 0       if ( $params{region} && $REGIONS{$params{region}} ) {
    0 0        
185 0           $self->{base_url} = $REGIONS{$params{region}};
186             }
187             elsif ( $params{region} && !$REGIONS{$params{region}} ) {
188 0           carp( "Unknown region: $params{region}; using $DEF_REGION...")
189             }
190             ### Exit: (caller(0))[3]
191 0           return bless($self, $class);
192             }
193              
194             # override parent get to perform the required AWS signatures
195             sub _get {
196             ### Enter: (caller(0))[3]
197 0     0     my( $self ) = shift;
198 0           my( %args ) = @_;
199             #my $self = $class->SUPER::new(%args);
200            
201             ##### $self
202              
203             ### %args
204 0 0         if ( !$args{params} ) {
205 0           carp( "No parameter provided for request!" );
206 0           return undef;
207             }
208             else {
209 0           $args{params}{Version} = $self->{api_version};
210             }
211              
212 0           my $uri = URI->new( $self->{base_url} );
213 0           $uri->query_form( $args{params} );
214             #### $uri
215              
216             # This gives a signed URL that can be fetched by a browser
217 0           my $url = $self->{signer}->signed_url($uri);
218             #### $url
219             # This doesn't quite work (it wants path and args only)
220             #my $response = $self->SUPER::get( $url );
221 0           my $response = $self->{ua}->get($url);
222             ##### $response
223 0 0         if ( $response->is_success ) {
224             ### Exit: (caller(0))[3]
225 0           return $self->{xs}->XMLin( $response->decoded_content );
226             }
227             else {
228 0           carp( join( $/, $response->decoded_content, $response->status_line ) );
229             ### Exit: (caller(0))[3]
230 0           return undef;
231             }
232             ### Exit: (caller(0))[3]
233             }
234              
235             # override parent post to perform the required AWS signatures
236             # NOTE: unused (API is all GETs)
237             sub _post {
238 0     0     my( $self, %args ) = @_;
239              
240             ### %args
241 0 0         if ( !$args{params} ) {
242 0           carp( "No parameter provided for request!" );
243 0           return undef;
244             }
245             else {
246 0           $args{params}{Version} = $self->{api_version};
247             }
248            
249             # set custom HTTP request header fields
250 0           my $req = HTTP::Request->new( POST => $self->{base_url} );
251            
252             # this is not quite right
253 0           $req->content( %args );
254            
255 0           $self->{signer}->sign( $req );
256 0           my $response = $self->{ua}->request( $req );
257             ##### $response
258 0 0         if ( $response->is_success ) {
259 0           return $self->{xs}->XMLin( $response->decoded_content );
260             }
261             else {
262 0           carp( join( $/, $response->decoded_content, $response->status_line ) );
263 0           return undef;
264             }
265             }
266              
267             # implement a general way to configure repeated options to match the API
268             sub _handleRepeatedOptions {
269             ### Enter: (caller(0))[3]
270 0     0     my( $self ) = shift;
271 0           my( $repeat, %params ) = @_;
272             #### %params
273              
274 0 0 0       if ( $params{$repeat} && ref( $params{$repeat} ) eq "ARRAY" ) {
275 0           my( $i ) = 1;
276 0           foreach my $t ( @{ $params{$repeat} } ) {
  0            
277 0           $params{"${repeat}.member.${i}"} = $t;
278 0           $i++;
279             }
280 0           delete( $params{$repeat} );
281             }
282            
283             #### %params
284             ### Exit: (caller(0))[3]
285 0           return %params;
286             }
287              
288             # most of the calls can do this
289             sub _genericCallHandler {
290             ### Enter: (caller(0))[3]
291 0     0     my( @st ) = split( /::/, (caller(1))[3] );
292 0           my( $op ) = pop( @st );
293             ### Operation: $op
294 0           my( $self ) = shift;
295 0           my %params = validate( @_, $API_SPEC{$op} );
296 0           $params{Operation} = $op;
297             ### %params
298            
299             # handle ARRAY / repeated options
300 0           foreach my $opt ( keys( %{ $API_SPEC{$op} } ) ) {
  0            
301             ### Checking opt: $opt
302 0 0         if ( $API_SPEC{$op}->{$opt}->{type} == ARRAYREF ) {
303             ### Found a repeatable option: $opt
304 0           ( %params ) = $self->_handleRepeatedOptions( $opt, %params );
305             }
306             }
307            
308             ### %params
309 0           my( $rez ) = $self->_get( params => \%params );
310             ### Exit: (caller(0))[3]
311 0           return $rez->{"${op}Result"};
312             }
313              
314             # #################################################################################################
315             #
316             # API Methods Below
317             #
318              
319             ## CheckDNSAvailability
320              
321             =head2 CheckDNSAvailability( CNAMEPrefix => 'the-thing-to-check' )
322              
323             Returns a list of the available solution stack names.
324              
325             Refer to L
326              
327             =over 4
328              
329             =item B
330              
331             =item CNAMEPrefix B<(required scalar)>
332              
333             The prefix used when this CNAME is reserved.
334              
335             =item B
336              
337             =back
338              
339             =cut
340              
341             $API_SPEC{'CheckDNSAvailability'} = {
342             CNAMEPrefix => { type => SCALAR, regex => qr/^[A-Z0-9_-]{4,63}$/i, }
343             };
344              
345             sub CheckDNSAvailability {
346             ### Enter: (caller(0))[3]
347 0     0 1   my( $rez ) = _genericCallHandler( @_ );
348             ### Exit: (caller(0))[3]
349 0           return $rez;
350             }
351              
352             # #################################################################################################
353             # CreateApplication
354              
355             =head2 CreateApplication( )
356              
357             Unimplimented (for now)
358              
359             =cut
360              
361             # #################################################################################################
362             # CreateApplicationVersion
363              
364             =head2 CreateApplicationVersion( )
365              
366             Unimplimented (for now)
367              
368             =cut
369              
370             # #################################################################################################
371             # CreateConfigurationTemplate
372              
373             =head2 CreateConfigurationTemplate( )
374              
375             Unimplimented (for now)
376              
377             =cut
378              
379             # #################################################################################################
380             # CreateEnvironment
381              
382             =head2 CreateEnvironment( )
383              
384             Unimplimented (for now)
385              
386             =cut
387              
388             # #################################################################################################
389             # CreateStorageLocation
390              
391             =head2 CreateStorageLocation( )
392              
393             Unimplimented (for now)
394              
395             =cut
396              
397             # #################################################################################################
398             # DeleteApplication
399              
400             =head2 DeleteApplication( )
401              
402             Unimplimented (for now)
403              
404             =cut
405              
406             # #################################################################################################
407             # DeleteApplicationVersion
408              
409             =head2 DeleteApplicationVersion( )
410              
411             Unimplimented (for now)
412              
413             =cut
414              
415             # #################################################################################################
416             # DeleteConfigurationTemplate
417              
418             =head2 DeleteConfigurationTemplate( )
419              
420             Unimplimented (for now)
421              
422             =cut
423              
424             # #################################################################################################
425             # DeleteEnvironmentConfiguration
426              
427             =head2 DeleteEnvironmentConfiguration( )
428              
429             Unimplimented (for now)
430              
431             =cut
432              
433             # #################################################################################################
434             # DescribeApplicationVersions
435              
436             =head2 DescribeApplicationVersions( )
437              
438             Returns a list of the available solution stack names.
439              
440             Refer to L
441              
442             =over 4
443              
444             =item B
445              
446             =item ApplicationName I<(optional scalar)>
447              
448             If specified, AWS Elastic Beanstalk restricts the returned descriptions to only include ones that are associated with the specified application.
449              
450             =item VersionLabels I<(optional array)>
451              
452             If specified, AWS Elastic Beanstalk restricts the returned versions to only include those with the specified names.
453              
454             =item B
455              
456             =back
457              
458             =cut
459              
460             $API_SPEC{'DescribeApplicationVersions'} = {
461             ApplicationName => { type => SCALAR, optional => 1, regex => qr/^[A-Z0-9_-]{4,63}$/i, },
462             VersionLabels => { type => ARRAYREF, optional => 1 },
463             };
464              
465             sub DescribeApplicationVersions {
466             ### Enter: (caller(0))[3]
467 0     0 1   my( $rez ) = _genericCallHandler( @_ );
468             ### Exit: (caller(0))[3]
469 0           return $rez;
470             }
471              
472             # #################################################################################################
473             # DescribeApplications
474              
475             =head2 DescribeApplications( )
476              
477             Returns a list of the available solution stack names.
478              
479             Refer to L
480              
481             =over 4
482              
483             =item B
484              
485             =item ApplicationNames I<(optional array)>
486              
487             If specified, AWS Elastic Beanstalk restricts the returned descriptions to only include those with the specified names.
488              
489             =item B
490              
491             =back
492              
493             =cut
494              
495             $API_SPEC{'DescribeApplications'} = {
496             ApplicationNames => { type => ARRAYREF, optional => 1 }
497             };
498            
499             sub DescribeApplications {
500             ### Enter: (caller(0))[3]
501 0     0 1   my( $rez ) = _genericCallHandler( @_ );
502             ### Exit: (caller(0))[3]
503 0           return $rez;
504             }
505              
506             # #################################################################################################
507             # DescribeConfigurationOptions
508              
509             =head2 DescribeConfigurationOptions( )
510              
511             Returns a list of the available solution stack names.
512              
513             Refer to L
514              
515             =over 4
516              
517             =item B
518              
519             =item ApplicationName I<(optional string)>
520              
521             The name of the application associated with the configuration template or environment. Only needed if you want to describe the configuration options associated with either the configuration template or environment.
522              
523             =item EnvironmentName I<(optional string)>
524              
525             The name of the environment whose configuration options you want to describe.
526              
527             =item Options I<(optional array)>
528              
529             If specified, restricts the descriptions to only the specified options.
530              
531             =item SolutionStackName I<(optional string)>
532              
533             The name of the solution stack whose configuration options you want to describe.
534              
535             =item TemplateName I<(optional string)>
536              
537             The name of the configuration template whose configuration options you want to describe.
538              
539             =item B
540              
541             =back
542              
543             =cut
544              
545             $API_SPEC{'DescribeConfigurationOptions'} = {
546             ApplicationName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{1,100}$/i, optional => 1 },
547             EnvironmentName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{4,23}$/i, optional => 1 },
548             Options => { type => ARRAYREF, optional => 1 },
549             SolutionStackName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{1,100}$/i, optional => 1 },
550             TemplateName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{1,100}$/i, optional => 1 },
551             };
552            
553             sub DescribeConfigurationOptions {
554             ### Enter: (caller(0))[3]
555 0     0 1   my( $rez ) = _genericCallHandler( @_ );
556             ### Exit: (caller(0))[3]
557 0           return $rez;
558             }
559              
560             # #################################################################################################
561             # DescribeConfigurationSettings
562              
563             =head2 DescribeConfigurationSettings( )
564              
565             Returns a list of the available solution stack names.
566              
567             Refer to L
568              
569             =over 4
570              
571             =item B
572              
573             =item ApplicationName B<(required string)>
574              
575             The application for the environment or configuration template.
576              
577             =item EnvironmentName I(optional string)
578              
579             The name of the environment to describe.
580              
581             Condition: You must specify either this or a TemplateName, but not both. If you specify both, AWS Elastic Beanstalk returns an InvalidParameterCombination error. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
582              
583             =item TemplateName I(optional string)
584              
585             The name of the configuration template to describe.
586              
587             Conditional: You must specify either this parameter or an EnvironmentName, but not both. If you specify both, AWS Elastic Beanstalk returns an InvalidParameterCombination error. If you do not specify either, AWS Elastic Beanstalk returns a MissingRequiredParameter error.
588              
589             =item B
590              
591             =back
592              
593             =cut
594              
595             $API_SPEC{'DescribeConfigurationSettings'} = {
596             ApplicationName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{1,100}$/i,
597             callbacks => {
598             'other_params' => sub {
599             my( $me, $others ) = @_;
600             if ( !$others->{'EnvironmentName'} && !$others->{'TemplateName'} ) {
601             croak( "Provide one of EnvironmentName or TemplateName" );
602             return 0;
603             }
604              
605             if ( $others->{'EnvironmentName'} && $others->{'TemplateName'} ) {
606             croak( "Provide only one of EnvironmentName or TemplateName" );
607             return 0;
608             }
609             return 1;
610             }
611             }
612             },
613             EnvironmentName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{4,23}$/i, optional => 1 },
614             TemplateName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{4,23}$/i, optional => 1 },
615             };
616              
617             sub DescribeConfigurationSettings {
618             ### Enter: (caller(0))[3]
619 0     0 1   my( $rez ) = _genericCallHandler( @_ );
620             ### Exit: (caller(0))[3]
621 0           return $rez;
622             }
623              
624             # #################################################################################################
625             # DescribeEnvironmentResources
626              
627             =head2 DescribeEnvironmentResources( )
628              
629             Returns a list of the available solution stack names.
630              
631             Refer to L
632              
633             =over 4
634              
635             =item B
636              
637             =item ApplicationNames I<(optional array)>
638              
639             If specified, AWS Elastic Beanstalk restricts the returned descriptions to only include those with the specified names.
640              
641             =item B
642              
643             =back
644              
645             =cut
646              
647             $API_SPEC{'DescribeEnvironmentResources'} = {
648             ApplicationNames => { type => ARRAYREF, optional => 1 }
649             };
650            
651             sub DescribeEnvironmentResources {
652             ### Enter: (caller(0))[3]
653 0     0 1   my( $rez ) = _genericCallHandler( @_ );
654             ### Exit: (caller(0))[3]
655 0           return $rez;
656             }
657              
658             # #################################################################################################
659             # DescribeEnvironments
660              
661             =head2 DescribeEnvironments( )
662              
663             Returns a list of the available solution stack names.
664              
665             Refer to L
666              
667             =over 4
668              
669             =item B
670              
671             =item ApplicationName I<(optional string)>
672              
673             If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application.
674              
675             =item EnvironmentIds I<(optional array)>
676              
677             If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that have the specified IDs.
678              
679             =item EnvironmentNames I<(optional array)>
680              
681             If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that have the specified names.
682              
683             =item IncludeDeleted I<(optional boolean)>
684              
685             Indicates whether to include deleted environments:
686              
687             true: Environments that have been deleted after IncludedDeletedBackTo are displayed.
688             false: Do not include deleted environments.
689              
690             =item IncludedDeletedBackTo I<(optional date)>
691              
692             If specified when IncludeDeleted is set to true, then environments deleted after this date are displayed.
693              
694             =item VersionLabel I<(optional string)>
695              
696             If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application version.
697              
698             =item B
699              
700             =back
701              
702             =cut
703              
704             $API_SPEC{'DescribeEnvironments'} = {
705             ApplicationName => { type => SCALAR, optional => 1 },
706             EnvironmentId => { type => ARRAYREF, optional => 1 },
707             EnvironmentNames => { type => ARRAYREF, optional => 1 },
708             IncludeDeleted => { type => BOOLEAN, optional => 1 },
709             IncludedDeletedBackTo => { type => SCALAR, optional => 1 },
710             VersionLabel => { type => SCALAR, optional => 1 },
711             };
712            
713             sub DescribeEnvironments {
714             ### Enter: (caller(0))[3]
715 0     0 1   my( $rez ) = _genericCallHandler( @_ );
716             ### Exit: (caller(0))[3]
717 0           return $rez;
718             }
719              
720             # #################################################################################################
721             # DescribeEvents
722              
723             =head2 DescribeEvents( )
724              
725             Returns list of event descriptions matching criteria up to the last 6 weeks.
726              
727             Refer to L
728              
729             =over 4
730              
731             =item B
732              
733             =item ApplicationNames I<(optional array)>
734              
735             If specified, AWS Elastic Beanstalk restricts the returned descriptions to only include those with the specified names.
736              
737             =item B
738              
739             =back
740              
741             =cut
742              
743             $API_SPEC{'DescribeEvents'} = {
744             ApplicationNames => { type => ARRAYREF, optional => 1 }
745             };
746            
747             sub DescribeEvents {
748             ### Enter: (caller(0))[3]
749 0     0 1   my( $rez ) = _genericCallHandler( @_ );
750             ### Exit: (caller(0))[3]
751 0           return $rez;
752             }
753              
754             # #################################################################################################
755             ## ListAvailableSolutionStacks
756              
757             =head2 ListAvailableSolutionStacks( )
758              
759             Returns a list of the available solution stack names.
760              
761             Refer to L
762              
763             =over 4
764              
765             =item B
766              
767             B
768              
769             =item B
770              
771             =back
772              
773             =cut
774              
775             $API_SPEC{'ListAvailableSolutionStacks'} = { };
776              
777             sub ListAvailableSolutionStacks {
778             ### Enter: (caller(0))[3]
779 0     0 1   my( $rez ) = _genericCallHandler( @_ );
780             ### Exit: (caller(0))[3]
781 0           return $rez;
782             }
783              
784             # RebuildEnvironment
785              
786             =head2 RebuildEnvironment( )
787              
788             Unimplimented (for now)
789              
790             =cut
791              
792             # RequestEnvironmentInfo
793              
794             =head2 RequestEnvironmentInfo( )
795              
796             Unimplimented (for now)
797              
798             =cut
799              
800             # RestartAppServer
801              
802             =head2 RestartAppServer( )
803              
804             Unimplimented (for now)
805              
806             =cut
807              
808             # #################################################################################################
809             # RetrieveEnvironmentInfo
810              
811             =head2 RetrieveEnvironmentInfo( )
812              
813             Retrieves the compiled information from a RequestEnvironmentInfo request.
814              
815             Refer to L
816              
817             =over 4
818              
819             =item B
820              
821             =item EnvironmentId I<(optional string)>
822              
823             The ID of the data's environment.
824              
825             If no such environment is found, returns an InvalidParameterValue error.
826              
827             Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
828              
829             =item EnvironmentName I<(optional string)>
830              
831             The name of the data's environment.
832              
833             If no such environment is found, returns an InvalidParameterValue error.
834              
835             Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
836              
837             Type: String
838              
839             Length constraints: Minimum length of 4. Maximum length of 23.
840              
841             Required: No
842              
843             =item InfoType B<(required string)>
844              
845             The type of information to retrieve.
846              
847             Type: String
848              
849             Valid Values: tail
850              
851             Required: Yes
852              
853             =item B
854              
855             =back
856              
857             =cut
858              
859             $API_SPEC{'RetrieveEnvironmentInfo'} = {
860             InfoType => { type => SCALAR, optional => 1, default => 'tail',
861             callbacks => {
862             'other_params' => sub {
863             my( $me, $others ) = @_;
864             if ( !$others->{'EnvironmentId'} && !$others->{'EnvironmentName'} ) {
865             croak( "Provide one of EnvironmentId or EnvironmentName" );
866             return 0;
867             }
868             return 1;
869             }
870             }
871             },
872             EnvironmentId => { type => SCALAR, regex => qr/^[A-Z0-9_-]{4,23}$/i, optional => 1 },
873             EnvironmentName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{4,23}$/i, optional => 1 },
874             };
875              
876             sub RetrieveEnvironmentInfo {
877             ### Enter: (caller(0))[3]
878 0     0 1   my( $rez ) = _genericCallHandler( @_ );
879             ### Exit: (caller(0))[3]
880 0           return $rez;
881             }
882              
883             # #################################################################################################
884             # SwapEnvironmentCNAMEs
885              
886             =head2 SwapEnvironmentCNAMEs( )
887              
888             Unimplimented (for now)
889              
890             =cut
891              
892             # #################################################################################################
893             # TerminateEnvironment
894              
895             =head2 TerminateEnvironment( )
896              
897             Unimplimented (for now)
898              
899             =cut
900              
901             # #################################################################################################
902             # UpdateApplication
903              
904             =head2 UpdateApplication( )
905              
906             Unimplimented (for now)
907              
908             =cut
909              
910             # #################################################################################################
911             # UpdateApplicationVersion
912              
913             =head2 UpdateApplicationVersion( )
914              
915             Unimplimented (for now)
916              
917             =cut
918              
919             # #################################################################################################
920             # UpdateConfigurationTemplate
921              
922             =head2 UpdateConfigurationTemplate( )
923              
924             Unimplimented (for now)
925              
926             =cut
927              
928             # #################################################################################################
929             # UpdateEnvironment
930              
931             =head2 UpdateEnvironment( )
932              
933             Unimplimented (for now)
934              
935             =cut
936              
937             # #################################################################################################
938             # ValidateConfigurationSettings
939              
940             =head2 ValidateConfigurationSettings( )
941              
942             Takes a set of configuration settings and either a configuration template or environment, and determines whether those values are valid.
943              
944             This action returns a list of messages indicating any errors or warnings associated with the selection of option values.
945              
946             Refer to L
947              
948             =over 4
949              
950             =item B
951              
952             =item ApplicationName B<(required string)>
953              
954             The name of the application that the configuration template or environment belongs to.
955              
956             =item EnvironmentName I<(optional string)>
957              
958             The name of the environment to validate the settings against.
959              
960             Condition: You cannot specify both this and a configuration template name.
961              
962             =item OptionSettings I<(required array)>
963              
964             A list of the options and desired values to evaluate.
965              
966             =item TemplateName I<(optional string)>
967              
968             The name of the configuration template to validate the settings against.
969              
970             Condition: You cannot specify both this and an environment name.
971              
972             =item B
973              
974             =back
975              
976             =cut
977              
978             $API_SPEC{'ValidateConfigurationSettings'} = {
979             ApplicationName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{1,100}$/i,
980             callbacks => {
981             'other_params' => sub {
982             my( $me, $others ) = @_;
983             if ( !$others->{'EnvironmentName'} && !$others->{'TemplateName'} ) {
984             croak( "Provide one of EnvironmentName or TemplateName" );
985             return 0;
986             }
987              
988             if ( $others->{'EnvironmentName'} && $others->{'TemplateName'} ) {
989             croak( "Provide only one of EnvironmentName or TemplateName" );
990             return 0;
991             }
992             return 1;
993             }
994             }
995             },
996             EnvironmentName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{4,23}$/i, optional => 1 },
997             OptionSettings => { type => ARRAYREF },
998             TemplateName => { type => SCALAR, regex => qr/^[A-Z0-9_-]{4,23}$/i, optional => 1 },
999             };
1000              
1001             sub ValidateConfigurationSettings {
1002             ### Enter: (caller(0))[3]
1003 0     0 1   my( $rez ) = _genericCallHandler( @_ );
1004             ### Exit: (caller(0))[3]
1005 0           return $rez;
1006             }
1007              
1008             # #################################################################################################
1009              
1010             =head1 AUTHOR
1011              
1012             Matthew Cox C<< >>
1013              
1014             =head1 BUGS
1015              
1016             Please report any bugs or feature requests to C, or through
1017             the web interface at L. I will be notified, and then you'll
1018             automatically be notified of progress on your bug as I make changes.
1019              
1020             =head1 SUPPORT
1021              
1022             You can find documentation for this module with the perldoc command.
1023              
1024             perldoc WebService::Amazon::ElasticBeanstalk
1025              
1026             You can also look for information at:
1027              
1028             =over 4
1029              
1030             =item * RT: CPAN's request tracker (report bugs here)
1031              
1032             L
1033              
1034             =item * AnnoCPAN: Annotated CPAN documentation
1035              
1036             L
1037              
1038             =item * CPAN Ratings
1039              
1040             L
1041              
1042             =item * Search CPAN
1043              
1044             L
1045              
1046             =back
1047              
1048             =head1 SEE ALSO
1049              
1050             perl(1), L, L, L
1051              
1052             =head1 LICENSE AND COPYRIGHT
1053              
1054             Copyright 2015 Matthew Cox.
1055              
1056             This program is free software; you can redistribute it and/or modify it
1057             under the terms of the the Artistic License (2.0). You may obtain a
1058             copy of the full license at:
1059              
1060             L
1061              
1062             Any use, modification, and distribution of the Standard or Modified
1063             Versions is governed by this Artistic License. By using, modifying or
1064             distributing the Package, you accept this license. Do not use, modify,
1065             or distribute the Package, if you do not accept this license.
1066              
1067             If your Modified Version has been derived from a Modified Version made
1068             by someone other than you, you are nevertheless required to ensure that
1069             your Modified Version complies with the requirements of this license.
1070              
1071             This license does not grant you the right to use any trademark, service
1072             mark, tradename, or logo of the Copyright Holder.
1073              
1074             This license includes the non-exclusive, worldwide, free-of-charge
1075             patent license to make, have made, use, offer to sell, sell, import and
1076             otherwise transfer the Package with respect to any patent claims
1077             licensable by the Copyright Holder that are necessarily infringed by the
1078             Package. If you institute patent litigation (including a cross-claim or
1079             counterclaim) against any party alleging that the Package constitutes
1080             direct or contributory patent infringement, then this Artistic License
1081             to you shall terminate on the date that such litigation is filed.
1082              
1083             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
1084             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
1085             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
1086             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
1087             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
1088             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
1089             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
1090             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1091              
1092              
1093             =cut
1094              
1095             1; # End of WebService::Amazon::ElasticBeanstalk
1096             __END__