describe_spot_price_history
async
¶
describe_spot_price_history(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = 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.
>>> await 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/async_ec2.py
34266 34267 34268 34269 34270 34271 34272 34273 34274 34275 34276 34277 34278 34279 34280 34281 34282 34283 34284 34285 34286 34287 34288 34289 34290 34291 34292 34293 34294 34295 34296 34297 34298 34299 34300 34301 34302 34303 34304 34305 34306 34307 34308 34309 34310 34311 34312 34313 34314 34315 34316 34317 34318 34319 34320 34321 34322 34323 34324 34325 34326 34327 34328 34329 34330 34331 34332 34333 34334 34335 34336 34337 34338 34339 34340 34341 34342 34343 34344 34345 34346 34347 34348 34349 34350 34351 34352 34353 34354 34355 34356 34357 | |