com.amazonaws.services.ec2.model
Class RequestSpotInstancesRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.ec2.model.RequestSpotInstancesRequest
All Implemented Interfaces:
DryRunSupportedRequest<RequestSpotInstancesRequest>, java.io.Serializable

public class RequestSpotInstancesRequest
extends AmazonWebServiceRequest
implements java.io.Serializable, DryRunSupportedRequest<RequestSpotInstancesRequest>

Container for the parameters to the RequestSpotInstances operation.

Creates a Spot Instance request. Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current Spot Instance requests. For more information about Spot Instances, see Spot Instances in the Amazon Elastic Compute Cloud User Guide .

See Also:
AmazonEC2.requestSpotInstances(RequestSpotInstancesRequest), Serialized Form

Constructor Summary
RequestSpotInstancesRequest()
          Default constructor for a new RequestSpotInstancesRequest object.
RequestSpotInstancesRequest(java.lang.String spotPrice)
          Constructs a new RequestSpotInstancesRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAvailabilityZoneGroup()
          The user-specified name for a logical grouping of bids.
 Request<RequestSpotInstancesRequest> getDryRunRequest()
          This method is intended for internal use only.
 java.lang.Integer getInstanceCount()
          The maximum number of Spot Instances to launch.
 java.lang.String getLaunchGroup()
          The instance launch group.
 LaunchSpecification getLaunchSpecification()
          The launch specification.
 java.lang.String getSpotPrice()
          The maximum hourly price for any Spot Instance launched to fulfill the request.
 java.lang.String getType()
          The Spot Instance request type.
 java.util.Date getValidFrom()
          The start date of the request.
 java.util.Date getValidUntil()
          The end date of the request.
 int hashCode()
           
 void setAvailabilityZoneGroup(java.lang.String availabilityZoneGroup)
          The user-specified name for a logical grouping of bids.
 void setInstanceCount(java.lang.Integer instanceCount)
          The maximum number of Spot Instances to launch.
 void setLaunchGroup(java.lang.String launchGroup)
          The instance launch group.
 void setLaunchSpecification(LaunchSpecification launchSpecification)
          The launch specification.
 void setSpotPrice(java.lang.String spotPrice)
          The maximum hourly price for any Spot Instance launched to fulfill the request.
 void setType(SpotInstanceType type)
          The Spot Instance request type.
 void setType(java.lang.String type)
          The Spot Instance request type.
 void setValidFrom(java.util.Date validFrom)
          The start date of the request.
 void setValidUntil(java.util.Date validUntil)
          The end date of the request.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 RequestSpotInstancesRequest withAvailabilityZoneGroup(java.lang.String availabilityZoneGroup)
          The user-specified name for a logical grouping of bids.
 RequestSpotInstancesRequest withInstanceCount(java.lang.Integer instanceCount)
          The maximum number of Spot Instances to launch.
 RequestSpotInstancesRequest withLaunchGroup(java.lang.String launchGroup)
          The instance launch group.
 RequestSpotInstancesRequest withLaunchSpecification(LaunchSpecification launchSpecification)
          The launch specification.
 RequestSpotInstancesRequest withSpotPrice(java.lang.String spotPrice)
          The maximum hourly price for any Spot Instance launched to fulfill the request.
 RequestSpotInstancesRequest withType(SpotInstanceType type)
          The Spot Instance request type.
 RequestSpotInstancesRequest withType(java.lang.String type)
          The Spot Instance request type.
 RequestSpotInstancesRequest withValidFrom(java.util.Date validFrom)
          The start date of the request.
 RequestSpotInstancesRequest withValidUntil(java.util.Date validUntil)
          The end date of the request.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequestSpotInstancesRequest

public RequestSpotInstancesRequest()
Default constructor for a new RequestSpotInstancesRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.


RequestSpotInstancesRequest

public RequestSpotInstancesRequest(java.lang.String spotPrice)
Constructs a new RequestSpotInstancesRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
spotPrice - The maximum hourly price for any Spot Instance launched to fulfill the request.
Method Detail

getSpotPrice

public java.lang.String getSpotPrice()
The maximum hourly price for any Spot Instance launched to fulfill the request.

Returns:
The maximum hourly price for any Spot Instance launched to fulfill the request.

setSpotPrice

public void setSpotPrice(java.lang.String spotPrice)
The maximum hourly price for any Spot Instance launched to fulfill the request.

Parameters:
spotPrice - The maximum hourly price for any Spot Instance launched to fulfill the request.

withSpotPrice

public RequestSpotInstancesRequest withSpotPrice(java.lang.String spotPrice)
The maximum hourly price for any Spot Instance launched to fulfill the request.

Returns a reference to this object so that method calls can be chained together.

Parameters:
spotPrice - The maximum hourly price for any Spot Instance launched to fulfill the request.
Returns:
A reference to this updated object so that method calls can be chained together.

getInstanceCount

public java.lang.Integer getInstanceCount()
The maximum number of Spot Instances to launch.

Default: 1

Returns:
The maximum number of Spot Instances to launch.

Default: 1


setInstanceCount

public void setInstanceCount(java.lang.Integer instanceCount)
The maximum number of Spot Instances to launch.

Default: 1

Parameters:
instanceCount - The maximum number of Spot Instances to launch.

Default: 1


withInstanceCount

public RequestSpotInstancesRequest withInstanceCount(java.lang.Integer instanceCount)
The maximum number of Spot Instances to launch.

Default: 1

Returns a reference to this object so that method calls can be chained together.

Parameters:
instanceCount - The maximum number of Spot Instances to launch.

Default: 1

Returns:
A reference to this updated object so that method calls can be chained together.

getType

public java.lang.String getType()
The Spot Instance request type.

Default: one-time

Constraints:
Allowed Values: one-time, persistent

Returns:
The Spot Instance request type.

Default: one-time

See Also:
SpotInstanceType

setType

public void setType(java.lang.String type)
The Spot Instance request type.

Default: one-time

Constraints:
Allowed Values: one-time, persistent

Parameters:
type - The Spot Instance request type.

Default: one-time

See Also:
SpotInstanceType

withType

public RequestSpotInstancesRequest withType(java.lang.String type)
The Spot Instance request type.

Default: one-time

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: one-time, persistent

Parameters:
type - The Spot Instance request type.

Default: one-time

Returns:
A reference to this updated object so that method calls can be chained together.
See Also:
SpotInstanceType

setType

public void setType(SpotInstanceType type)
The Spot Instance request type.

Default: one-time

Constraints:
Allowed Values: one-time, persistent

Parameters:
type - The Spot Instance request type.

Default: one-time

See Also:
SpotInstanceType

withType

public RequestSpotInstancesRequest withType(SpotInstanceType type)
The Spot Instance request type.

Default: one-time

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: one-time, persistent

Parameters:
type - The Spot Instance request type.

Default: one-time

Returns:
A reference to this updated object so that method calls can be chained together.
See Also:
SpotInstanceType

getValidFrom

public java.util.Date getValidFrom()
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.

Default: The request is effective indefinitely.

Returns:
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.

Default: The request is effective indefinitely.


setValidFrom

public void setValidFrom(java.util.Date 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.

Default: The request is effective indefinitely.

Parameters:
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.

Default: The request is effective indefinitely.


withValidFrom

public RequestSpotInstancesRequest withValidFrom(java.util.Date 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.

Default: The request is effective indefinitely.

Returns a reference to this object so that method calls can be chained together.

Parameters:
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.

Default: The request is effective indefinitely.

Returns:
A reference to this updated object so that method calls can be chained together.

getValidUntil

public java.util.Date getValidUntil()
The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.

Default: The request is effective indefinitely.

Returns:
The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.

Default: The request is effective indefinitely.


setValidUntil

public void setValidUntil(java.util.Date validUntil)
The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.

Default: The request is effective indefinitely.

Parameters:
validUntil - The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.

Default: The request is effective indefinitely.


withValidUntil

public RequestSpotInstancesRequest withValidUntil(java.util.Date validUntil)
The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.

Default: The request is effective indefinitely.

Returns a reference to this object so that method calls can be chained together.

Parameters:
validUntil - The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.

Default: The request is effective indefinitely.

Returns:
A reference to this updated object so that method calls can be chained together.

getLaunchGroup

public java.lang.String getLaunchGroup()
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.

Default: Instances are launched and terminated individually

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

Default: Instances are launched and terminated individually


setLaunchGroup

public void setLaunchGroup(java.lang.String launchGroup)
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.

Default: Instances are launched and terminated individually

Parameters:
launchGroup - The instance launch group. Launch groups are Spot Instances that launch together and terminate together.

Default: Instances are launched and terminated individually


withLaunchGroup

public RequestSpotInstancesRequest withLaunchGroup(java.lang.String launchGroup)
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.

Default: Instances are launched and terminated individually

Returns a reference to this object so that method calls can be chained together.

Parameters:
launchGroup - The instance launch group. Launch groups are Spot Instances that launch together and terminate together.

Default: Instances are launched and terminated individually

Returns:
A reference to this updated object so that method calls can be chained together.

getAvailabilityZoneGroup

public java.lang.String getAvailabilityZoneGroup()
The user-specified name for a logical grouping of bids.

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 bids 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 bid is expired, or the bid falls below current market), 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.

Returns:
The user-specified name for a logical grouping of bids.

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 bids 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 bid is expired, or the bid falls below current market), 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.


setAvailabilityZoneGroup

public void setAvailabilityZoneGroup(java.lang.String availabilityZoneGroup)
The user-specified name for a logical grouping of bids.

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 bids 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 bid is expired, or the bid falls below current market), 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.

Parameters:
availabilityZoneGroup - The user-specified name for a logical grouping of bids.

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 bids 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 bid is expired, or the bid falls below current market), 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.


withAvailabilityZoneGroup

public RequestSpotInstancesRequest withAvailabilityZoneGroup(java.lang.String availabilityZoneGroup)
The user-specified name for a logical grouping of bids.

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 bids 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 bid is expired, or the bid falls below current market), 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.

Returns a reference to this object so that method calls can be chained together.

Parameters:
availabilityZoneGroup - The user-specified name for a logical grouping of bids.

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 bids 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 bid is expired, or the bid falls below current market), 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.

Returns:
A reference to this updated object so that method calls can be chained together.

getLaunchSpecification

public LaunchSpecification getLaunchSpecification()
The launch specification.

Returns:
The launch specification.

setLaunchSpecification

public void setLaunchSpecification(LaunchSpecification launchSpecification)
The launch specification.

Parameters:
launchSpecification - The launch specification.

withLaunchSpecification

public RequestSpotInstancesRequest withLaunchSpecification(LaunchSpecification launchSpecification)
The launch specification.

Returns a reference to this object so that method calls can be chained together.

Parameters:
launchSpecification - The launch specification.
Returns:
A reference to this updated object so that method calls can be chained together.

getDryRunRequest

public Request<RequestSpotInstancesRequest> getDryRunRequest()
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.

Specified by:
getDryRunRequest in interface DryRunSupportedRequest<RequestSpotInstancesRequest>

toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.