get_capacity_manager_metric_data
async
¶
get_capacity_manager_metric_data(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
metric_names: Optional[MetricSet] = None,
start_time: Optional[MillisecondDateTime] = None,
end_time: Optional[MillisecondDateTime] = None,
period: Optional[Period] = None,
group_by: Optional[GroupBySet] = None,
filter_by: Optional[CapacityManagerConditionSet] = None,
max_results: Optional[MaxResults] = None,
next_token: Optional[NextToken] = None,
dry_run: Optional[Boolean] = None,
) -> GetCapacityManagerMetricDataResult
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:
-
metric_names(Optional[MetricSet], default:None) –The names of the metrics to retrieve. Maximum of 10 metrics per request.
-
start_time(Optional[MillisecondDateTime], default:None) –The start time for the metric data query, in ISO 8601 format. The time range (end time - start time) must be a multiple of the specified period.
-
end_time(Optional[MillisecondDateTime], default: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.
-
period(Optional[Period], default:None) –The granularity, in seconds, of the returned data points.
-
group_by(Optional[GroupBySet], default:None) –The dimensions by which to group the metric data. This determines how the data is aggregated and returned.
-
filter_by(Optional[CapacityManagerConditionSet], default:None) –Conditions to filter the metric data. Each filter specifies a dimension, comparison operator ('equals', 'in'), and values to match against.
-
max_results(Optional[MaxResults], default: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.
-
next_token(Optional[NextToken], default:None) –The token for the next page of results. Use this value in a subsequent call to retrieve additional data points.
-
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.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/async_ec2.py
43377 43378 43379 43380 43381 43382 43383 43384 43385 43386 43387 43388 43389 43390 43391 43392 43393 43394 43395 43396 43397 43398 43399 43400 43401 43402 43403 43404 43405 43406 43407 43408 43409 43410 43411 43412 43413 43414 43415 43416 43417 43418 43419 43420 43421 43422 43423 43424 43425 43426 43427 43428 43429 43430 43431 43432 43433 43434 43435 43436 43437 43438 43439 43440 43441 43442 43443 43444 43445 43446 43447 43448 43449 43450 43451 43452 43453 43454 43455 43456 43457 43458 | |