/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.EC2.Model
{
///
/// Container for the parameters to the CreateCapacityReservation operation.
/// Creates a new Capacity Reservation with the specified attributes.
///
///
///
/// Capacity Reservations enable you to reserve capacity for your Amazon EC2 instances
/// in a specific Availability Zone for any duration. This gives you the flexibility to
/// selectively add capacity reservations and still get the Regional RI discounts for
/// that usage. By creating Capacity Reservations, you ensure that you always have access
/// to Amazon EC2 capacity when you need it, for as long as you need it. For more information,
/// see Capacity
/// Reservations in the Amazon EC2 User Guide.
///
///
///
/// Your request to create a Capacity Reservation could fail if Amazon EC2 does not have
/// sufficient capacity to fulfill the request. If your request fails due to Amazon EC2
/// capacity constraints, either try again at a later time, try in a different Availability
/// Zone, or request a smaller capacity reservation. If your application is flexible across
/// instance types and sizes, try to create a Capacity Reservation with different instance
/// attributes.
///
///
///
/// Your request could also fail if the requested quantity exceeds your On-Demand Instance
/// limit for the selected instance type. If your request fails due to limit constraints,
/// increase your On-Demand Instance limit for the required instance type and try again.
/// For more information about increasing your instance limits, see Amazon
/// EC2 Service Quotas in the Amazon EC2 User Guide.
///
///
public partial class CreateCapacityReservationRequest : AmazonEC2Request
{
private string _availabilityZone;
private string _availabilityZoneId;
private string _clientToken;
private bool? _ebsOptimized;
private DateTime? _endDate;
private EndDateType _endDateType;
private bool? _ephemeralStorage;
private int? _instanceCount;
private InstanceMatchCriteria _instanceMatchCriteria;
private CapacityReservationInstancePlatform _instancePlatform;
private string _instanceType;
private string _outpostArn;
private string _placementGroupArn;
private List _tagSpecifications = new List();
private CapacityReservationTenancy _tenancy;
///
/// Gets and sets the property AvailabilityZone.
///
/// The Availability Zone in which to create the Capacity Reservation.
///
///
public string AvailabilityZone
{
get { return this._availabilityZone; }
set { this._availabilityZone = value; }
}
// Check to see if AvailabilityZone property is set
internal bool IsSetAvailabilityZone()
{
return this._availabilityZone != null;
}
///
/// Gets and sets the property AvailabilityZoneId.
///
/// The ID of the Availability Zone in which to create the Capacity Reservation.
///
///
public string AvailabilityZoneId
{
get { return this._availabilityZoneId; }
set { this._availabilityZoneId = value; }
}
// Check to see if AvailabilityZoneId property is set
internal bool IsSetAvailabilityZoneId()
{
return this._availabilityZoneId != null;
}
///
/// Gets and sets the property ClientToken.
///
/// Unique, case-sensitive identifier that you provide to ensure the idempotency of the
/// request. For more information, see Ensure
/// Idempotency.
///
///
public string ClientToken
{
get { return this._clientToken; }
set { this._clientToken = value; }
}
// Check to see if ClientToken property is set
internal bool IsSetClientToken()
{
return this._clientToken != null;
}
///
/// Gets and sets the property EbsOptimized.
///
/// 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.
///
///
public bool EbsOptimized
{
get { return this._ebsOptimized.GetValueOrDefault(); }
set { this._ebsOptimized = value; }
}
// Check to see if EbsOptimized property is set
internal bool IsSetEbsOptimized()
{
return this._ebsOptimized.HasValue;
}
///
/// Gets and sets the property EndDate.
///
/// 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.
///
///
///
/// You must provide an EndDate
value if EndDateType
is limited
.
/// Omit EndDate
if EndDateType
is unlimited
.
///
///
///
/// If the EndDateType
is limited
, the Capacity Reservation
/// is cancelled within an hour from the specified time. For example, if you specify 5/31/2019,
/// 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55
/// on 5/31/2019.
///
///
public DateTime EndDate
{
get { return this._endDate.GetValueOrDefault(); }
set { this._endDate = value; }
}
// Check to see if EndDate property is set
internal bool IsSetEndDate()
{
return this._endDate.HasValue;
}
///
/// Gets and sets the property EndDateType.
///
/// 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. Do not provide an EndDate
if the EndDateType
/// is unlimited
.
///
/// -
///
///
limited
- The Capacity Reservation expires automatically at a specified
/// date and time. You must provide an EndDate
value if the EndDateType
/// value is limited
.
///
///
///
public EndDateType EndDateType
{
get { return this._endDateType; }
set { this._endDateType = value; }
}
// Check to see if EndDateType property is set
internal bool IsSetEndDateType()
{
return this._endDateType != null;
}
///
/// Gets and sets the property EphemeralStorage.
///
/// Deprecated.
///
///
public bool EphemeralStorage
{
get { return this._ephemeralStorage.GetValueOrDefault(); }
set { this._ephemeralStorage = value; }
}
// Check to see if EphemeralStorage property is set
internal bool IsSetEphemeralStorage()
{
return this._ephemeralStorage.HasValue;
}
///
/// Gets and sets the property InstanceCount.
///
/// The number of instances for which to reserve capacity.
///
///
///
/// Valid range: 1 - 1000
///
///
[AWSProperty(Required=true)]
public int InstanceCount
{
get { return this._instanceCount.GetValueOrDefault(); }
set { this._instanceCount = value; }
}
// Check to see if InstanceCount property is set
internal bool IsSetInstanceCount()
{
return this._instanceCount.HasValue;
}
///
/// Gets and sets the property InstanceMatchCriteria.
///
/// Indicates the type of instance launches that the Capacity Reservation accepts. The
/// options include:
///
/// -
///
///
open
- The Capacity Reservation automatically matches all instances
/// that have matching attributes (instance type, platform, and Availability Zone). Instances
/// that have matching attributes run in 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.
///
///
///
/// Default: open
///
///
public InstanceMatchCriteria InstanceMatchCriteria
{
get { return this._instanceMatchCriteria; }
set { this._instanceMatchCriteria = value; }
}
// Check to see if InstanceMatchCriteria property is set
internal bool IsSetInstanceMatchCriteria()
{
return this._instanceMatchCriteria != null;
}
///
/// Gets and sets the property InstancePlatform.
///
/// The type of operating system for which to reserve capacity.
///
///
[AWSProperty(Required=true)]
public CapacityReservationInstancePlatform InstancePlatform
{
get { return this._instancePlatform; }
set { this._instancePlatform = value; }
}
// Check to see if InstancePlatform property is set
internal bool IsSetInstancePlatform()
{
return this._instancePlatform != null;
}
///
/// Gets and sets the property InstanceType.
///
/// The instance type for which to reserve capacity. For more information, see Instance
/// types in the Amazon EC2 User Guide.
///
///
[AWSProperty(Required=true)]
public string InstanceType
{
get { return this._instanceType; }
set { this._instanceType = value; }
}
// Check to see if InstanceType property is set
internal bool IsSetInstanceType()
{
return this._instanceType != null;
}
///
/// Gets and sets the property OutpostArn.
///
/// The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
///
///
public string OutpostArn
{
get { return this._outpostArn; }
set { this._outpostArn = value; }
}
// Check to see if OutpostArn property is set
internal bool IsSetOutpostArn()
{
return this._outpostArn != null;
}
///
/// Gets and sets the property PlacementGroupArn.
///
/// The Amazon Resource Name (ARN) of the cluster placement group in which to create the
/// Capacity Reservation. For more information, see
/// Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide.
///
///
public string PlacementGroupArn
{
get { return this._placementGroupArn; }
set { this._placementGroupArn = value; }
}
// Check to see if PlacementGroupArn property is set
internal bool IsSetPlacementGroupArn()
{
return this._placementGroupArn != null;
}
///
/// Gets and sets the property TagSpecifications.
///
/// The tags to apply to the Capacity Reservation during launch.
///
///
public List TagSpecifications
{
get { return this._tagSpecifications; }
set { this._tagSpecifications = value; }
}
// Check to see if TagSpecifications property is set
internal bool IsSetTagSpecifications()
{
return this._tagSpecifications != null && this._tagSpecifications.Count > 0;
}
///
/// Gets and sets the property Tenancy.
///
/// 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.
///
///
///
public CapacityReservationTenancy Tenancy
{
get { return this._tenancy; }
set { this._tenancy = value; }
}
// Check to see if Tenancy property is set
internal bool IsSetTenancy()
{
return this._tenancy != null;
}
}
}