Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 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.
  */
 package com.amazonaws.services.ec2.model;
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 conceptual information about Spot Instances, refer to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

 
 public class RequestSpotInstancesRequest extends AmazonWebServiceRequest {

    
Specifies the maximum hourly price for any Spot Instance launched to fulfill the request.
 
     private String spotPrice;

    
Specifies the maximum number of Spot Instances to launch.
 
     private Integer instanceCount;

    
Specifies the Spot Instance type.

Constraints:
Allowed Values: one-time, persistent

 
     private String type;

    
Defines 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.

 
     private java.util.Date validFrom;

    
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.

 
     private java.util.Date validUntil;

    
Specifies the instance launch group. Launch groups are Spot Instances that launch and terminate together.
 
     private String launchGroup;

    
Specifies the Availability Zone group.

When specifying the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.

 
     private String availabilityZoneGroup;

    
Specifies additional launch instance information.
 
     private LaunchSpecification launchSpecification;

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

Parameters:
spotPrice Specifies the maximum hourly price for any Spot Instance launched to fulfill the request.
    public RequestSpotInstancesRequest(String spotPrice) {
        this. = spotPrice;
    }
    
    
Specifies the maximum hourly price for any Spot Instance launched to fulfill the request.

Returns:
Specifies the maximum hourly price for any Spot Instance launched to fulfill the request.
    public String getSpotPrice() {
        return ;
    }
    
    
Specifies the maximum hourly price for any Spot Instance launched to fulfill the request.

Parameters:
spotPrice Specifies the maximum hourly price for any Spot Instance launched to fulfill the request.
    public void setSpotPrice(String spotPrice) {
        this. = spotPrice;
    }
    
    
Specifies 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 Specifies 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.
    public RequestSpotInstancesRequest withSpotPrice(String spotPrice) {
        this. = spotPrice;
        return this;
    }
    
    
    
Specifies the maximum number of Spot Instances to launch.

Returns:
Specifies the maximum number of Spot Instances to launch.
    public Integer getInstanceCount() {
        return ;
    }
    
    
Specifies the maximum number of Spot Instances to launch.

Parameters:
instanceCount Specifies the maximum number of Spot Instances to launch.
    public void setInstanceCount(Integer instanceCount) {
        this. = instanceCount;
    }
    
    
Specifies the maximum number of Spot Instances to launch.

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

Parameters:
instanceCount Specifies the maximum number of Spot Instances to launch.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RequestSpotInstancesRequest withInstanceCount(Integer instanceCount) {
        this. = instanceCount;
        return this;
    }
    
    
    
Specifies the Spot Instance type.

Constraints:
Allowed Values: one-time, persistent

Returns:
Specifies the Spot Instance type.
See also:
SpotInstanceType
    public String getType() {
        return ;
    }
    
    
Specifies the Spot Instance type.

Constraints:
Allowed Values: one-time, persistent

Parameters:
type Specifies the Spot Instance type.
See also:
SpotInstanceType
    public void setType(String type) {
        this. = type;
    }
    
    
Specifies the Spot Instance type.

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

Constraints:
Allowed Values: one-time, persistent

Parameters:
type Specifies the Spot Instance type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SpotInstanceType
        this. = type;
        return this;
    }
    
    
    
Defines 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.

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

    public java.util.Date getValidFrom() {
        return ;
    }
    
    
Defines 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.

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

    public void setValidFrom(java.util.Date validFrom) {
        this. = validFrom;
    }
    
    
Defines 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.

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

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

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = validFrom;
        return this;
    }
    
    
    
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.

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

    public java.util.Date getValidUntil() {
        return ;
    }
    
    
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.

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

    public void setValidUntil(java.util.Date validUntil) {
        this. = validUntil;
    }
    
    
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.

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

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

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = validUntil;
        return this;
    }
    
    
    
Specifies the instance launch group. Launch groups are Spot Instances that launch and terminate together.

Returns:
Specifies the instance launch group. Launch groups are Spot Instances that launch and terminate together.
    public String getLaunchGroup() {
        return ;
    }
    
    
Specifies the instance launch group. Launch groups are Spot Instances that launch and terminate together.

Parameters:
launchGroup Specifies the instance launch group. Launch groups are Spot Instances that launch and terminate together.
    public void setLaunchGroup(String launchGroup) {
        this. = launchGroup;
    }
    
    
Specifies the instance launch group. Launch groups are Spot Instances that launch and terminate together.

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

Parameters:
launchGroup Specifies the instance launch group. Launch groups are Spot Instances that launch and terminate together.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RequestSpotInstancesRequest withLaunchGroup(String launchGroup) {
        this. = launchGroup;
        return this;
    }
    
    
    
Specifies the Availability Zone group.

When specifying the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.

Returns:
Specifies the Availability Zone group.

When specifying the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.

    public String getAvailabilityZoneGroup() {
        return ;
    }
    
    
Specifies the Availability Zone group.

When specifying the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.

Parameters:
availabilityZoneGroup Specifies the Availability Zone group.

When specifying the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.

    public void setAvailabilityZoneGroup(String availabilityZoneGroup) {
        this. = availabilityZoneGroup;
    }
    
    
Specifies the Availability Zone group.

When specifying the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.

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

Parameters:
availabilityZoneGroup Specifies the Availability Zone group.

When specifying the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.

Returns:
A reference to this updated object so that method calls can be chained together.
    public RequestSpotInstancesRequest withAvailabilityZoneGroup(String availabilityZoneGroup) {
        this. = availabilityZoneGroup;
        return this;
    }
    
    
    
Specifies additional launch instance information.

Returns:
Specifies additional launch instance information.
        return ;
    }
    
    
Specifies additional launch instance information.

Parameters:
launchSpecification Specifies additional launch instance information.
    public void setLaunchSpecification(LaunchSpecification launchSpecification) {
        this. = launchSpecification;
    }
    
    
Specifies additional launch instance information.

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

Parameters:
launchSpecification Specifies additional launch instance information.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = launchSpecification;
        return this;
    }
    
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("SpotPrice: " +  + ", ");
        sb.append("InstanceCount: " +  + ", ");
        sb.append("Type: " +  + ", ");
        sb.append("ValidFrom: " +  + ", ");
        sb.append("ValidUntil: " +  + ", ");
        sb.append("LaunchGroup: " +  + ", ");
        sb.append("AvailabilityZoneGroup: " +  + ", ");
        sb.append("LaunchSpecification: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X