Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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 DescribeSpotPriceHistory operation.

Describes the Spot Price history. The prices returned are listed in chronological order, from the oldest to the most recent, for up to the past 90 days. For more information, see Spot Instance Pricing History in the Amazon Elastic Compute Cloud User Guide for Linux .

When you specify a start and end time, this operation returns the prices of the instance types within the time range that you specified and the time when the price changed. The price is valid within the time period that you specified; the response merely indicates the last time that the price changed.

 
The date and time, up to the past 90 days, from which to start retrieving the price history data.
 
     private java.util.Date startTime;

    
The date and time, up to the current date, from which to stop retrieving the price history data.
 
     private java.util.Date endTime;

    
Filters the results by the specified instance types.
 
Filters the results by the specified basic product descriptions.
 
One or more filters.
  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m1.small).

  • product-description - The product description for the Spot Price (Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)).

  • spot-price - The Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

 
Filters the results by the specified Availability Zone.
 
     private String availabilityZone;

    
The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 results are returned.
 
     private Integer maxResults;

    
The token to retrieve the next page of results.
    private String nextToken;

    
The date and time, up to the past 90 days, from which to start retrieving the price history data.

Returns:
The date and time, up to the past 90 days, from which to start retrieving the price history data.
    public java.util.Date getStartTime() {
        return ;
    }
    
    
The date and time, up to the past 90 days, from which to start retrieving the price history data.

Parameters:
startTime The date and time, up to the past 90 days, from which to start retrieving the price history data.
    public void setStartTime(java.util.Date startTime) {
        this. = startTime;
    }
    
    
The date and time, up to the past 90 days, from which to start retrieving the price history data.

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

Parameters:
startTime The date and time, up to the past 90 days, from which to start retrieving the price history data.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = startTime;
        return this;
    }

    
The date and time, up to the current date, from which to stop retrieving the price history data.

Returns:
The date and time, up to the current date, from which to stop retrieving the price history data.
    public java.util.Date getEndTime() {
        return ;
    }
    
    
The date and time, up to the current date, from which to stop retrieving the price history data.

Parameters:
endTime The date and time, up to the current date, from which to stop retrieving the price history data.
    public void setEndTime(java.util.Date endTime) {
        this. = endTime;
    }
    
    
The date and time, up to the current date, from which to stop retrieving the price history data.

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

Parameters:
endTime The date and time, up to the current date, from which to stop retrieving the price history data.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = endTime;
        return this;
    }

    
Filters the results by the specified instance types.

Returns:
Filters the results by the specified instance types.
    public java.util.List<StringgetInstanceTypes() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Filters the results by the specified instance types.

Parameters:
instanceTypes Filters the results by the specified instance types.
    public void setInstanceTypes(java.util.Collection<StringinstanceTypes) {
        if (instanceTypes == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringinstanceTypesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(instanceTypes.size());
        instanceTypesCopy.addAll(instanceTypes);
        this. = instanceTypesCopy;
    }
    
    
Filters the results by the specified instance types.

NOTE: This method appends the values to the existing list (if any). Use setInstanceTypes(java.util.Collection) or withInstanceTypes(java.util.Collection) if you want to override the existing values.

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

Parameters:
instanceTypes Filters the results by the specified instance types.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeSpotPriceHistoryRequest withInstanceTypes(String... instanceTypes) {
        if (getInstanceTypes() == nullsetInstanceTypes(new java.util.ArrayList<String>(instanceTypes.length));
        for (String value : instanceTypes) {
            getInstanceTypes().add(value);
        }
        return this;
    }
    
    
Filters the results by the specified instance types.

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

Parameters:
instanceTypes Filters the results by the specified instance types.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (instanceTypes == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringinstanceTypesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(instanceTypes.size());
            instanceTypesCopy.addAll(instanceTypes);
            this. = instanceTypesCopy;
        }
        return this;
    }

    
Filters the results by the specified instance types.

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

Parameters:
instanceTypes Filters the results by the specified instance types.
Returns:
A reference to this updated object so that method calls can be chained together.
        java.util.ArrayList<StringinstanceTypesCopy = new java.util.ArrayList<String>(instanceTypes.length);
        for (InstanceType member : instanceTypes) {
            instanceTypesCopy.add(member.toString());
        }
        if (getInstanceTypes() == null) {
            setInstanceTypes(instanceTypesCopy);
        } else {
            getInstanceTypes().addAll(instanceTypesCopy);
        }
        return this;
    }

    
Filters the results by the specified basic product descriptions.

Returns:
Filters the results by the specified basic product descriptions.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Filters the results by the specified basic product descriptions.

Parameters:
productDescriptions Filters the results by the specified basic product descriptions.
    public void setProductDescriptions(java.util.Collection<StringproductDescriptions) {
        if (productDescriptions == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringproductDescriptionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(productDescriptions.size());
        productDescriptionsCopy.addAll(productDescriptions);
        this. = productDescriptionsCopy;
    }
    
    
Filters the results by the specified basic product descriptions.

NOTE: This method appends the values to the existing list (if any). Use setProductDescriptions(java.util.Collection) or withProductDescriptions(java.util.Collection) if you want to override the existing values.

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

Parameters:
productDescriptions Filters the results by the specified basic product descriptions.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeSpotPriceHistoryRequest withProductDescriptions(String... productDescriptions) {
        if (getProductDescriptions() == nullsetProductDescriptions(new java.util.ArrayList<String>(productDescriptions.length));
        for (String value : productDescriptions) {
            getProductDescriptions().add(value);
        }
        return this;
    }
    
    
Filters the results by the specified basic product descriptions.

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

Parameters:
productDescriptions Filters the results by the specified basic product descriptions.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (productDescriptions == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringproductDescriptionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(productDescriptions.size());
            productDescriptionsCopy.addAll(productDescriptions);
            this. = productDescriptionsCopy;
        }
        return this;
    }

    
One or more filters.
  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m1.small).

  • product-description - The product description for the Spot Price (Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)).

  • spot-price - The Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

Returns:
One or more filters.
  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m1.small).

  • product-description - The product description for the Spot Price (Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)).

  • spot-price - The Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

    public java.util.List<FiltergetFilters() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Filter>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more filters.
  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m1.small).

  • product-description - The product description for the Spot Price (Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)).

  • spot-price - The Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

Parameters:
filters One or more filters.
  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m1.small).

  • product-description - The product description for the Spot Price (Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)).

  • spot-price - The Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

    public void setFilters(java.util.Collection<Filterfilters) {
        if (filters == null) {
            this. = null;
            return;
        }
        filtersCopy.addAll(filters);
        this. = filtersCopy;
    }
    
    
One or more filters.
  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m1.small).

  • product-description - The product description for the Spot Price (Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)).

  • spot-price - The Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

NOTE: This method appends the values to the existing list (if any). Use setFilters(java.util.Collection) or withFilters(java.util.Collection) if you want to override the existing values.

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

Parameters:
filters One or more filters.
  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m1.small).

  • product-description - The product description for the Spot Price (Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)).

  • spot-price - The Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeSpotPriceHistoryRequest withFilters(Filter... filters) {
        if (getFilters() == nullsetFilters(new java.util.ArrayList<Filter>(filters.length));
        for (Filter value : filters) {
            getFilters().add(value);
        }
        return this;
    }
    
    
One or more filters.
  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m1.small).

  • product-description - The product description for the Spot Price (Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)).

  • spot-price - The Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

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

Parameters:
filters One or more filters.
  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m1.small).

  • product-description - The product description for the Spot Price (Linux/UNIX | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)).

  • spot-price - The Spot Price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported).

  • timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

Returns:
A reference to this updated object so that method calls can be chained together.
        if (filters == null) {
            this. = null;
        } else {
            filtersCopy.addAll(filters);
            this. = filtersCopy;
        }
        return this;
    }

    
Filters the results by the specified Availability Zone.

Returns:
Filters the results by the specified Availability Zone.
    public String getAvailabilityZone() {
        return ;
    }
    
    
Filters the results by the specified Availability Zone.

Parameters:
availabilityZone Filters the results by the specified Availability Zone.
    public void setAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
    }
    
    
Filters the results by the specified Availability Zone.

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

Parameters:
availabilityZone Filters the results by the specified Availability Zone.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeSpotPriceHistoryRequest withAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
        return this;
    }

    
The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 results are returned.

Returns:
The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 results are returned.
    public Integer getMaxResults() {
        return ;
    }
    
    
The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 results are returned.

Parameters:
maxResults The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 results are returned.
    public void setMaxResults(Integer maxResults) {
        this. = maxResults;
    }
    
    
The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 results are returned.

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

Parameters:
maxResults The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned NextToken value. This value can be between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 results are returned.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = maxResults;
        return this;
    }

    
The token to retrieve the next page of results.

Returns:
The token to retrieve the next page of results.
    public String getNextToken() {
        return ;
    }
    
    
The token to retrieve the next page of results.

Parameters:
nextToken The token to retrieve the next page of results.
    public void setNextToken(String nextToken) {
        this. = nextToken;
    }
    
    
The token to retrieve the next page of results.

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

Parameters:
nextToken The token to retrieve the next page of results.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = nextToken;
        return this;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
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("{");
        if (getStartTime() != nullsb.append("StartTime: " + getStartTime() + ",");
        if (getEndTime() != nullsb.append("EndTime: " + getEndTime() + ",");
        if (getInstanceTypes() != nullsb.append("InstanceTypes: " + getInstanceTypes() + ",");
        if (getProductDescriptions() != nullsb.append("ProductDescriptions: " + getProductDescriptions() + ",");
        if (getFilters() != nullsb.append("Filters: " + getFilters() + ",");
        if (getAvailabilityZone() != nullsb.append("AvailabilityZone: " + getAvailabilityZone() + ",");
        if (getMaxResults() != nullsb.append("MaxResults: " + getMaxResults() + ",");
        if (getNextToken() != nullsb.append("NextToken: " + getNextToken() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); 
        hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceTypes() == null) ? 0 : getInstanceTypes().hashCode()); 
        hashCode = prime * hashCode + ((getProductDescriptions() == null) ? 0 : getProductDescriptions().hashCode()); 
        hashCode = prime * hashCode + ((getFilters() == null) ? 0 : getFilters().hashCode()); 
        hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); 
        hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); 
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DescribeSpotPriceHistoryRequest == falsereturn false;
        
        if (other.getStartTime() == null ^ this.getStartTime() == nullreturn false;
        if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == falsereturn false
        if (other.getEndTime() == null ^ this.getEndTime() == nullreturn false;
        if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == falsereturn false
        if (other.getInstanceTypes() == null ^ this.getInstanceTypes() == nullreturn false;
        if (other.getInstanceTypes() != null && other.getInstanceTypes().equals(this.getInstanceTypes()) == falsereturn false
        if (other.getProductDescriptions() == null ^ this.getProductDescriptions() == nullreturn false;
        if (other.getProductDescriptions() != null && other.getProductDescriptions().equals(this.getProductDescriptions()) == falsereturn false
        if (other.getFilters() == null ^ this.getFilters() == nullreturn false;
        if (other.getFilters() != null && other.getFilters().equals(this.getFilters()) == falsereturn false
        if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == nullreturn false;
        if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == falsereturn false
        if (other.getMaxResults() == null ^ this.getMaxResults() == nullreturn false;
        if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == falsereturn false
        if (other.getNextToken() == null ^ this.getNextToken() == nullreturn false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (DescribeSpotPriceHistoryRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X