Skip to content

get_capacity_manager_metric_dimensions async

get_capacity_manager_metric_dimensions(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    group_by: Optional[GroupBySet] = None,
    filter_by: Optional[CapacityManagerConditionSet] = None,
    start_time: Optional[MillisecondDateTime] = None,
    end_time: Optional[MillisecondDateTime] = None,
    metric_names: Optional[MetricSet] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    dry_run: Optional[Boolean] = None,
) -> GetCapacityManagerMetricDimensionsResult

Retrieves the available dimension values for capacity metrics within a specified time range. This is useful for discovering what accounts, regions, instance families, and other dimensions have data available for filtering and grouping.

Parameters:

  • group_by (Optional[GroupBySet], default: None ) –

    The dimensions to group by when retrieving available dimension values. This determines which dimension combinations are returned. Required parameter.

  • filter_by (Optional[CapacityManagerConditionSet], default: None ) –

    Conditions to filter which dimension values are returned. Each filter specifies a dimension, comparison operator, and values to match against.

  • start_time (Optional[MillisecondDateTime], default: None ) –

    The start time for the dimension query, in ISO 8601 format. Only dimensions with data in this time range will be returned.

  • end_time (Optional[MillisecondDateTime], default: None ) –

    The end time for the dimension query, in ISO 8601 format. Only dimensions with data in this time range will be returned.

  • metric_names (Optional[MetricSet], default: None ) –

    The metric names to use as an additional filter when retrieving dimensions. Only dimensions that have data for these metrics will be returned. Required parameter with maximum size of 1 for v1.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of dimension combinations to return. Valid range is 1 to 1000. Use with NextToken for pagination.

  • next_token (Optional[NextToken], default: None ) –

    The token for the next page of results. Use this value in a subsequent call to retrieve additional dimension values.

  • 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 is UnauthorizedOperation.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def get_capacity_manager_metric_dimensions(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    group_by: Optional["capo_ec2.types.group_by_set.GroupBySet"] = None,
    filter_by: Optional[
        "capo_ec2.types.capacity_manager_condition_set.CapacityManagerConditionSet"
    ] = None,
    start_time: Optional[
        "capo_ec2.types.millisecond_date_time.MillisecondDateTime"
    ] = None,
    end_time: Optional[
        "capo_ec2.types.millisecond_date_time.MillisecondDateTime"
    ] = None,
    metric_names: Optional["capo_ec2.types.metric_set.MetricSet"] = None,
    max_results: Optional["capo_ec2.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_ec2.types.next_token.NextToken"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.get_capacity_manager_metric_dimensions_result.GetCapacityManagerMetricDimensionsResult":
    """<p> Retrieves the available dimension values for capacity metrics within a specified time range. This is useful for discovering what accounts, regions, instance families, and other dimensions have data available for filtering and grouping. </p>

    Args:
        group_by: <p> The dimensions to group by when retrieving available dimension values. This determines which dimension combinations are returned. Required parameter. </p>
        filter_by: <p> Conditions to filter which dimension values are returned. Each filter specifies a dimension, comparison operator, and values to match against. </p>
        start_time: <p> The start time for the dimension query, in ISO 8601 format. Only dimensions with data in this time range will be returned. </p>
        end_time: <p> The end time for the dimension query, in ISO 8601 format. Only dimensions with data in this time range will be returned. </p>
        metric_names: <p> The metric names to use as an additional filter when retrieving dimensions. Only dimensions that have data for these metrics will be returned. Required parameter with maximum size of 1 for v1. </p>
        max_results: <p> The maximum number of dimension combinations to return. Valid range is 1 to 1000. Use with NextToken for pagination. </p>
        next_token: <p> The token for the next page of results. Use this value in a subsequent call to retrieve additional dimension values. </p>
        dry_run: <p> 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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>. </p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.get_capacity_manager_metric_dimensions_request.GetCapacityManagerMetricDimensionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.get_capacity_manager_metric_dimensions_result.GetCapacityManagerMetricDimensionsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.get_capacity_manager_metric_dimensions

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.get_capacity_manager_metric_dimensions.async_get_capacity_manager_metric_dimensions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCapacityManagerMetricDimensions")
    )
    input_: capo_ec2.types.get_capacity_manager_metric_dimensions_request.GetCapacityManagerMetricDimensionsRequest = {}
    if group_by is not None:
        input_["group_by"] = group_by
    if filter_by is not None:
        input_["filter_by"] = filter_by
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if metric_names is not None:
        input_["metric_names"] = metric_names
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output