Skip to content

get_metric_stream

get_metric_stream(
    *,
    config_overrides: Optional[CloudWatchClientConfig] = None,
    name: Optional[MetricStreamName] = None,
) -> GetMetricStreamOutput

Returns information about the metric stream that you specify.

Parameters:

Raises:

Source code in docs_src/capo_cloudwatch/_services/cloud_watch.py
def get_metric_stream(
    self,
    *,
    config_overrides: Optional[CloudWatchClientConfig] = None,
    name: Optional[
        "capo_cloudwatch.types.metric_stream_name.MetricStreamName"
    ] = None,
) -> "capo_cloudwatch.types.get_metric_stream_output.GetMetricStreamOutput":
    """<p>Returns information about the metric stream that you specify.</p>

    Args:
        name: <p>The name of the metric stream to retrieve information about.</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_combination_exception.InvalidParameterCombinationException: <p>Parameters were used together that cannot be used together.</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.resource_not_found_exception.ResourceNotFoundException: <p>The named resource does not exist.</p>
        capo_cloudwatch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatch.types.get_metric_stream_input.GetMetricStreamInput]",
    ) -> OperationResponse[
        "capo_cloudwatch.types.get_metric_stream_output.GetMetricStreamOutput"
    ]:
        import capo_cloudwatch._operations.granite_service_version20100801.get_metric_stream

        output, http_response = (
            capo_cloudwatch._operations.granite_service_version20100801.get_metric_stream.get_metric_stream(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetMetricStream")
    )
    input_: capo_cloudwatch.types.get_metric_stream_input.GetMetricStreamInput = {}
    if name is not None:
        input_["name"] = name

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output