get_capacity_manager_metric_data
¶
get_capacity_manager_metric_data(
*,
config_overrides: Optional[EC2ClientConfig] = 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/ec2.py
42786 42787 42788 42789 42790 42791 42792 42793 42794 42795 42796 42797 42798 42799 42800 42801 42802 42803 42804 42805 42806 42807 42808 42809 42810 42811 42812 42813 42814 42815 42816 42817 42818 42819 42820 42821 42822 42823 42824 42825 42826 42827 42828 42829 42830 42831 42832 42833 42834 42835 42836 42837 42838 42839 42840 42841 42842 42843 42844 42845 42846 42847 42848 42849 42850 42851 42852 42853 42854 42855 42856 42857 42858 42859 42860 42861 42862 42863 42864 42865 42866 | |