Skip to content

delete_sampling_rule

delete_sampling_rule(
    *,
    config_overrides: Optional[XRayClientConfig] = None,
    rule_name: Optional[String] = None,
    rule_arn: Optional[String] = None,
) -> DeleteSamplingRuleResult

Deletes a sampling rule.

Parameters:

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

    The name of the sampling rule. Specify a rule by either name or ARN, but not both.

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

    The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.

Raises:

Source code in docs_src/capo_xray/_services/x_ray.py
def delete_sampling_rule(
    self,
    *,
    config_overrides: Optional[XRayClientConfig] = None,
    rule_name: Optional["capo_xray.types.string.String"] = None,
    rule_arn: Optional["capo_xray.types.string.String"] = None,
) -> "capo_xray.types.delete_sampling_rule_result.DeleteSamplingRuleResult":
    """<p>Deletes a sampling rule.</p>

    Args:
        rule_name: <p>The name of the sampling rule. Specify a rule by either name or ARN, but not both.</p>
        rule_arn: <p>The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.</p>

    Raises:
        capo_xray.errors.invalid_request_exception.InvalidRequestException: <p>The request is missing required parameters or has invalid parameters.</p>
        capo_xray.errors.throttled_exception.ThrottledException: <p>The request exceeds the maximum number of requests per second.</p>
        capo_xray.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_xray.types.delete_sampling_rule_request.DeleteSamplingRuleRequest]",
    ) -> OperationResponse[
        "capo_xray.types.delete_sampling_rule_result.DeleteSamplingRuleResult"
    ]:
        import capo_xray._operations.awsx_ray.delete_sampling_rule

        output, http_response = (
            capo_xray._operations.awsx_ray.delete_sampling_rule.delete_sampling_rule(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteSamplingRule")
    )
    input_: capo_xray.types.delete_sampling_rule_request.DeleteSamplingRuleRequest = {}
    if rule_name is not None:
        input_["rule_name"] = rule_name
    if rule_arn is not None:
        input_["rule_arn"] = rule_arn

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