get_spot_placement_scores
¶
get_spot_placement_scores(
*,
config_overrides: Optional[EC2ClientConfig] = 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/ec2.py
46663 46664 46665 46666 46667 46668 46669 46670 46671 46672 46673 46674 46675 46676 46677 46678 46679 46680 46681 46682 46683 46684 46685 46686 46687 46688 46689 46690 46691 46692 46693 46694 46695 46696 46697 46698 46699 46700 46701 46702 46703 46704 46705 46706 46707 46708 46709 46710 46711 46712 46713 46714 46715 46716 46717 46718 46719 46720 46721 46722 46723 46724 46725 46726 46727 46728 46729 46730 46731 46732 46733 46734 46735 46736 46737 46738 46739 46740 46741 46742 46743 46744 46745 46746 46747 46748 46749 46750 46751 | |