Skip to content

disable_aws_network_performance_metric_subscription

disable_aws_network_performance_metric_subscription(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    source: Optional[String] = None,
    destination: Optional[String] = None,
    metric: Optional[MetricType] = None,
    statistic: Optional[StatisticType] = None,
    dry_run: Optional[Boolean] = None,
) -> DisableAwsNetworkPerformanceMetricSubscriptionResult

Disables Infrastructure Performance metric subscriptions.

Parameters:

  • source (Optional[String], default: None ) –

    The source Region or Availability Zone that the metric subscription is disabled for. For example, us-east-1.

  • destination (Optional[String], default: None ) –

    The target Region or Availability Zone that the metric subscription is disabled for. For example, eu-north-1.

  • metric (Optional[MetricType], default: None ) –

    The metric used for the disabled subscription.

  • statistic (Optional[StatisticType], default: None ) –

    The statistic used for the disabled subscription.

  • 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/ec2.py
def disable_aws_network_performance_metric_subscription(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    source: Optional["capo_ec2.types.string.String"] = None,
    destination: Optional["capo_ec2.types.string.String"] = None,
    metric: Optional["capo_ec2.types.metric_type.MetricType"] = None,
    statistic: Optional["capo_ec2.types.statistic_type.StatisticType"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.disable_aws_network_performance_metric_subscription_result.DisableAwsNetworkPerformanceMetricSubscriptionResult":
    """<p>Disables Infrastructure Performance metric subscriptions.</p>

    Args:
        source: <p>The source Region or Availability Zone that the metric subscription is disabled for. For example, <code>us-east-1</code>.</p>
        destination: <p>The target Region or Availability Zone that the metric subscription is disabled for. For example, <code>eu-north-1</code>.</p>
        metric: <p>The metric used for the disabled subscription.</p>
        statistic: <p>The statistic used for the disabled subscription. </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.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.disable_aws_network_performance_metric_subscription_request.DisableAwsNetworkPerformanceMetricSubscriptionRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.disable_aws_network_performance_metric_subscription_result.DisableAwsNetworkPerformanceMetricSubscriptionResult"
    ]:
        import capo_ec2._operations.amazon_ec2.disable_aws_network_performance_metric_subscription

        output, http_response = (
            capo_ec2._operations.amazon_ec2.disable_aws_network_performance_metric_subscription.disable_aws_network_performance_metric_subscription(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DisableAwsNetworkPerformanceMetricSubscription"),
    )
    input_: capo_ec2.types.disable_aws_network_performance_metric_subscription_request.DisableAwsNetworkPerformanceMetricSubscriptionRequest = {}
    if source is not None:
        input_["source"] = source
    if destination is not None:
        input_["destination"] = destination
    if metric is not None:
        input_["metric"] = metric
    if statistic is not None:
        input_["statistic"] = statistic
    if dry_run is not None:
        input_["dry_run"] = dry_run

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