Skip to content

stop_metric_streams async

stop_metric_streams(
    *,
    config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
    names: Optional[MetricStreamNames] = None,
) -> StopMetricStreamsOutput

Stops the streaming of metrics for one or more of your metric streams.

Parameters:

  • names (Optional[MetricStreamNames], default: None ) –

    The array of the names of metric streams to stop streaming.

    This is an "all or nothing" operation. If you do not have permission to access all of the metric streams that you list here, then none of the streams that you list in the operation will stop streaming.

Raises:

Source code in docs_src/capo_cloudwatch/_services/async_cloud_watch.py
async def stop_metric_streams(
    self,
    *,
    config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
    names: Optional[
        "capo_cloudwatch.types.metric_stream_names.MetricStreamNames"
    ] = None,
) -> "capo_cloudwatch.types.stop_metric_streams_output.StopMetricStreamsOutput":
    """<p>Stops the streaming of metrics for one or more of your metric streams.</p>

    Args:
        names: <p>The array of the names of metric streams to stop streaming.</p> <p>This is an "all or nothing" operation. If you do not have permission to access all of the metric streams that you list here, then none of the streams that you list in the operation will stop streaming.</p>

    Raises:
        capo_cloudwatch.errors.internal_service_fault.InternalServiceFault: <p>Request processing has failed due to some unknown error, exception, or failure.</p>
        capo_cloudwatch.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value of an input parameter is bad or out-of-range.</p>
        capo_cloudwatch.errors.missing_required_parameter_exception.MissingRequiredParameterException: <p>An input parameter that is required is missing.</p>
        capo_cloudwatch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch.types.stop_metric_streams_input.StopMetricStreamsInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch.types.stop_metric_streams_output.StopMetricStreamsOutput"
    ]:
        import capo_cloudwatch._operations.granite_service_version20100801.stop_metric_streams

        (
            output,
            http_response,
        ) = await capo_cloudwatch._operations.granite_service_version20100801.stop_metric_streams.async_stop_metric_streams(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopMetricStreams")
    )
    input_: capo_cloudwatch.types.stop_metric_streams_input.StopMetricStreamsInput = {}
    if names is not None:
        input_["names"] = names

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