Struct aws_sdk_ec2::model::Image

source ·
#[non_exhaustive]
pub struct Image { /* private fields */ }
Expand description

Describes an image.

Implementations§

The architecture of the image.

The date and time the image was created.

The ID of the AMI.

The location of the AMI.

The type of image.

Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.

The kernel associated with the image, if any. Only applicable for machine images.

The ID of the Amazon Web Services account that owns the image.

This value is set to windows for Windows AMIs; otherwise, it is blank.

The platform details associated with the billing code of the AMI. For more information, see Understanding AMI billing in the Amazon Elastic Compute Cloud User Guide.

The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. usageOperation corresponds to the lineitem/Operation column on your Amazon Web Services Cost and Usage Report and in the Amazon Web Services Price List API. You can view these fields on the Instances or AMIs pages in the Amazon EC2 console, or in the responses that are returned by the DescribeImages command in the Amazon EC2 API, or the describe-images command in the CLI.

Any product codes associated with the AMI.

The RAM disk associated with the image, if any. Only applicable for machine images.

The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.

Any block device mapping entries.

The description of the AMI that was provided during image creation.

Specifies whether enhanced networking with ENA is enabled.

The hypervisor type of the image.

The Amazon Web Services account alias (for example, amazon, self) or the Amazon Web Services account ID of the AMI owner.

The name of the AMI that was provided during image creation.

The device name of the root device volume (for example, /dev/sda1).

The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.

Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.

The reason for the state change.

Any tags assigned to the image.

The type of virtualization of the AMI.

The boot mode of the image. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.

If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.

The date and time to deprecate the AMI, in UTC, in the following format: YYYY-MM-DDTHH:MM:SSZ. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute.

If v2.0, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have HttpTokens automatically set to required so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit is set to 2. For more information, see Configure the AMI in the Amazon Elastic Compute Cloud User Guide.

Creates a new builder-style object to manufacture Image.

Examples found in repository?
src/xml_deser.rs (line 46263)
46259
46260
46261
46262
46263
46264
46265
46266
46267
46268
46269
46270
46271
46272
46273
46274
46275
46276
46277
46278
46279
46280
46281
46282
46283
46284
46285
46286
46287
46288
46289
46290
46291
46292
46293
46294
46295
46296
46297
46298
46299
46300
46301
46302
46303
46304
46305
46306
46307
46308
46309
46310
46311
46312
46313
46314
46315
46316
46317
46318
46319
46320
46321
46322
46323
46324
46325
46326
46327
46328
46329
46330
46331
46332
46333
46334
46335
46336
46337
46338
46339
46340
46341
46342
46343
46344
46345
46346
46347
46348
46349
46350
46351
46352
46353
46354
46355
46356
46357
46358
46359
46360
46361
46362
46363
46364
46365
46366
46367
46368
46369
46370
46371
46372
46373
46374
46375
46376
46377
46378
46379
46380
46381
46382
46383
46384
46385
46386
46387
46388
46389
46390
46391
46392
46393
46394
46395
46396
46397
46398
46399
46400
46401
46402
46403
46404
46405
46406
46407
46408
46409
46410
46411
46412
46413
46414
46415
46416
46417
46418
46419
46420
46421
46422
46423
46424
46425
46426
46427
46428
46429
46430
46431
46432
46433
46434
46435
46436
46437
46438
46439
46440
46441
46442
46443
46444
46445
46446
46447
46448
46449
46450
46451
46452
46453
46454
46455
46456
46457
46458
46459
46460
46461
46462
46463
46464
46465
46466
46467
46468
46469
46470
46471
46472
46473
46474
46475
46476
46477
46478
46479
46480
46481
46482
46483
46484
46485
46486
46487
46488
46489
46490
46491
46492
46493
46494
46495
46496
46497
46498
46499
46500
46501
46502
46503
46504
46505
46506
46507
46508
46509
46510
46511
46512
46513
46514
46515
46516
46517
46518
46519
46520
46521
46522
46523
46524
46525
46526
46527
46528
46529
46530
46531
46532
46533
46534
46535
46536
46537
46538
46539
46540
46541
46542
46543
46544
46545
46546
46547
46548
46549
46550
46551
46552
46553
46554
46555
46556
46557
46558
46559
46560
46561
46562
46563
46564
46565
46566
46567
46568
46569
46570
46571
46572
46573
46574
46575
46576
46577
46578
46579
46580
46581
46582
46583
46584
46585
46586
46587
46588
46589
46590
46591
46592
46593
46594
46595
46596
46597
46598
46599
46600
46601
46602
46603
46604
46605
46606
46607
46608
46609
46610
46611
46612
46613
46614
46615
46616
46617
46618
46619
46620
46621
46622
46623
46624
46625
46626
46627
46628
46629
46630
46631
46632
46633
46634
46635
46636
46637
46638
46639
46640
46641
46642
46643
46644
46645
46646
46647
46648
46649
46650
46651
46652
46653
46654
46655
46656
46657
46658
46659
46660
46661
46662
pub fn deser_structure_crate_model_image(
    decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::Image, aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::model::Image::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("architecture") /* Architecture com.amazonaws.ec2#Image$Architecture */ =>  {
                let var_2079 =
                    Some(
                        Result::<crate::model::ArchitectureValues, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::ArchitectureValues::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_architecture(var_2079);
            }
            ,
            s if s.matches("creationDate") /* CreationDate com.amazonaws.ec2#Image$CreationDate */ =>  {
                let var_2080 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_creation_date(var_2080);
            }
            ,
            s if s.matches("imageId") /* ImageId com.amazonaws.ec2#Image$ImageId */ =>  {
                let var_2081 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_image_id(var_2081);
            }
            ,
            s if s.matches("imageLocation") /* ImageLocation com.amazonaws.ec2#Image$ImageLocation */ =>  {
                let var_2082 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_image_location(var_2082);
            }
            ,
            s if s.matches("imageType") /* ImageType com.amazonaws.ec2#Image$ImageType */ =>  {
                let var_2083 =
                    Some(
                        Result::<crate::model::ImageTypeValues, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::ImageTypeValues::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_image_type(var_2083);
            }
            ,
            s if s.matches("isPublic") /* Public com.amazonaws.ec2#Image$Public */ =>  {
                let var_2084 =
                    Some(
                         {
                            <bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_public(var_2084);
            }
            ,
            s if s.matches("kernelId") /* KernelId com.amazonaws.ec2#Image$KernelId */ =>  {
                let var_2085 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_kernel_id(var_2085);
            }
            ,
            s if s.matches("imageOwnerId") /* OwnerId com.amazonaws.ec2#Image$OwnerId */ =>  {
                let var_2086 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_owner_id(var_2086);
            }
            ,
            s if s.matches("platform") /* Platform com.amazonaws.ec2#Image$Platform */ =>  {
                let var_2087 =
                    Some(
                        Result::<crate::model::PlatformValues, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::PlatformValues::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_platform(var_2087);
            }
            ,
            s if s.matches("platformDetails") /* PlatformDetails com.amazonaws.ec2#Image$PlatformDetails */ =>  {
                let var_2088 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_platform_details(var_2088);
            }
            ,
            s if s.matches("usageOperation") /* UsageOperation com.amazonaws.ec2#Image$UsageOperation */ =>  {
                let var_2089 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_usage_operation(var_2089);
            }
            ,
            s if s.matches("productCodes") /* ProductCodes com.amazonaws.ec2#Image$ProductCodes */ =>  {
                let var_2090 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_product_code_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_product_codes(var_2090);
            }
            ,
            s if s.matches("ramdiskId") /* RamdiskId com.amazonaws.ec2#Image$RamdiskId */ =>  {
                let var_2091 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_ramdisk_id(var_2091);
            }
            ,
            s if s.matches("imageState") /* State com.amazonaws.ec2#Image$State */ =>  {
                let var_2092 =
                    Some(
                        Result::<crate::model::ImageState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::ImageState::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_state(var_2092);
            }
            ,
            s if s.matches("blockDeviceMapping") /* BlockDeviceMappings com.amazonaws.ec2#Image$BlockDeviceMappings */ =>  {
                let var_2093 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_block_device_mapping_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_block_device_mappings(var_2093);
            }
            ,
            s if s.matches("description") /* Description com.amazonaws.ec2#Image$Description */ =>  {
                let var_2094 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_description(var_2094);
            }
            ,
            s if s.matches("enaSupport") /* EnaSupport com.amazonaws.ec2#Image$EnaSupport */ =>  {
                let var_2095 =
                    Some(
                         {
                            <bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_ena_support(var_2095);
            }
            ,
            s if s.matches("hypervisor") /* Hypervisor com.amazonaws.ec2#Image$Hypervisor */ =>  {
                let var_2096 =
                    Some(
                        Result::<crate::model::HypervisorType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::HypervisorType::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_hypervisor(var_2096);
            }
            ,
            s if s.matches("imageOwnerAlias") /* ImageOwnerAlias com.amazonaws.ec2#Image$ImageOwnerAlias */ =>  {
                let var_2097 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_image_owner_alias(var_2097);
            }
            ,
            s if s.matches("name") /* Name com.amazonaws.ec2#Image$Name */ =>  {
                let var_2098 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_name(var_2098);
            }
            ,
            s if s.matches("rootDeviceName") /* RootDeviceName com.amazonaws.ec2#Image$RootDeviceName */ =>  {
                let var_2099 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_root_device_name(var_2099);
            }
            ,
            s if s.matches("rootDeviceType") /* RootDeviceType com.amazonaws.ec2#Image$RootDeviceType */ =>  {
                let var_2100 =
                    Some(
                        Result::<crate::model::DeviceType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::DeviceType::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_root_device_type(var_2100);
            }
            ,
            s if s.matches("sriovNetSupport") /* SriovNetSupport com.amazonaws.ec2#Image$SriovNetSupport */ =>  {
                let var_2101 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_sriov_net_support(var_2101);
            }
            ,
            s if s.matches("stateReason") /* StateReason com.amazonaws.ec2#Image$StateReason */ =>  {
                let var_2102 =
                    Some(
                        crate::xml_deser::deser_structure_crate_model_state_reason(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_state_reason(var_2102);
            }
            ,
            s if s.matches("tagSet") /* Tags com.amazonaws.ec2#Image$Tags */ =>  {
                let var_2103 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_tag_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_tags(var_2103);
            }
            ,
            s if s.matches("virtualizationType") /* VirtualizationType com.amazonaws.ec2#Image$VirtualizationType */ =>  {
                let var_2104 =
                    Some(
                        Result::<crate::model::VirtualizationType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::VirtualizationType::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_virtualization_type(var_2104);
            }
            ,
            s if s.matches("bootMode") /* BootMode com.amazonaws.ec2#Image$BootMode */ =>  {
                let var_2105 =
                    Some(
                        Result::<crate::model::BootModeValues, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::BootModeValues::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_boot_mode(var_2105);
            }
            ,
            s if s.matches("tpmSupport") /* TpmSupport com.amazonaws.ec2#Image$TpmSupport */ =>  {
                let var_2106 =
                    Some(
                        Result::<crate::model::TpmSupportValues, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::TpmSupportValues::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_tpm_support(var_2106);
            }
            ,
            s if s.matches("deprecationTime") /* DeprecationTime com.amazonaws.ec2#Image$DeprecationTime */ =>  {
                let var_2107 =
                    Some(
                        Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            .into()
                        )
                        ?
                    )
                ;
                builder = builder.set_deprecation_time(var_2107);
            }
            ,
            s if s.matches("imdsSupport") /* ImdsSupport com.amazonaws.ec2#Image$ImdsSupport */ =>  {
                let var_2108 =
                    Some(
                        Result::<crate::model::ImdsSupportValues, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::ImdsSupportValues::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_imds_support(var_2108);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more