get_capacity_manager_metric_data¶
Operation¶
get_capacity_manager_metric_data
async
¶
get_capacity_manager_metric_data(request: GetCapacityManagerMetricDataInput | GetCapacityManagerMetricDataInputDict, /, *, plugins: list[Plugin] | None = None) -> GetCapacityManagerMetricDataOutput
get_capacity_manager_metric_data(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetCapacityManagerMetricDataInputDict]) -> GetCapacityManagerMetricDataOutput
Retrieves capacity usage metrics for your EC2 resources. Returns time-series data for metrics like unused capacity, utilization rates, and costs across On-Demand, Spot, and Capacity Reservations. Data can be grouped and filtered by various dimensions such as region, account, and instance family.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
GetCapacityManagerMetricDataOutput
|
An instance of |
Input¶
Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.
Model¶
GetCapacityManagerMetricDataInput
dataclass
¶
Bases: _SerdeShape
Dataclass for GetCapacityManagerMetricDataInput structure.
Attributes¶
dry_run
class-attribute
instance-attribute
¶
dry_run: bool | 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 is UnauthorizedOperation.
end_time
class-attribute
instance-attribute
¶
end_time: datetime | None = ...
The end time for the metric data query, in ISO 8601 format. If the end time is beyond the latest ingested data, it will be automatically adjusted to the latest available data point.
filter_by
class-attribute
instance-attribute
¶
filter_by: list[CapacityManagerCondition] | None = ...
Conditions to filter the metric data. Each filter specifies a dimension, comparison operator ('equals', 'in'), and values to match against.
group_by
class-attribute
instance-attribute
¶
The dimensions by which to group the metric data. This determines how the data is aggregated and returned.
max_results
class-attribute
instance-attribute
¶
max_results: int | None = ...
The maximum number of data points to return. Valid range is 1 to 100,000. Use with NextToken for pagination of large result sets.
metric_names
class-attribute
instance-attribute
¶
The names of the metrics to retrieve. Maximum of 10 metrics per request.
next_token
class-attribute
instance-attribute
¶
next_token: str | None = ...
The token for the next page of results. Use this value in a subsequent call to retrieve additional data points.
Dictionaries¶
GetCapacityManagerMetricDataInputDict
¶
Bases: TypedDict
Dictionary form of GetCapacityManagerMetricDataInput.
Attributes¶
dry_run
instance-attribute
¶
dry_run: bool | 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 is UnauthorizedOperation.
end_time
instance-attribute
¶
The end time for the metric data query, in ISO 8601 format. If the end time is beyond the latest ingested data, it will be automatically adjusted to the latest available data point.
filter_by
instance-attribute
¶
filter_by: Sequence[CapacityManagerCondition | CapacityManagerConditionDict] | None
Conditions to filter the metric data. Each filter specifies a dimension, comparison operator ('equals', 'in'), and values to match against.
group_by
instance-attribute
¶
The dimensions by which to group the metric data. This determines how the data is aggregated and returned.
max_results
instance-attribute
¶
max_results: int | None
The maximum number of data points to return. Valid range is 1 to 100,000. Use with NextToken for pagination of large result sets.
metric_names
instance-attribute
¶
The names of the metrics to retrieve. Maximum of 10 metrics per request.
next_token
instance-attribute
¶
next_token: str | None
The token for the next page of results. Use this value in a subsequent call to retrieve additional data points.
period
instance-attribute
¶
The granularity, in seconds, of the returned data points.
Output¶
GetCapacityManagerMetricDataOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for GetCapacityManagerMetricDataOutput structure.
Attributes¶
metric_data_results
class-attribute
instance-attribute
¶
metric_data_results: list[MetricDataResult] | None = ...
The metric data points returned by the query. Each result contains dimension values, timestamp, and metric values with their associated statistics.
next_token
class-attribute
instance-attribute
¶
next_token: str | None = ...
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.