| 1 | package VM::EC2::REST::general; | ||||||||||
| 2 | |||||||||||
| 3 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 7 | ▶ | use VM::EC2 ''; # important not to import anything! | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | package VM::EC2; # add methods to VM::EC2 | ||||||||||
| 6 | |||||||||||
| 7 | 7 | VM::EC2::Dispatch->register( | |||||||||
| 8 | GetConsoleOutput => 'VM::EC2::Instance::ConsoleOutput', | ||||||||||
| 9 | DescribeAccountAttributes => 'fetch_items,accountAttributeSet,VM::EC2::AccountAttributes', | ||||||||||
| 10 | ); | ||||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | 7 | my $VEP = 'VM::EC2::ParmParser'; | |||||||||
| 14 | |||||||||||
| 15 | =head1 NAME VM::EC2::REST::general | ||||||||||
| 16 | |||||||||||
| 17 | =head1 SYNOPSIS | ||||||||||
| 18 | |||||||||||
| 19 | use VM::EC2 'general'; | ||||||||||
| 20 | |||||||||||
| 21 | =head1 METHODS | ||||||||||
| 22 | |||||||||||
| 23 | These are EC2 methods that Amazon calls "general". | ||||||||||
| 24 | |||||||||||
| 25 | Implemented: | ||||||||||
| 26 | GetConsoleOutput | ||||||||||
| 27 | DescribeAccountAttributes | ||||||||||
| 28 | |||||||||||
| 29 | Unimplemented: | ||||||||||
| 30 | (none) | ||||||||||
| 31 | |||||||||||
| 32 | =head2 $output = $ec2->get_console_output(-instance_id=>'i-12345') | ||||||||||
| 33 | |||||||||||
| 34 | =head2 $output = $ec2->get_console_output('i-12345'); | ||||||||||
| 35 | |||||||||||
| 36 | Returns the console output of the indicated instance. The output is | ||||||||||
| 37 | actually a VM::EC2::ConsoleOutput object, but it is | ||||||||||
| 38 | overloaded so that when treated as a string it will appear as a | ||||||||||
| 39 | large text string containing the console output. When treated like an | ||||||||||
| 40 | object it provides instanceId() and timestamp() methods. | ||||||||||
| 41 | |||||||||||
| 42 | =cut | ||||||||||
| 43 | |||||||||||
| 44 | sub get_console_output { | ||||||||||
| 45 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
get_console_output: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 46 | 0 | my %args = $VEP->args(-instance_id,@_); | |||||||||
| 47 | 0 | ▶ | $args{-instance_id} or croak "Usage: get_console_output(-instance_id=>\$id)"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 0 | my @params = $VEP->format_parms(\%args, | |||||||||
| 49 | { | ||||||||||
| 50 | single_parm => [ 'InstanceId' ] | ||||||||||
| 51 | } | ||||||||||
| 52 | ); | ||||||||||
| 53 | 0 | return $self->call('GetConsoleOutput',@params); | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | =head2 @attrs = $ec2->describe_account_attributes(-attribute_name => \@attr_list) | ||||||||||
| 57 | |||||||||||
| 58 | =head2 @attrs = $ec2->describe_account_attributes(@attr_list) | ||||||||||
| 59 | |||||||||||
| 60 | =head2 @attrs = $ec2->describe_account_attributes($attr) | ||||||||||
| 61 | |||||||||||
| 62 | Describes the specified attribute of your AWS account. | ||||||||||
| 63 | |||||||||||
| 64 | Require Argument: | ||||||||||
| 65 | |||||||||||
| 66 | -attribute_name The attribute to describe | ||||||||||
| 67 | |||||||||||
| 68 | Supported attributes: | ||||||||||
| 69 | |||||||||||
| 70 | supported-platforms Whether your account can launch instances into EC2-Classic | ||||||||||
| 71 | and EC2-VPC, or only into EC2-VPC. For more information, | ||||||||||
| 72 | see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html | ||||||||||
| 73 | |||||||||||
| 74 | default-vpc ID of the default VPC for your account, or none. For more information, see | ||||||||||
| 75 | http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html | ||||||||||
| 76 | |||||||||||
| 77 | Returns an array of L<VM::EC2::AccountAttributes> objects. | ||||||||||
| 78 | |||||||||||
| 79 | =cut | ||||||||||
| 80 | |||||||||||
| 81 | sub describe_account_attributes { | ||||||||||
| 82 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
describe_account_attributes: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 83 | 0 | my %args = $VEP->args(-attribute_name,@_); | |||||||||
| 84 | 0 | ▶ | $args{-attribute_name} or croak "describe_account_attributes(): missing -attribute_name argument"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 85 | 0 | my @params = $VEP->format_parms(\%args, | |||||||||
| 86 | { | ||||||||||
| 87 | list_parm => [ 'AttributeName' ] | ||||||||||
| 88 | } | ||||||||||
| 89 | ); | ||||||||||
| 90 | 0 | return $self->call('DescribeAccountAttributes',@params); | |||||||||
| 91 | } | ||||||||||
| 92 | |||||||||||
| 93 | =head1 SEE ALSO | ||||||||||
| 94 | |||||||||||
| 95 | L<VM::EC2> | ||||||||||
| 96 | |||||||||||
| 97 | =head1 AUTHOR | ||||||||||
| 98 | |||||||||||
| 99 | Lincoln Stein E<lt>lincoln.stein@gmail.comE<gt>. | ||||||||||
| 100 | |||||||||||
| 101 | Copyright (c) 2011 Ontario Institute for Cancer Research | ||||||||||
| 102 | |||||||||||
| 103 | This package and its accompanying libraries is free software; you can | ||||||||||
| 104 | redistribute it and/or modify it under the terms of the GPL (either | ||||||||||
| 105 | version 1, or at your option, any later version) or the Artistic | ||||||||||
| 106 | License 2.0. Refer to LICENSE for the full license text. In addition, | ||||||||||
| 107 | please see DISCLAIMER.txt for disclaimers of warranty. | ||||||||||
| 108 | |||||||||||
| 109 | =cut | ||||||||||
| 110 | |||||||||||
| 111 | |||||||||||
| 112 | 7 | 1; | |||||||||