get_spot_placement_scores
async
¶
get_spot_placement_scores(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
instance_types: Optional[InstanceTypes] = None,
target_capacity: Optional[SpotPlacementScoresTargetCapacity] = None,
target_capacity_unit_type: Optional[TargetCapacityUnitType] = None,
single_availability_zone: Optional[Boolean] = None,
region_names: Optional[RegionNames] = None,
instance_requirements_with_metadata: Optional[
InstanceRequirementsWithMetadataRequest
] = None,
dry_run: Optional[Boolean] = None,
max_results: Optional[SpotPlacementScoresMaxResults] = None,
next_token: Optional[String] = None,
include_local_zones: Optional[Boolean] = None,
) -> GetSpotPlacementScoresResult
Calculates the Spot placement score for a Region or Availability Zone based on the specified target capacity and compute requirements.
You can specify your compute requirements either by using InstanceRequirementsWithMetadata and letting Amazon EC2 choose the optimal instance types to fulfill your Spot request, or you can specify the instance types by using InstanceTypes.
For more information, see Spot placement score in the Amazon EC2 User Guide.
Parameters:
-
instance_types(Optional[InstanceTypes], default:None) –The instance types. We recommend that you specify at least three instance types. If you specify one or two instance types, or specify variations of a single instance type (for example, an
m3.xlargewith and without instance storage), the returned placement score will always be low.If you specify
InstanceTypes, you can't specifyInstanceRequirementsWithMetadata. -
target_capacity(Optional[SpotPlacementScoresTargetCapacity], default:None) –The target capacity.
-
target_capacity_unit_type(Optional[TargetCapacityUnitType], default:None) –The unit for the target capacity.
-
single_availability_zone(Optional[Boolean], default:None) –Specify
trueso that the response returns a list of scored Availability Zones. Otherwise, the response returns a list of scored Regions.A list of scored Availability Zones is useful if you want to launch all of your Spot capacity into a single Availability Zone.
-
region_names(Optional[RegionNames], default:None) –The Regions used to narrow down the list of Regions to be scored. Enter the Region code, for example,
us-east-1. -
instance_requirements_with_metadata(Optional[InstanceRequirementsWithMetadataRequest], default:None) –The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with those attributes.
If you specify
InstanceRequirementsWithMetadata, you can't specifyInstanceTypes. -
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. -
max_results(Optional[SpotPlacementScoresMaxResults], 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.
-
include_local_zones(Optional[Boolean], default:None) –Specify
trueso that the response returns scores that include Local Zones. Otherwise, the response ignores Local Zones.When you request regional scores, Local Zone capacity counts toward its parent Region.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/async_ec2.py
47307 47308 47309 47310 47311 47312 47313 47314 47315 47316 47317 47318 47319 47320 47321 47322 47323 47324 47325 47326 47327 47328 47329 47330 47331 47332 47333 47334 47335 47336 47337 47338 47339 47340 47341 47342 47343 47344 47345 47346 47347 47348 47349 47350 47351 47352 47353 47354 47355 47356 47357 47358 47359 47360 47361 47362 47363 47364 47365 47366 47367 47368 47369 47370 47371 47372 47373 47374 47375 47376 47377 47378 47379 47380 47381 47382 47383 47384 47385 47386 47387 47388 47389 47390 47391 47392 47393 47394 47395 47396 | |