Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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.
This operation returns paginated results.
Synopsis
- data GetSpotPlacementScores = GetSpotPlacementScores' {
- dryRun :: Maybe Bool
- instanceRequirementsWithMetadata :: Maybe InstanceRequirementsWithMetadataRequest
- instanceTypes :: Maybe [Text]
- maxResults :: Maybe Natural
- nextToken :: Maybe Text
- regionNames :: Maybe [Text]
- singleAvailabilityZone :: Maybe Bool
- targetCapacityUnitType :: Maybe TargetCapacityUnitType
- targetCapacity :: Natural
- newGetSpotPlacementScores :: Natural -> GetSpotPlacementScores
- getSpotPlacementScores_dryRun :: Lens' GetSpotPlacementScores (Maybe Bool)
- getSpotPlacementScores_instanceRequirementsWithMetadata :: Lens' GetSpotPlacementScores (Maybe InstanceRequirementsWithMetadataRequest)
- getSpotPlacementScores_instanceTypes :: Lens' GetSpotPlacementScores (Maybe [Text])
- getSpotPlacementScores_maxResults :: Lens' GetSpotPlacementScores (Maybe Natural)
- getSpotPlacementScores_nextToken :: Lens' GetSpotPlacementScores (Maybe Text)
- getSpotPlacementScores_regionNames :: Lens' GetSpotPlacementScores (Maybe [Text])
- getSpotPlacementScores_singleAvailabilityZone :: Lens' GetSpotPlacementScores (Maybe Bool)
- getSpotPlacementScores_targetCapacityUnitType :: Lens' GetSpotPlacementScores (Maybe TargetCapacityUnitType)
- getSpotPlacementScores_targetCapacity :: Lens' GetSpotPlacementScores Natural
- data GetSpotPlacementScoresResponse = GetSpotPlacementScoresResponse' {}
- newGetSpotPlacementScoresResponse :: Int -> GetSpotPlacementScoresResponse
- getSpotPlacementScoresResponse_nextToken :: Lens' GetSpotPlacementScoresResponse (Maybe Text)
- getSpotPlacementScoresResponse_spotPlacementScores :: Lens' GetSpotPlacementScoresResponse (Maybe [SpotPlacementScore])
- getSpotPlacementScoresResponse_httpStatus :: Lens' GetSpotPlacementScoresResponse Int
Creating a Request
data GetSpotPlacementScores Source #
See: newGetSpotPlacementScores
smart constructor.
GetSpotPlacementScores' | |
|
Instances
newGetSpotPlacementScores Source #
Create a value of GetSpotPlacementScores
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:dryRun:GetSpotPlacementScores'
, getSpotPlacementScores_dryRun
- 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 is UnauthorizedOperation
.
$sel:instanceRequirementsWithMetadata:GetSpotPlacementScores'
, getSpotPlacementScores_instanceRequirementsWithMetadata
- 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 specify
InstanceTypes
.
GetSpotPlacementScores
, getSpotPlacementScores_instanceTypes
- 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.xlarge
with
and without instance storage), the returned placement score will always
be low.
If you specify InstanceTypes
, you can't specify
InstanceRequirementsWithMetadata
.
$sel:maxResults:GetSpotPlacementScores'
, getSpotPlacementScores_maxResults
- The maximum number of results to return in a single call. Specify a
value between 1 and
1000. The default value is 1000. To retrieve the
remaining results, make another call with
the returned NextToken
value.
GetSpotPlacementScores
, getSpotPlacementScores_nextToken
- The token for the next set of results.
$sel:regionNames:GetSpotPlacementScores'
, getSpotPlacementScores_regionNames
- The Regions used to narrow down the list of Regions to be scored. Enter
the Region code, for example, us-east-1
.
GetSpotPlacementScores
, getSpotPlacementScores_singleAvailabilityZone
- Specify true
so 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.
GetSpotPlacementScores
, getSpotPlacementScores_targetCapacityUnitType
- The unit for the target capacity.
Default: units
(translates to number of instances)
GetSpotPlacementScores
, getSpotPlacementScores_targetCapacity
- The target capacity.
Request Lenses
getSpotPlacementScores_dryRun :: Lens' GetSpotPlacementScores (Maybe Bool) Source #
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 is UnauthorizedOperation
.
getSpotPlacementScores_instanceRequirementsWithMetadata :: Lens' GetSpotPlacementScores (Maybe InstanceRequirementsWithMetadataRequest) Source #
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 specify
InstanceTypes
.
getSpotPlacementScores_instanceTypes :: Lens' GetSpotPlacementScores (Maybe [Text]) Source #
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.xlarge
with
and without instance storage), the returned placement score will always
be low.
If you specify InstanceTypes
, you can't specify
InstanceRequirementsWithMetadata
.
getSpotPlacementScores_maxResults :: Lens' GetSpotPlacementScores (Maybe Natural) Source #
The maximum number of results to return in a single call. Specify a
value between 1 and
1000. The default value is 1000. To retrieve the
remaining results, make another call with
the returned NextToken
value.
getSpotPlacementScores_nextToken :: Lens' GetSpotPlacementScores (Maybe Text) Source #
The token for the next set of results.
getSpotPlacementScores_regionNames :: Lens' GetSpotPlacementScores (Maybe [Text]) Source #
The Regions used to narrow down the list of Regions to be scored. Enter
the Region code, for example, us-east-1
.
getSpotPlacementScores_singleAvailabilityZone :: Lens' GetSpotPlacementScores (Maybe Bool) Source #
Specify true
so 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.
getSpotPlacementScores_targetCapacityUnitType :: Lens' GetSpotPlacementScores (Maybe TargetCapacityUnitType) Source #
The unit for the target capacity.
Default: units
(translates to number of instances)
getSpotPlacementScores_targetCapacity :: Lens' GetSpotPlacementScores Natural Source #
The target capacity.
Destructuring the Response
data GetSpotPlacementScoresResponse Source #
See: newGetSpotPlacementScoresResponse
smart constructor.
GetSpotPlacementScoresResponse' | |
|
Instances
newGetSpotPlacementScoresResponse Source #
Create a value of GetSpotPlacementScoresResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
GetSpotPlacementScores
, getSpotPlacementScoresResponse_nextToken
- The token for the next set of results.
$sel:spotPlacementScores:GetSpotPlacementScoresResponse'
, getSpotPlacementScoresResponse_spotPlacementScores
- The Spot placement score for the top 10 Regions or Availability Zones,
scored on a scale from 1 to 10. Each score
reflects how likely it is
that each Region or Availability Zone will succeed at fulfilling the
specified target capacity
/at the time of the Spot placement score
request/. A score of 10
means that your Spot capacity request is
highly likely to succeed in that Region or Availability Zone.
If you request a Spot placement score for Regions, a high score assumes
that your fleet request will be configured to use all Availability Zones
and the capacity-optimized
allocation strategy. If you request a Spot
placement score for Availability Zones, a high score assumes that your
fleet request will be configured to use a single Availability Zone and
the capacity-optimized
allocation strategy.
Different Regions or Availability Zones might return the same score.
The Spot placement score serves as a recommendation only. No score guarantees that your Spot request will be fully or partially fulfilled.
$sel:httpStatus:GetSpotPlacementScoresResponse'
, getSpotPlacementScoresResponse_httpStatus
- The response's http status code.
Response Lenses
getSpotPlacementScoresResponse_nextToken :: Lens' GetSpotPlacementScoresResponse (Maybe Text) Source #
The token for the next set of results.
getSpotPlacementScoresResponse_spotPlacementScores :: Lens' GetSpotPlacementScoresResponse (Maybe [SpotPlacementScore]) Source #
The Spot placement score for the top 10 Regions or Availability Zones,
scored on a scale from 1 to 10. Each score
reflects how likely it is
that each Region or Availability Zone will succeed at fulfilling the
specified target capacity
/at the time of the Spot placement score
request/. A score of 10
means that your Spot capacity request is
highly likely to succeed in that Region or Availability Zone.
If you request a Spot placement score for Regions, a high score assumes
that your fleet request will be configured to use all Availability Zones
and the capacity-optimized
allocation strategy. If you request a Spot
placement score for Availability Zones, a high score assumes that your
fleet request will be configured to use a single Availability Zone and
the capacity-optimized
allocation strategy.
Different Regions or Availability Zones might return the same score.
The Spot placement score serves as a recommendation only. No score guarantees that your Spot request will be fully or partially fulfilled.
getSpotPlacementScoresResponse_httpStatus :: Lens' GetSpotPlacementScoresResponse Int Source #
The response's http status code.