Skip to content

list_metric_values async

list_metric_values(
    thing_name: DeviceDefenderThingName,
    metric_name: BehaviorMetric,
    start_time: Timestamp,
    end_time: Timestamp,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    dimension_name: Optional[DimensionName] = None,
    dimension_value_operator: Optional[DimensionValueOperator] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListMetricValuesResponse

Lists the values reported for an IoT Device Defender metric (device-side metric, cloud-side metric, or custom metric) by the given thing during the specified time period.

Parameters:

  • thing_name (DeviceDefenderThingName) –

    The name of the thing for which security profile metric values are returned.

  • metric_name (BehaviorMetric) –

    The name of the security profile metric for which values are returned.

  • dimension_name (Optional[DimensionName], default: None ) –

    The dimension name.

  • dimension_value_operator (Optional[DimensionValueOperator], default: None ) –

    The dimension value operator.

  • start_time (Timestamp) –

    The start of the time period for which metric values are returned.

  • end_time (Timestamp) –

    The end of the time period for which metric values are returned.

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

    The maximum number of results to return at one time.

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

    The token for the next set of results.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def list_metric_values(
    self,
    thing_name: "capo_iot.types.device_defender_thing_name.DeviceDefenderThingName",
    metric_name: "capo_iot.types.behavior_metric.BehaviorMetric",
    start_time: "capo_iot.types.timestamp.Timestamp",
    end_time: "capo_iot.types.timestamp.Timestamp",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    dimension_name: Optional["capo_iot.types.dimension_name.DimensionName"] = None,
    dimension_value_operator: Optional[
        "capo_iot.types.dimension_value_operator.DimensionValueOperator"
    ] = None,
    max_results: Optional["capo_iot.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_iot.types.next_token.NextToken"] = None,
) -> "capo_iot.types.list_metric_values_response.ListMetricValuesResponse":
    """<p>Lists the values reported for an IoT Device Defender metric (device-side metric, cloud-side metric, or custom metric) by the given thing during the specified time period.</p>

    Args:
        thing_name: <p>The name of the thing for which security profile metric values are returned.</p>
        metric_name: <p>The name of the security profile metric for which values are returned.</p>
        dimension_name: <p>The dimension name.</p>
        dimension_value_operator: <p>The dimension value operator.</p>
        start_time: <p>The start of the time period for which metric values are returned.</p>
        end_time: <p>The end of the time period for which metric values are returned.</p>
        max_results: <p>The maximum number of results to return at one time.</p>
        next_token: <p>The token for the next set of results.</p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.list_metric_values_request.ListMetricValuesRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.list_metric_values_response.ListMetricValuesResponse"
    ]:
        import capo_iot._operations.aws_iot_service.list_metric_values

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.list_metric_values.async_list_metric_values(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListMetricValues")
    )
    input_: capo_iot.types.list_metric_values_request.ListMetricValuesRequest = {
        "thing_name": thing_name,
        "metric_name": metric_name,
        "start_time": start_time,
        "end_time": end_time,
    }
    if dimension_name is not None:
        input_["dimension_name"] = dimension_name
    if dimension_value_operator is not None:
        input_["dimension_value_operator"] = dimension_value_operator
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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