#[non_exhaustive]
pub struct CapacityReservation { /* private fields */ }
Expand description

Describes a Capacity Reservation.

Implementations§

The ID of the Capacity Reservation.

The ID of the Amazon Web Services account that owns the Capacity Reservation.

The Amazon Resource Name (ARN) of the Capacity Reservation.

The Availability Zone ID of the Capacity Reservation.

The type of instance for which the Capacity Reservation reserves capacity.

The type of operating system for which the Capacity Reservation reserves capacity.

The Availability Zone in which the capacity is reserved.

Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:

  • default - The Capacity Reservation is created on hardware that is shared with other Amazon Web Services accounts.

  • dedicated - The Capacity Reservation is created on single-tenant hardware that is dedicated to a single Amazon Web Services account.

The total number of instances for which the Capacity Reservation reserves capacity.

The remaining capacity. Indicates the number of instances that can be launched in the Capacity Reservation.

Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.

Deprecated.

The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:

  • active - The Capacity Reservation is active and the capacity is available for your use.

  • expired - The Capacity Reservation expired automatically at the date and time specified in your request. The reserved capacity is no longer available for your use.

  • cancelled - The Capacity Reservation was cancelled. The reserved capacity is no longer available for your use.

  • pending - The Capacity Reservation request was successful but the capacity provisioning is still pending.

  • failed - The Capacity Reservation request has failed. A request might fail due to invalid request parameters, capacity constraints, or instance limit constraints. Failed requests are retained for 60 minutes.

The date and time at which the Capacity Reservation was started.

The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired when it reaches its end date and time.

Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:

  • unlimited - The Capacity Reservation remains active until you explicitly cancel it.

  • limited - The Capacity Reservation expires automatically at a specified date and time.

Indicates the type of instance launches that the Capacity Reservation accepts. The options include:

  • open - The Capacity Reservation accepts all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes launch into the Capacity Reservation automatically without specifying any additional parameters.

  • targeted - The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.

The date and time at which the Capacity Reservation was created.

Any tags assigned to the Capacity Reservation.

The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation was created.

The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. Only valid for Capacity Reservations that were created by a Capacity Reservation Fleet.

The Amazon Resource Name (ARN) of the cluster placement group in which the Capacity Reservation was created. For more information, see Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide.

Information about instance capacity usage.

Creates a new builder-style object to manufacture CapacityReservation.

Examples found in repository?
src/xml_deser.rs (line 25633)
25629
25630
25631
25632
25633
25634
25635
25636
25637
25638
25639
25640
25641
25642
25643
25644
25645
25646
25647
25648
25649
25650
25651
25652
25653
25654
25655
25656
25657
25658
25659
25660
25661
25662
25663
25664
25665
25666
25667
25668
25669
25670
25671
25672
25673
25674
25675
25676
25677
25678
25679
25680
25681
25682
25683
25684
25685
25686
25687
25688
25689
25690
25691
25692
25693
25694
25695
25696
25697
25698
25699
25700
25701
25702
25703
25704
25705
25706
25707
25708
25709
25710
25711
25712
25713
25714
25715
25716
25717
25718
25719
25720
25721
25722
25723
25724
25725
25726
25727
25728
25729
25730
25731
25732
25733
25734
25735
25736
25737
25738
25739
25740
25741
25742
25743
25744
25745
25746
25747
25748
25749
25750
25751
25752
25753
25754
25755
25756
25757
25758
25759
25760
25761
25762
25763
25764
25765
25766
25767
25768
25769
25770
25771
25772
25773
25774
25775
25776
25777
25778
25779
25780
25781
25782
25783
25784
25785
25786
25787
25788
25789
25790
25791
25792
25793
25794
25795
25796
25797
25798
25799
25800
25801
25802
25803
25804
25805
25806
25807
25808
25809
25810
25811
25812
25813
25814
25815
25816
25817
25818
25819
25820
25821
25822
25823
25824
25825
25826
25827
25828
25829
25830
25831
25832
25833
25834
25835
25836
25837
25838
25839
25840
25841
25842
25843
25844
25845
25846
25847
25848
25849
25850
25851
25852
25853
25854
25855
25856
25857
25858
25859
25860
25861
25862
25863
25864
25865
25866
25867
25868
25869
25870
25871
25872
25873
25874
25875
25876
25877
25878
25879
25880
25881
25882
25883
25884
25885
25886
25887
25888
25889
25890
25891
25892
25893
25894
25895
25896
25897
25898
25899
25900
25901
25902
25903
25904
25905
25906
25907
25908
25909
25910
25911
25912
25913
25914
25915
25916
25917
25918
25919
25920
25921
25922
25923
25924
25925
25926
25927
25928
25929
25930
25931
25932
25933
25934
25935
25936
25937
25938
25939
25940
25941
25942
25943
25944
25945
25946
25947
25948
25949
pub fn deser_structure_crate_model_capacity_reservation(
    decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::CapacityReservation, aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::model::CapacityReservation::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("capacityReservationId") /* CapacityReservationId com.amazonaws.ec2#CapacityReservation$CapacityReservationId */ =>  {
                let var_992 =
                    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_capacity_reservation_id(var_992);
            }
            ,
            s if s.matches("ownerId") /* OwnerId com.amazonaws.ec2#CapacityReservation$OwnerId */ =>  {
                let var_993 =
                    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_993);
            }
            ,
            s if s.matches("capacityReservationArn") /* CapacityReservationArn com.amazonaws.ec2#CapacityReservation$CapacityReservationArn */ =>  {
                let var_994 =
                    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_capacity_reservation_arn(var_994);
            }
            ,
            s if s.matches("availabilityZoneId") /* AvailabilityZoneId com.amazonaws.ec2#CapacityReservation$AvailabilityZoneId */ =>  {
                let var_995 =
                    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_availability_zone_id(var_995);
            }
            ,
            s if s.matches("instanceType") /* InstanceType com.amazonaws.ec2#CapacityReservation$InstanceType */ =>  {
                let var_996 =
                    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_instance_type(var_996);
            }
            ,
            s if s.matches("instancePlatform") /* InstancePlatform com.amazonaws.ec2#CapacityReservation$InstancePlatform */ =>  {
                let var_997 =
                    Some(
                        Result::<crate::model::CapacityReservationInstancePlatform, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::CapacityReservationInstancePlatform::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_instance_platform(var_997);
            }
            ,
            s if s.matches("availabilityZone") /* AvailabilityZone com.amazonaws.ec2#CapacityReservation$AvailabilityZone */ =>  {
                let var_998 =
                    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_availability_zone(var_998);
            }
            ,
            s if s.matches("tenancy") /* Tenancy com.amazonaws.ec2#CapacityReservation$Tenancy */ =>  {
                let var_999 =
                    Some(
                        Result::<crate::model::CapacityReservationTenancy, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::CapacityReservationTenancy::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_tenancy(var_999);
            }
            ,
            s if s.matches("totalInstanceCount") /* TotalInstanceCount com.amazonaws.ec2#CapacityReservation$TotalInstanceCount */ =>  {
                let var_1000 =
                    Some(
                         {
                            <i32 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 (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_total_instance_count(var_1000);
            }
            ,
            s if s.matches("availableInstanceCount") /* AvailableInstanceCount com.amazonaws.ec2#CapacityReservation$AvailableInstanceCount */ =>  {
                let var_1001 =
                    Some(
                         {
                            <i32 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 (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_available_instance_count(var_1001);
            }
            ,
            s if s.matches("ebsOptimized") /* EbsOptimized com.amazonaws.ec2#CapacityReservation$EbsOptimized */ =>  {
                let var_1002 =
                    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_ebs_optimized(var_1002);
            }
            ,
            s if s.matches("ephemeralStorage") /* EphemeralStorage com.amazonaws.ec2#CapacityReservation$EphemeralStorage */ =>  {
                let var_1003 =
                    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_ephemeral_storage(var_1003);
            }
            ,
            s if s.matches("state") /* State com.amazonaws.ec2#CapacityReservation$State */ =>  {
                let var_1004 =
                    Some(
                        Result::<crate::model::CapacityReservationState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::CapacityReservationState::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_state(var_1004);
            }
            ,
            s if s.matches("startDate") /* StartDate com.amazonaws.ec2#CapacityReservation$StartDate */ =>  {
                let var_1005 =
                    Some(
                        aws_smithy_types::DateTime::from_str(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , aws_smithy_types::date_time::Format::DateTime
                        )
                        .map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_start_date(var_1005);
            }
            ,
            s if s.matches("endDate") /* EndDate com.amazonaws.ec2#CapacityReservation$EndDate */ =>  {
                let var_1006 =
                    Some(
                        aws_smithy_types::DateTime::from_str(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , aws_smithy_types::date_time::Format::DateTime
                        )
                        .map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_end_date(var_1006);
            }
            ,
            s if s.matches("endDateType") /* EndDateType com.amazonaws.ec2#CapacityReservation$EndDateType */ =>  {
                let var_1007 =
                    Some(
                        Result::<crate::model::EndDateType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::EndDateType::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_end_date_type(var_1007);
            }
            ,
            s if s.matches("instanceMatchCriteria") /* InstanceMatchCriteria com.amazonaws.ec2#CapacityReservation$InstanceMatchCriteria */ =>  {
                let var_1008 =
                    Some(
                        Result::<crate::model::InstanceMatchCriteria, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::InstanceMatchCriteria::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_instance_match_criteria(var_1008);
            }
            ,
            s if s.matches("createDate") /* CreateDate com.amazonaws.ec2#CapacityReservation$CreateDate */ =>  {
                let var_1009 =
                    Some(
                        aws_smithy_types::DateTime::from_str(
                            aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , aws_smithy_types::date_time::Format::DateTime
                        )
                        .map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_create_date(var_1009);
            }
            ,
            s if s.matches("tagSet") /* Tags com.amazonaws.ec2#CapacityReservation$Tags */ =>  {
                let var_1010 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_tag_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_tags(var_1010);
            }
            ,
            s if s.matches("outpostArn") /* OutpostArn com.amazonaws.ec2#CapacityReservation$OutpostArn */ =>  {
                let var_1011 =
                    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_outpost_arn(var_1011);
            }
            ,
            s if s.matches("capacityReservationFleetId") /* CapacityReservationFleetId com.amazonaws.ec2#CapacityReservation$CapacityReservationFleetId */ =>  {
                let var_1012 =
                    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_capacity_reservation_fleet_id(var_1012);
            }
            ,
            s if s.matches("placementGroupArn") /* PlacementGroupArn com.amazonaws.ec2#CapacityReservation$PlacementGroupArn */ =>  {
                let var_1013 =
                    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_placement_group_arn(var_1013);
            }
            ,
            s if s.matches("capacityAllocationSet") /* CapacityAllocations com.amazonaws.ec2#CapacityReservation$CapacityAllocations */ =>  {
                let var_1014 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_capacity_allocations(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_capacity_allocations(var_1014);
            }
            ,
            _ => {}
        }
    }
    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