/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include #include #include namespace Aws { namespace EC2 { namespace Model { /** *

Contains the parameters for RequestSpotInstances.

See Also:

* AWS * API Reference

*/ class RequestSpotInstancesRequest : public EC2Request { public: AWS_EC2_API RequestSpotInstancesRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "RequestSpotInstances"; } AWS_EC2_API Aws::String SerializePayload() const override; protected: AWS_EC2_API void DumpBodyToUrl(Aws::Http::URI& uri ) const override; public: /** *

The user-specified name for a logical grouping of requests.

When you * specify an Availability Zone group in a Spot Instance request, all Spot * Instances in the request are launched in the same Availability Zone. Instance * proximity is maintained with this parameter, but the choice of Availability Zone * is not. The group applies only to requests for Spot Instances of the same * instance type. Any additional Spot Instance requests that are specified with the * same Availability Zone group name are launched in that same Availability Zone, * as long as at least one instance from the group is still active.

If there * is no active instance running in the Availability Zone group that you specify * for a new Spot Instance request (all instances are terminated, the request is * expired, or the maximum price you specified falls below current Spot price), * then Amazon EC2 launches the instance in any Availability Zone where the * constraint can be met. Consequently, the subsequent set of Spot Instances could * be placed in a different zone from the original request, even if you specified * the same Availability Zone group.

Default: Instances are launched in any * available Availability Zone.

*/ inline const Aws::String& GetAvailabilityZoneGroup() const{ return m_availabilityZoneGroup; } /** *

The user-specified name for a logical grouping of requests.

When you * specify an Availability Zone group in a Spot Instance request, all Spot * Instances in the request are launched in the same Availability Zone. Instance * proximity is maintained with this parameter, but the choice of Availability Zone * is not. The group applies only to requests for Spot Instances of the same * instance type. Any additional Spot Instance requests that are specified with the * same Availability Zone group name are launched in that same Availability Zone, * as long as at least one instance from the group is still active.

If there * is no active instance running in the Availability Zone group that you specify * for a new Spot Instance request (all instances are terminated, the request is * expired, or the maximum price you specified falls below current Spot price), * then Amazon EC2 launches the instance in any Availability Zone where the * constraint can be met. Consequently, the subsequent set of Spot Instances could * be placed in a different zone from the original request, even if you specified * the same Availability Zone group.

Default: Instances are launched in any * available Availability Zone.

*/ inline bool AvailabilityZoneGroupHasBeenSet() const { return m_availabilityZoneGroupHasBeenSet; } /** *

The user-specified name for a logical grouping of requests.

When you * specify an Availability Zone group in a Spot Instance request, all Spot * Instances in the request are launched in the same Availability Zone. Instance * proximity is maintained with this parameter, but the choice of Availability Zone * is not. The group applies only to requests for Spot Instances of the same * instance type. Any additional Spot Instance requests that are specified with the * same Availability Zone group name are launched in that same Availability Zone, * as long as at least one instance from the group is still active.

If there * is no active instance running in the Availability Zone group that you specify * for a new Spot Instance request (all instances are terminated, the request is * expired, or the maximum price you specified falls below current Spot price), * then Amazon EC2 launches the instance in any Availability Zone where the * constraint can be met. Consequently, the subsequent set of Spot Instances could * be placed in a different zone from the original request, even if you specified * the same Availability Zone group.

Default: Instances are launched in any * available Availability Zone.

*/ inline void SetAvailabilityZoneGroup(const Aws::String& value) { m_availabilityZoneGroupHasBeenSet = true; m_availabilityZoneGroup = value; } /** *

The user-specified name for a logical grouping of requests.

When you * specify an Availability Zone group in a Spot Instance request, all Spot * Instances in the request are launched in the same Availability Zone. Instance * proximity is maintained with this parameter, but the choice of Availability Zone * is not. The group applies only to requests for Spot Instances of the same * instance type. Any additional Spot Instance requests that are specified with the * same Availability Zone group name are launched in that same Availability Zone, * as long as at least one instance from the group is still active.

If there * is no active instance running in the Availability Zone group that you specify * for a new Spot Instance request (all instances are terminated, the request is * expired, or the maximum price you specified falls below current Spot price), * then Amazon EC2 launches the instance in any Availability Zone where the * constraint can be met. Consequently, the subsequent set of Spot Instances could * be placed in a different zone from the original request, even if you specified * the same Availability Zone group.

Default: Instances are launched in any * available Availability Zone.

*/ inline void SetAvailabilityZoneGroup(Aws::String&& value) { m_availabilityZoneGroupHasBeenSet = true; m_availabilityZoneGroup = std::move(value); } /** *

The user-specified name for a logical grouping of requests.

When you * specify an Availability Zone group in a Spot Instance request, all Spot * Instances in the request are launched in the same Availability Zone. Instance * proximity is maintained with this parameter, but the choice of Availability Zone * is not. The group applies only to requests for Spot Instances of the same * instance type. Any additional Spot Instance requests that are specified with the * same Availability Zone group name are launched in that same Availability Zone, * as long as at least one instance from the group is still active.

If there * is no active instance running in the Availability Zone group that you specify * for a new Spot Instance request (all instances are terminated, the request is * expired, or the maximum price you specified falls below current Spot price), * then Amazon EC2 launches the instance in any Availability Zone where the * constraint can be met. Consequently, the subsequent set of Spot Instances could * be placed in a different zone from the original request, even if you specified * the same Availability Zone group.

Default: Instances are launched in any * available Availability Zone.

*/ inline void SetAvailabilityZoneGroup(const char* value) { m_availabilityZoneGroupHasBeenSet = true; m_availabilityZoneGroup.assign(value); } /** *

The user-specified name for a logical grouping of requests.

When you * specify an Availability Zone group in a Spot Instance request, all Spot * Instances in the request are launched in the same Availability Zone. Instance * proximity is maintained with this parameter, but the choice of Availability Zone * is not. The group applies only to requests for Spot Instances of the same * instance type. Any additional Spot Instance requests that are specified with the * same Availability Zone group name are launched in that same Availability Zone, * as long as at least one instance from the group is still active.

If there * is no active instance running in the Availability Zone group that you specify * for a new Spot Instance request (all instances are terminated, the request is * expired, or the maximum price you specified falls below current Spot price), * then Amazon EC2 launches the instance in any Availability Zone where the * constraint can be met. Consequently, the subsequent set of Spot Instances could * be placed in a different zone from the original request, even if you specified * the same Availability Zone group.

Default: Instances are launched in any * available Availability Zone.

*/ inline RequestSpotInstancesRequest& WithAvailabilityZoneGroup(const Aws::String& value) { SetAvailabilityZoneGroup(value); return *this;} /** *

The user-specified name for a logical grouping of requests.

When you * specify an Availability Zone group in a Spot Instance request, all Spot * Instances in the request are launched in the same Availability Zone. Instance * proximity is maintained with this parameter, but the choice of Availability Zone * is not. The group applies only to requests for Spot Instances of the same * instance type. Any additional Spot Instance requests that are specified with the * same Availability Zone group name are launched in that same Availability Zone, * as long as at least one instance from the group is still active.

If there * is no active instance running in the Availability Zone group that you specify * for a new Spot Instance request (all instances are terminated, the request is * expired, or the maximum price you specified falls below current Spot price), * then Amazon EC2 launches the instance in any Availability Zone where the * constraint can be met. Consequently, the subsequent set of Spot Instances could * be placed in a different zone from the original request, even if you specified * the same Availability Zone group.

Default: Instances are launched in any * available Availability Zone.

*/ inline RequestSpotInstancesRequest& WithAvailabilityZoneGroup(Aws::String&& value) { SetAvailabilityZoneGroup(std::move(value)); return *this;} /** *

The user-specified name for a logical grouping of requests.

When you * specify an Availability Zone group in a Spot Instance request, all Spot * Instances in the request are launched in the same Availability Zone. Instance * proximity is maintained with this parameter, but the choice of Availability Zone * is not. The group applies only to requests for Spot Instances of the same * instance type. Any additional Spot Instance requests that are specified with the * same Availability Zone group name are launched in that same Availability Zone, * as long as at least one instance from the group is still active.

If there * is no active instance running in the Availability Zone group that you specify * for a new Spot Instance request (all instances are terminated, the request is * expired, or the maximum price you specified falls below current Spot price), * then Amazon EC2 launches the instance in any Availability Zone where the * constraint can be met. Consequently, the subsequent set of Spot Instances could * be placed in a different zone from the original request, even if you specified * the same Availability Zone group.

Default: Instances are launched in any * available Availability Zone.

*/ inline RequestSpotInstancesRequest& WithAvailabilityZoneGroup(const char* value) { SetAvailabilityZoneGroup(value); return *this;} /** *

Deprecated.

*/ inline int GetBlockDurationMinutes() const{ return m_blockDurationMinutes; } /** *

Deprecated.

*/ inline bool BlockDurationMinutesHasBeenSet() const { return m_blockDurationMinutesHasBeenSet; } /** *

Deprecated.

*/ inline void SetBlockDurationMinutes(int value) { m_blockDurationMinutesHasBeenSet = true; m_blockDurationMinutes = value; } /** *

Deprecated.

*/ inline RequestSpotInstancesRequest& WithBlockDurationMinutes(int value) { SetBlockDurationMinutes(value); return *this;} /** *

Unique, case-sensitive identifier that you provide to ensure the idempotency * of the request. For more information, see How * to Ensure Idempotency in the Amazon EC2 User Guide for Linux * Instances.

*/ inline const Aws::String& GetClientToken() const{ return m_clientToken; } /** *

Unique, case-sensitive identifier that you provide to ensure the idempotency * of the request. For more information, see How * to Ensure Idempotency in the Amazon EC2 User Guide for Linux * Instances.

*/ inline bool ClientTokenHasBeenSet() const { return m_clientTokenHasBeenSet; } /** *

Unique, case-sensitive identifier that you provide to ensure the idempotency * of the request. For more information, see How * to Ensure Idempotency in the Amazon EC2 User Guide for Linux * Instances.

*/ inline void SetClientToken(const Aws::String& value) { m_clientTokenHasBeenSet = true; m_clientToken = value; } /** *

Unique, case-sensitive identifier that you provide to ensure the idempotency * of the request. For more information, see How * to Ensure Idempotency in the Amazon EC2 User Guide for Linux * Instances.

*/ inline void SetClientToken(Aws::String&& value) { m_clientTokenHasBeenSet = true; m_clientToken = std::move(value); } /** *

Unique, case-sensitive identifier that you provide to ensure the idempotency * of the request. For more information, see How * to Ensure Idempotency in the Amazon EC2 User Guide for Linux * Instances.

*/ inline void SetClientToken(const char* value) { m_clientTokenHasBeenSet = true; m_clientToken.assign(value); } /** *

Unique, case-sensitive identifier that you provide to ensure the idempotency * of the request. For more information, see How * to Ensure Idempotency in the Amazon EC2 User Guide for Linux * Instances.

*/ inline RequestSpotInstancesRequest& WithClientToken(const Aws::String& value) { SetClientToken(value); return *this;} /** *

Unique, case-sensitive identifier that you provide to ensure the idempotency * of the request. For more information, see How * to Ensure Idempotency in the Amazon EC2 User Guide for Linux * Instances.

*/ inline RequestSpotInstancesRequest& WithClientToken(Aws::String&& value) { SetClientToken(std::move(value)); return *this;} /** *

Unique, case-sensitive identifier that you provide to ensure the idempotency * of the request. For more information, see How * to Ensure Idempotency in the Amazon EC2 User Guide for Linux * Instances.

*/ inline RequestSpotInstancesRequest& WithClientToken(const char* value) { SetClientToken(value); return *this;} /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline bool GetDryRun() const{ return m_dryRun; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline RequestSpotInstancesRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} /** *

The maximum number of Spot Instances to launch.

Default: 1

*/ inline int GetInstanceCount() const{ return m_instanceCount; } /** *

The maximum number of Spot Instances to launch.

Default: 1

*/ inline bool InstanceCountHasBeenSet() const { return m_instanceCountHasBeenSet; } /** *

The maximum number of Spot Instances to launch.

Default: 1

*/ inline void SetInstanceCount(int value) { m_instanceCountHasBeenSet = true; m_instanceCount = value; } /** *

The maximum number of Spot Instances to launch.

Default: 1

*/ inline RequestSpotInstancesRequest& WithInstanceCount(int value) { SetInstanceCount(value); return *this;} /** *

The instance launch group. Launch groups are Spot Instances that launch * together and terminate together.

Default: Instances are launched and * terminated individually

*/ inline const Aws::String& GetLaunchGroup() const{ return m_launchGroup; } /** *

The instance launch group. Launch groups are Spot Instances that launch * together and terminate together.

Default: Instances are launched and * terminated individually

*/ inline bool LaunchGroupHasBeenSet() const { return m_launchGroupHasBeenSet; } /** *

The instance launch group. Launch groups are Spot Instances that launch * together and terminate together.

Default: Instances are launched and * terminated individually

*/ inline void SetLaunchGroup(const Aws::String& value) { m_launchGroupHasBeenSet = true; m_launchGroup = value; } /** *

The instance launch group. Launch groups are Spot Instances that launch * together and terminate together.

Default: Instances are launched and * terminated individually

*/ inline void SetLaunchGroup(Aws::String&& value) { m_launchGroupHasBeenSet = true; m_launchGroup = std::move(value); } /** *

The instance launch group. Launch groups are Spot Instances that launch * together and terminate together.

Default: Instances are launched and * terminated individually

*/ inline void SetLaunchGroup(const char* value) { m_launchGroupHasBeenSet = true; m_launchGroup.assign(value); } /** *

The instance launch group. Launch groups are Spot Instances that launch * together and terminate together.

Default: Instances are launched and * terminated individually

*/ inline RequestSpotInstancesRequest& WithLaunchGroup(const Aws::String& value) { SetLaunchGroup(value); return *this;} /** *

The instance launch group. Launch groups are Spot Instances that launch * together and terminate together.

Default: Instances are launched and * terminated individually

*/ inline RequestSpotInstancesRequest& WithLaunchGroup(Aws::String&& value) { SetLaunchGroup(std::move(value)); return *this;} /** *

The instance launch group. Launch groups are Spot Instances that launch * together and terminate together.

Default: Instances are launched and * terminated individually

*/ inline RequestSpotInstancesRequest& WithLaunchGroup(const char* value) { SetLaunchGroup(value); return *this;} /** *

The launch specification.

*/ inline const RequestSpotLaunchSpecification& GetLaunchSpecification() const{ return m_launchSpecification; } /** *

The launch specification.

*/ inline bool LaunchSpecificationHasBeenSet() const { return m_launchSpecificationHasBeenSet; } /** *

The launch specification.

*/ inline void SetLaunchSpecification(const RequestSpotLaunchSpecification& value) { m_launchSpecificationHasBeenSet = true; m_launchSpecification = value; } /** *

The launch specification.

*/ inline void SetLaunchSpecification(RequestSpotLaunchSpecification&& value) { m_launchSpecificationHasBeenSet = true; m_launchSpecification = std::move(value); } /** *

The launch specification.

*/ inline RequestSpotInstancesRequest& WithLaunchSpecification(const RequestSpotLaunchSpecification& value) { SetLaunchSpecification(value); return *this;} /** *

The launch specification.

*/ inline RequestSpotInstancesRequest& WithLaunchSpecification(RequestSpotLaunchSpecification&& value) { SetLaunchSpecification(std::move(value)); return *this;} /** *

The maximum price per unit hour that you are willing to pay for a Spot * Instance. We do not recommend using this parameter because it can lead to * increased interruptions. If you do not specify this parameter, you will pay the * current Spot price.

If you specify a maximum price, your * instances will be interrupted more frequently than if you do not specify this * parameter.

*/ inline const Aws::String& GetSpotPrice() const{ return m_spotPrice; } /** *

The maximum price per unit hour that you are willing to pay for a Spot * Instance. We do not recommend using this parameter because it can lead to * increased interruptions. If you do not specify this parameter, you will pay the * current Spot price.

If you specify a maximum price, your * instances will be interrupted more frequently than if you do not specify this * parameter.

*/ inline bool SpotPriceHasBeenSet() const { return m_spotPriceHasBeenSet; } /** *

The maximum price per unit hour that you are willing to pay for a Spot * Instance. We do not recommend using this parameter because it can lead to * increased interruptions. If you do not specify this parameter, you will pay the * current Spot price.

If you specify a maximum price, your * instances will be interrupted more frequently than if you do not specify this * parameter.

*/ inline void SetSpotPrice(const Aws::String& value) { m_spotPriceHasBeenSet = true; m_spotPrice = value; } /** *

The maximum price per unit hour that you are willing to pay for a Spot * Instance. We do not recommend using this parameter because it can lead to * increased interruptions. If you do not specify this parameter, you will pay the * current Spot price.

If you specify a maximum price, your * instances will be interrupted more frequently than if you do not specify this * parameter.

*/ inline void SetSpotPrice(Aws::String&& value) { m_spotPriceHasBeenSet = true; m_spotPrice = std::move(value); } /** *

The maximum price per unit hour that you are willing to pay for a Spot * Instance. We do not recommend using this parameter because it can lead to * increased interruptions. If you do not specify this parameter, you will pay the * current Spot price.

If you specify a maximum price, your * instances will be interrupted more frequently than if you do not specify this * parameter.

*/ inline void SetSpotPrice(const char* value) { m_spotPriceHasBeenSet = true; m_spotPrice.assign(value); } /** *

The maximum price per unit hour that you are willing to pay for a Spot * Instance. We do not recommend using this parameter because it can lead to * increased interruptions. If you do not specify this parameter, you will pay the * current Spot price.

If you specify a maximum price, your * instances will be interrupted more frequently than if you do not specify this * parameter.

*/ inline RequestSpotInstancesRequest& WithSpotPrice(const Aws::String& value) { SetSpotPrice(value); return *this;} /** *

The maximum price per unit hour that you are willing to pay for a Spot * Instance. We do not recommend using this parameter because it can lead to * increased interruptions. If you do not specify this parameter, you will pay the * current Spot price.

If you specify a maximum price, your * instances will be interrupted more frequently than if you do not specify this * parameter.

*/ inline RequestSpotInstancesRequest& WithSpotPrice(Aws::String&& value) { SetSpotPrice(std::move(value)); return *this;} /** *

The maximum price per unit hour that you are willing to pay for a Spot * Instance. We do not recommend using this parameter because it can lead to * increased interruptions. If you do not specify this parameter, you will pay the * current Spot price.

If you specify a maximum price, your * instances will be interrupted more frequently than if you do not specify this * parameter.

*/ inline RequestSpotInstancesRequest& WithSpotPrice(const char* value) { SetSpotPrice(value); return *this;} /** *

The Spot Instance request type.

Default: one-time

*/ inline const SpotInstanceType& GetType() const{ return m_type; } /** *

The Spot Instance request type.

Default: one-time

*/ inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } /** *

The Spot Instance request type.

Default: one-time

*/ inline void SetType(const SpotInstanceType& value) { m_typeHasBeenSet = true; m_type = value; } /** *

The Spot Instance request type.

Default: one-time

*/ inline void SetType(SpotInstanceType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } /** *

The Spot Instance request type.

Default: one-time

*/ inline RequestSpotInstancesRequest& WithType(const SpotInstanceType& value) { SetType(value); return *this;} /** *

The Spot Instance request type.

Default: one-time

*/ inline RequestSpotInstancesRequest& WithType(SpotInstanceType&& value) { SetType(std::move(value)); return *this;} /** *

The start date of the request. If this is a one-time request, the request * becomes active at this date and time and remains active until all instances * launch, the request expires, or the request is canceled. If the request is * persistent, the request becomes active at this date and time and remains active * until it expires or is canceled.

The specified start date and time cannot * be equal to the current date and time. You must specify a start date and time * that occurs after the current date and time.

*/ inline const Aws::Utils::DateTime& GetValidFrom() const{ return m_validFrom; } /** *

The start date of the request. If this is a one-time request, the request * becomes active at this date and time and remains active until all instances * launch, the request expires, or the request is canceled. If the request is * persistent, the request becomes active at this date and time and remains active * until it expires or is canceled.

The specified start date and time cannot * be equal to the current date and time. You must specify a start date and time * that occurs after the current date and time.

*/ inline bool ValidFromHasBeenSet() const { return m_validFromHasBeenSet; } /** *

The start date of the request. If this is a one-time request, the request * becomes active at this date and time and remains active until all instances * launch, the request expires, or the request is canceled. If the request is * persistent, the request becomes active at this date and time and remains active * until it expires or is canceled.

The specified start date and time cannot * be equal to the current date and time. You must specify a start date and time * that occurs after the current date and time.

*/ inline void SetValidFrom(const Aws::Utils::DateTime& value) { m_validFromHasBeenSet = true; m_validFrom = value; } /** *

The start date of the request. If this is a one-time request, the request * becomes active at this date and time and remains active until all instances * launch, the request expires, or the request is canceled. If the request is * persistent, the request becomes active at this date and time and remains active * until it expires or is canceled.

The specified start date and time cannot * be equal to the current date and time. You must specify a start date and time * that occurs after the current date and time.

*/ inline void SetValidFrom(Aws::Utils::DateTime&& value) { m_validFromHasBeenSet = true; m_validFrom = std::move(value); } /** *

The start date of the request. If this is a one-time request, the request * becomes active at this date and time and remains active until all instances * launch, the request expires, or the request is canceled. If the request is * persistent, the request becomes active at this date and time and remains active * until it expires or is canceled.

The specified start date and time cannot * be equal to the current date and time. You must specify a start date and time * that occurs after the current date and time.

*/ inline RequestSpotInstancesRequest& WithValidFrom(const Aws::Utils::DateTime& value) { SetValidFrom(value); return *this;} /** *

The start date of the request. If this is a one-time request, the request * becomes active at this date and time and remains active until all instances * launch, the request expires, or the request is canceled. If the request is * persistent, the request becomes active at this date and time and remains active * until it expires or is canceled.

The specified start date and time cannot * be equal to the current date and time. You must specify a start date and time * that occurs after the current date and time.

*/ inline RequestSpotInstancesRequest& WithValidFrom(Aws::Utils::DateTime&& value) { SetValidFrom(std::move(value)); return *this;} /** *

The end date of the request, in UTC format * (YYYY-MM-DDTHH:MM:SSZ).

  • *

    For a persistent request, the request remains active until the * ValidUntil date and time is reached. Otherwise, the request remains * active until you cancel it.

  • For a one-time request, the * request remains active until all instances launch, the request is canceled, or * the ValidUntil date and time is reached. By default, the request is * valid for 7 days from the date the request was created.

*/ inline const Aws::Utils::DateTime& GetValidUntil() const{ return m_validUntil; } /** *

The end date of the request, in UTC format * (YYYY-MM-DDTHH:MM:SSZ).

  • *

    For a persistent request, the request remains active until the * ValidUntil date and time is reached. Otherwise, the request remains * active until you cancel it.

  • For a one-time request, the * request remains active until all instances launch, the request is canceled, or * the ValidUntil date and time is reached. By default, the request is * valid for 7 days from the date the request was created.

*/ inline bool ValidUntilHasBeenSet() const { return m_validUntilHasBeenSet; } /** *

The end date of the request, in UTC format * (YYYY-MM-DDTHH:MM:SSZ).

  • *

    For a persistent request, the request remains active until the * ValidUntil date and time is reached. Otherwise, the request remains * active until you cancel it.

  • For a one-time request, the * request remains active until all instances launch, the request is canceled, or * the ValidUntil date and time is reached. By default, the request is * valid for 7 days from the date the request was created.

*/ inline void SetValidUntil(const Aws::Utils::DateTime& value) { m_validUntilHasBeenSet = true; m_validUntil = value; } /** *

The end date of the request, in UTC format * (YYYY-MM-DDTHH:MM:SSZ).

  • *

    For a persistent request, the request remains active until the * ValidUntil date and time is reached. Otherwise, the request remains * active until you cancel it.

  • For a one-time request, the * request remains active until all instances launch, the request is canceled, or * the ValidUntil date and time is reached. By default, the request is * valid for 7 days from the date the request was created.

*/ inline void SetValidUntil(Aws::Utils::DateTime&& value) { m_validUntilHasBeenSet = true; m_validUntil = std::move(value); } /** *

The end date of the request, in UTC format * (YYYY-MM-DDTHH:MM:SSZ).

  • *

    For a persistent request, the request remains active until the * ValidUntil date and time is reached. Otherwise, the request remains * active until you cancel it.

  • For a one-time request, the * request remains active until all instances launch, the request is canceled, or * the ValidUntil date and time is reached. By default, the request is * valid for 7 days from the date the request was created.

*/ inline RequestSpotInstancesRequest& WithValidUntil(const Aws::Utils::DateTime& value) { SetValidUntil(value); return *this;} /** *

The end date of the request, in UTC format * (YYYY-MM-DDTHH:MM:SSZ).

  • *

    For a persistent request, the request remains active until the * ValidUntil date and time is reached. Otherwise, the request remains * active until you cancel it.

  • For a one-time request, the * request remains active until all instances launch, the request is canceled, or * the ValidUntil date and time is reached. By default, the request is * valid for 7 days from the date the request was created.

*/ inline RequestSpotInstancesRequest& WithValidUntil(Aws::Utils::DateTime&& value) { SetValidUntil(std::move(value)); return *this;} /** *

The key-value pair for tagging the Spot Instance request on creation. The * value for ResourceType must be spot-instances-request, * otherwise the Spot Instance request fails. To tag the Spot Instance request * after it has been created, see CreateTags. *

*/ inline const Aws::Vector& GetTagSpecifications() const{ return m_tagSpecifications; } /** *

The key-value pair for tagging the Spot Instance request on creation. The * value for ResourceType must be spot-instances-request, * otherwise the Spot Instance request fails. To tag the Spot Instance request * after it has been created, see CreateTags. *

*/ inline bool TagSpecificationsHasBeenSet() const { return m_tagSpecificationsHasBeenSet; } /** *

The key-value pair for tagging the Spot Instance request on creation. The * value for ResourceType must be spot-instances-request, * otherwise the Spot Instance request fails. To tag the Spot Instance request * after it has been created, see CreateTags. *

*/ inline void SetTagSpecifications(const Aws::Vector& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications = value; } /** *

The key-value pair for tagging the Spot Instance request on creation. The * value for ResourceType must be spot-instances-request, * otherwise the Spot Instance request fails. To tag the Spot Instance request * after it has been created, see CreateTags. *

*/ inline void SetTagSpecifications(Aws::Vector&& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications = std::move(value); } /** *

The key-value pair for tagging the Spot Instance request on creation. The * value for ResourceType must be spot-instances-request, * otherwise the Spot Instance request fails. To tag the Spot Instance request * after it has been created, see CreateTags. *

*/ inline RequestSpotInstancesRequest& WithTagSpecifications(const Aws::Vector& value) { SetTagSpecifications(value); return *this;} /** *

The key-value pair for tagging the Spot Instance request on creation. The * value for ResourceType must be spot-instances-request, * otherwise the Spot Instance request fails. To tag the Spot Instance request * after it has been created, see CreateTags. *

*/ inline RequestSpotInstancesRequest& WithTagSpecifications(Aws::Vector&& value) { SetTagSpecifications(std::move(value)); return *this;} /** *

The key-value pair for tagging the Spot Instance request on creation. The * value for ResourceType must be spot-instances-request, * otherwise the Spot Instance request fails. To tag the Spot Instance request * after it has been created, see CreateTags. *

*/ inline RequestSpotInstancesRequest& AddTagSpecifications(const TagSpecification& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications.push_back(value); return *this; } /** *

The key-value pair for tagging the Spot Instance request on creation. The * value for ResourceType must be spot-instances-request, * otherwise the Spot Instance request fails. To tag the Spot Instance request * after it has been created, see CreateTags. *

*/ inline RequestSpotInstancesRequest& AddTagSpecifications(TagSpecification&& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications.push_back(std::move(value)); return *this; } /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline const InstanceInterruptionBehavior& GetInstanceInterruptionBehavior() const{ return m_instanceInterruptionBehavior; } /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline bool InstanceInterruptionBehaviorHasBeenSet() const { return m_instanceInterruptionBehaviorHasBeenSet; } /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline void SetInstanceInterruptionBehavior(const InstanceInterruptionBehavior& value) { m_instanceInterruptionBehaviorHasBeenSet = true; m_instanceInterruptionBehavior = value; } /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline void SetInstanceInterruptionBehavior(InstanceInterruptionBehavior&& value) { m_instanceInterruptionBehaviorHasBeenSet = true; m_instanceInterruptionBehavior = std::move(value); } /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline RequestSpotInstancesRequest& WithInstanceInterruptionBehavior(const InstanceInterruptionBehavior& value) { SetInstanceInterruptionBehavior(value); return *this;} /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline RequestSpotInstancesRequest& WithInstanceInterruptionBehavior(InstanceInterruptionBehavior&& value) { SetInstanceInterruptionBehavior(std::move(value)); return *this;} private: Aws::String m_availabilityZoneGroup; bool m_availabilityZoneGroupHasBeenSet = false; int m_blockDurationMinutes; bool m_blockDurationMinutesHasBeenSet = false; Aws::String m_clientToken; bool m_clientTokenHasBeenSet = false; bool m_dryRun; bool m_dryRunHasBeenSet = false; int m_instanceCount; bool m_instanceCountHasBeenSet = false; Aws::String m_launchGroup; bool m_launchGroupHasBeenSet = false; RequestSpotLaunchSpecification m_launchSpecification; bool m_launchSpecificationHasBeenSet = false; Aws::String m_spotPrice; bool m_spotPriceHasBeenSet = false; SpotInstanceType m_type; bool m_typeHasBeenSet = false; Aws::Utils::DateTime m_validFrom; bool m_validFromHasBeenSet = false; Aws::Utils::DateTime m_validUntil; bool m_validUntilHasBeenSet = false; Aws::Vector m_tagSpecifications; bool m_tagSpecificationsHasBeenSet = false; InstanceInterruptionBehavior m_instanceInterruptionBehavior; bool m_instanceInterruptionBehaviorHasBeenSet = false; }; } // namespace Model } // namespace EC2 } // namespace Aws