Skip to content

list_metrics async

list_metrics(
    *,
    config_overrides: Optional[AsyncresiliencehubClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    fields: Optional[FieldList] = None,
    data_source: Optional[String255] = None,
    conditions: Optional[ConditionList] = None,
    sorts: Optional[SortList] = None,
) -> ListMetricsResponse

Lists the metrics that can be exported.

Parameters:

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

    Null, or the token from a previous call to get the next set of results.

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

    Maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

  • fields (Optional[FieldList], default: None ) –

    Indicates the list of fields in the data source.

  • data_source (Optional[String255], default: None ) –

    Indicates the data source of the metrics.

  • conditions (Optional[ConditionList], default: None ) –

    Indicates the list of all the conditions that were applied on the metrics.

  • sorts (Optional[SortList], default: None ) –

    (Optional) Indicates the order in which you want to sort the fields in the metrics. By default, the fields are sorted in the ascending order.

Raises:

  • AccessDeniedException –

    You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.

  • InternalServerException –

    This exception occurs when there is an internal failure in the Resilience Hub service.

  • ThrottlingException –

    This exception occurs when you have exceeded the limit on the number of requests per second.

  • ValidationException –

    This exception occurs when a request is not valid.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_resiliencehub/_services/async_resiliencehub.py
async def list_metrics(
    self,
    *,
    config_overrides: Optional[AsyncresiliencehubClientConfig] = None,
    next_token: Optional["capo_resiliencehub.types.next_token.NextToken"] = None,
    max_results: Optional["capo_resiliencehub.types.max_results.MaxResults"] = None,
    fields: Optional["capo_resiliencehub.types.field_list.FieldList"] = None,
    data_source: Optional["capo_resiliencehub.types.string255.String255"] = None,
    conditions: Optional[
        "capo_resiliencehub.types.condition_list.ConditionList"
    ] = None,
    sorts: Optional["capo_resiliencehub.types.sort_list.SortList"] = None,
) -> "capo_resiliencehub.types.list_metrics_response.ListMetricsResponse":
    """<p>Lists the metrics that can be exported.</p>

    Args:
        next_token: <p>Null, or the token from a previous call to get the next set of results.</p>
        max_results: <p>Maximum number of results to include in the response. If more results exist than the specified <code>MaxResults</code> value, a token is included in the response so that the remaining results can be retrieved.</p>
        fields: <p>Indicates the list of fields in the data source.</p>
        data_source: <p>Indicates the data source of the metrics.</p>
        conditions: <p>Indicates the list of all the conditions that were applied on the metrics.</p>
        sorts: <p>(Optional) Indicates the order in which you want to sort the fields in the metrics. By default, the fields are sorted in the ascending order.</p>

    Raises:
        capo_resiliencehub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.</p>
        capo_resiliencehub.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Resilience Hub service.</p>
        capo_resiliencehub.errors.throttling_exception.ThrottlingException: <p>This exception occurs when you have exceeded the limit on the number of requests per second.</p>
        capo_resiliencehub.errors.validation_exception.ValidationException: <p>This exception occurs when a request is not valid.</p>
        capo_resiliencehub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_resiliencehub.types.list_metrics_request.ListMetricsRequest]",
    ) -> AsyncOperationResponse[
        "capo_resiliencehub.types.list_metrics_response.ListMetricsResponse"
    ]:
        import capo_resiliencehub._operations.aws_resilience_hub.list_metrics

        (
            output,
            http_response,
        ) = await capo_resiliencehub._operations.aws_resilience_hub.list_metrics.async_list_metrics(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListMetrics")
    )
    input_: capo_resiliencehub.types.list_metrics_request.ListMetricsRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if fields is not None:
        input_["fields"] = fields
    if data_source is not None:
        input_["data_source"] = data_source
    if conditions is not None:
        input_["conditions"] = conditions
    if sorts is not None:
        input_["sorts"] = sorts

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