« blib/lib/Paws/EC2/CreateDhcpOptionsResult.pm
↑ Summary
blib/lib/Paws/EC2/CreateInstanceExportTask.pm »
| 1 | |||
| 2 | package Paws::EC2::CreateImage; | ||
| 3 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | has BlockDeviceMappings => (is => 'ro', isa => 'ArrayRef[Paws::EC2::BlockDeviceMapping]', traits => ['NameInRequest'], request_name => 'blockDeviceMapping' ); | |
| 5 | 1 | has Description => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'description' ); | |
| 6 | 1 | has DryRun => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'dryRun' ); | |
| 7 | 1 | has InstanceId => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'instanceId' , required => 1); | |
| 8 | 1 | has Name => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'name' , required => 1); | |
| 9 | 1 | has NoReboot => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'noReboot' ); | |
| 10 | 1 | has TagSpecifications => (is => 'ro', isa => 'ArrayRef[Paws::EC2::TagSpecification]', traits => ['NameInRequest'], request_name => 'TagSpecification' ); | |
| 11 | |||
| 12 | 1 | ▶ | use MooseX::ClassAttribute; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 1 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateImage'); | |
| 15 | 1 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::EC2::CreateImageResult'); | |
| 16 | 1 | class_has _result_key => (isa => 'Str', is => 'ro'); | |
| 17 | 1 | 1; | |
| 18 | |||
| 19 | ### main pod documentation begin ### | ||
| 20 | |||
| 21 | =head1 NAME | ||
| 22 | |||
| 23 | Paws::EC2::CreateImage - Arguments for method CreateImage on L<Paws::EC2> | ||
| 24 | |||
| 25 | =head1 DESCRIPTION | ||
| 26 | |||
| 27 | This class represents the parameters used for calling the method CreateImage on the | ||
| 28 | L<Amazon Elastic Compute Cloud|Paws::EC2> service. Use the attributes of this class | ||
| 29 | as arguments to method CreateImage. | ||
| 30 | |||
| 31 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateImage. | ||
| 32 | |||
| 33 | =head1 SYNOPSIS | ||
| 34 | |||
| 35 | my $ec2 = Paws->service('EC2'); | ||
| 36 | # To create an AMI from an Amazon EBS-backed instance | ||
| 37 | # This example creates an AMI from the specified instance and adds an EBS volume | ||
| 38 | # with the device name /dev/sdh and an instance store volume with the device | ||
| 39 | # name /dev/sdc. | ||
| 40 | my $CreateImageResult = $ec2->CreateImage( | ||
| 41 | 'BlockDeviceMappings' => [ | ||
| 42 | |||
| 43 | { | ||
| 44 | 'DeviceName' => '/dev/sdh', | ||
| 45 | 'Ebs' => { | ||
| 46 | 'VolumeSize' => 100 | ||
| 47 | } | ||
| 48 | }, | ||
| 49 | |||
| 50 | { | ||
| 51 | 'DeviceName' => '/dev/sdc', | ||
| 52 | 'VirtualName' => 'ephemeral1' | ||
| 53 | } | ||
| 54 | ], | ||
| 55 | 'Description' => 'An AMI for my server', | ||
| 56 | 'InstanceId' => 'i-1234567890abcdef0', | ||
| 57 | 'Name' => 'My server', | ||
| 58 | 'NoReboot' => 1 | ||
| 59 | ); | ||
| 60 | |||
| 61 | # Results: | ||
| 62 | my $ImageId = $CreateImageResult->ImageId; | ||
| 63 | |||
| 64 | # Returns a L<Paws::EC2::CreateImageResult> object. | ||
| 65 | |||
| 66 | Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. | ||
| 67 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/ec2/CreateImage> | ||
| 68 | |||
| 69 | =head1 ATTRIBUTES | ||
| 70 | |||
| 71 | |||
| 72 | =head2 BlockDeviceMappings => ArrayRef[L<Paws::EC2::BlockDeviceMapping>] | ||
| 73 | |||
| 74 | The block device mappings. This parameter cannot be used to modify the | ||
| 75 | encryption status of existing volumes or snapshots. To create an AMI | ||
| 76 | with encrypted snapshots, use the CopyImage action. | ||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | =head2 Description => Str | ||
| 81 | |||
| 82 | A description for the new image. | ||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | =head2 DryRun => Bool | ||
| 87 | |||
| 88 | Checks whether you have the required permissions for the action, | ||
| 89 | without actually making the request, and provides an error response. If | ||
| 90 | you have the required permissions, the error response is | ||
| 91 | C<DryRunOperation>. Otherwise, it is C<UnauthorizedOperation>. | ||
| 92 | |||
| 93 | |||
| 94 | |||
| 95 | =head2 B<REQUIRED> InstanceId => Str | ||
| 96 | |||
| 97 | The ID of the instance. | ||
| 98 | |||
| 99 | |||
| 100 | |||
| 101 | =head2 B<REQUIRED> Name => Str | ||
| 102 | |||
| 103 | A name for the new image. | ||
| 104 | |||
| 105 | Constraints: 3-128 alphanumeric characters, parentheses (()), square | ||
| 106 | brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single | ||
| 107 | quotes ('), at-signs (@), or underscores(_) | ||
| 108 | |||
| 109 | |||
| 110 | |||
| 111 | =head2 NoReboot => Bool | ||
| 112 | |||
| 113 | By default, Amazon EC2 attempts to shut down and reboot the instance | ||
| 114 | before creating the image. If the C<No Reboot> option is set, Amazon | ||
| 115 | EC2 doesn't shut down the instance before creating the image. When this | ||
| 116 | option is used, file system integrity on the created image can't be | ||
| 117 | guaranteed. | ||
| 118 | |||
| 119 | |||
| 120 | |||
| 121 | =head2 TagSpecifications => ArrayRef[L<Paws::EC2::TagSpecification>] | ||
| 122 | |||
| 123 | The tags to apply to the AMI and snapshots on creation. You can tag the | ||
| 124 | AMI, the snapshots, or both. | ||
| 125 | |||
| 126 | =over | ||
| 127 | |||
| 128 | =item * | ||
| 129 | |||
| 130 | To tag the AMI, the value for C<ResourceType> must be C<image>. | ||
| 131 | |||
| 132 | =item * | ||
| 133 | |||
| 134 | To tag the snapshots that are created of the root volume and of other | ||
| 135 | EBS volumes that are attached to the instance, the value for | ||
| 136 | C<ResourceType> must be C<snapshot>. The same tag is applied to all of | ||
| 137 | the snapshots that are created. | ||
| 138 | |||
| 139 | =back | ||
| 140 | |||
| 141 | If you specify other values for C<ResourceType>, the request fails. | ||
| 142 | |||
| 143 | To tag an AMI or snapshot after it has been created, see CreateTags | ||
| 144 | (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html). | ||
| 145 | |||
| 146 | |||
| 147 | |||
| 148 | |||
| 149 | =head1 SEE ALSO | ||
| 150 | |||
| 151 | This class forms part of L<Paws>, documenting arguments for method CreateImage in L<Paws::EC2> | ||
| 152 | |||
| 153 | =head1 BUGS and CONTRIBUTIONS | ||
| 154 | |||
| 155 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 156 | |||
| 157 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 158 | |||
| 159 | =cut | ||
| 160 | |||