describe_spot_price_history
¶
describe_spot_price_history(
*,
config_overrides: Optional[EC2ClientConfig] = None,
availability_zone_id: Optional[AvailabilityZoneId] = None,
dry_run: Optional[Boolean] = None,
start_time: Optional[DateTime] = None,
end_time: Optional[DateTime] = None,
instance_types: Optional[InstanceTypeList] = None,
product_descriptions: Optional[ProductDescriptionList] = None,
filters: Optional[FilterList] = None,
availability_zone: Optional[String] = None,
max_results: Optional[Integer] = None,
next_token: Optional[String] = None,
) -> DescribeSpotPriceHistoryResult
Describes the Spot price history. For more information, see Spot Instance pricing history in the Amazon EC2 User Guide.
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.
Parameters:
-
availability_zone_id(Optional[AvailabilityZoneId], default:None) –Filters the results by the specified ID of the Availability Zone.
Either
AvailabilityZoneorAvailabilityZoneIdcan be specified, but not both -
dry_run(Optional[Boolean], default:None) –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 isUnauthorizedOperation. -
start_time(Optional[DateTime], default:None) –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).
-
end_time(Optional[DateTime], default:None) –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).
-
instance_types(Optional[InstanceTypeList], default:None) –Filters the results by the specified instance types.
-
product_descriptions(Optional[ProductDescriptionList], default:None) –Filters the results by the specified basic product descriptions.
-
filters(Optional[FilterList], default:None) –The filters.
-
availability-zone- The Availability Zone for which prices should be returned. -
availability-zone-id- The ID of 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.
-
-
availability_zone(Optional[String], default:None) –Filters the results by the specified Availability Zone.
Either
AvailabilityZoneorAvailabilityZoneIdcan be specified, but not both -
max_results(Optional[Integer], default:None) –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.
-
next_token(Optional[String], default:None) –The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To describe Spot price history for Linux/UNIX (Amazon VPC) This example returns the Spot Price history for m1.xlarge, Linux/UNIX (Amazon VPC) instances for a particular day in January.
>>> client.describe_spot_price_history(start_time='2014-01-06T07:08:09.05Z', end_time='2014-01-06T08:09:10.05Z', instance_types=['m1.xlarge'], product_descriptions=['Linux/UNIX (Amazon VPC)'])
Source code in docs_src/capo_ec2/_services/ec2.py
33815 33816 33817 33818 33819 33820 33821 33822 33823 33824 33825 33826 33827 33828 33829 33830 33831 33832 33833 33834 33835 33836 33837 33838 33839 33840 33841 33842 33843 33844 33845 33846 33847 33848 33849 33850 33851 33852 33853 33854 33855 33856 33857 33858 33859 33860 33861 33862 33863 33864 33865 33866 33867 33868 33869 33870 33871 33872 33873 33874 33875 33876 33877 33878 33879 33880 33881 33882 33883 33884 33885 33886 33887 33888 33889 33890 33891 33892 33893 33894 33895 33896 33897 33898 33899 33900 33901 33902 33903 33904 33905 | |