AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the DescribeSpotPriceHistory operation. Describes the Spot price history. For more information, see Spot Instance pricing history in the Amazon EC2 User Guide for Linux Instances.

When you specify a start and end time, the operation returns the prices of the instance types within that time range. It also returns the last price change before the start time, which is the effective price as of the start time.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.EC2.AmazonEC2Request
      Amazon.EC2.Model.DescribeSpotPriceHistoryRequest

Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z

Syntax

C#
public class DescribeSpotPriceHistoryRequest : AmazonEC2Request
         IAmazonWebServiceRequest

The DescribeSpotPriceHistoryRequest type exposes the following members

Constructors

Properties

NameTypeDescription
Public Property AvailabilityZone System.String

Gets and sets the property AvailabilityZone.

Filters the results by the specified Availability Zone.

Public Property EndTime System.DateTime

Gets and sets the property EndTimeUtc.

This property is deprecated. Setting this property results in non-UTC DateTimes not being marshalled correctly. Use EndTimeUtc instead. Setting either EndTime or EndTimeUtc results in both EndTime and EndTimeUtc being assigned, the latest assignment to either one of the two property is reflected in the value of both. EndTime is provided for backwards compatibility only and assigning a non-Utc DateTime to it results in the wrong timestamp being passed to the service.

The date and time, up to the current date, from which to stop retrieving the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).

Public Property EndTimeUtc System.DateTime

Gets and sets the property EndTimeUtc.

The date and time, up to the current date, from which to stop retrieving the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).

Public Property Filters System.Collections.Generic.List<Amazon.EC2.Model.Filter>

Gets and sets the property Filters.

The filters.

  • availability-zone - The Availability Zone for which prices should be returned.

  • instance-type - The type of instance (for example, m3.medium).

  • product-description - The product description for the Spot price (Linux/UNIX | Red Hat Enterprise Linux | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | Red Hat Enterprise Linux (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 time stamp of the Spot price history, in UTC format (for example, ddd MMM dd HH:mm:ss UTC YYYY). You can use wildcards (* and ?). Greater than or less than comparison is not supported.

Public Property InstanceTypes System.Collections.Generic.List<System.String>

Gets and sets the property InstanceTypes.

Filters the results by the specified instance types.

Public Property MaxResults System.Int32

Gets and sets the property MaxResults.

The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

Public Property NextToken System.String

Gets and sets the property NextToken.

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

Public Property ProductDescriptions System.Collections.Generic.List<System.String>

Gets and sets the property ProductDescriptions.

Filters the results by the specified basic product descriptions.

Public Property StartTime System.DateTime

Gets and sets the property StartTimeUtc.

This property is deprecated. Setting this property results in non-UTC DateTimes not being marshalled correctly. Use StartTimeUtc instead. Setting either StartTime or StartTimeUtc results in both StartTime and StartTimeUtc being assigned, the latest assignment to either one of the two property is reflected in the value of both. StartTime is provided for backwards compatibility only and assigning a non-Utc DateTime to it results in the wrong timestamp being passed to the service.

The date and time, up to the past 90 days, from which to start retrieving the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).

Public Property StartTimeUtc System.DateTime

Gets and sets the property StartTimeUtc.

The date and time, up to the past 90 days, from which to start retrieving the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).

Examples

This example returns the Spot Price history for m1.xlarge, Linux/UNIX (Amazon VPC) instances for a particular day in January.

To describe Spot price history for Linux/UNIX (Amazon VPC)


var client = new AmazonEC2Client();
var response = client.DescribeSpotPriceHistory(new DescribeSpotPriceHistoryRequest 
{
    EndTimeUtc = new DateTime(2014, 1, 6, 8, 9, 10, DateTimeKind.Utc),
    InstanceTypes = new List<string> {
        "m1.xlarge"
    },
    ProductDescriptions = new List<string> {
        "Linux/UNIX (Amazon VPC)"
    },
    StartTimeUtc = new DateTime(2014, 1, 6, 7, 8, 9, DateTimeKind.Utc)
});

List<SpotPrice> spotPriceHistory = response.SpotPriceHistory;

            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5