Skip to content

get_data_protection_policy async

get_data_protection_policy(
    log_group_identifier: LogGroupIdentifier,
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> GetDataProtectionPolicyResponse

Returns information about a log group data protection policy.

Parameters:

  • log_group_identifier (LogGroupIdentifier) –

    The name or ARN of the log group that contains the data protection policy that you want to see.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
async def get_data_protection_policy(
    self,
    log_group_identifier: "capo_cloudwatch_logs.types.log_group_identifier.LogGroupIdentifier",
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> "capo_cloudwatch_logs.types.get_data_protection_policy_response.GetDataProtectionPolicyResponse":
    """<p>Returns information about a log group data protection policy.</p>

    Args:
        log_group_identifier: <p>The name or ARN of the log group that contains the data protection policy that you want to see.</p>

    Raises:
        capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
        capo_cloudwatch_logs.errors.operation_aborted_exception.OperationAbortedException: <p>Multiple concurrent requests to update the same resource were in conflict.</p>
        capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
        capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_logs.types.get_data_protection_policy_request.GetDataProtectionPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_logs.types.get_data_protection_policy_response.GetDataProtectionPolicyResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.get_data_protection_policy

        (
            output,
            http_response,
        ) = await capo_cloudwatch_logs._operations.logs_20140328.get_data_protection_policy.async_get_data_protection_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetDataProtectionPolicy")
    )
    input_: capo_cloudwatch_logs.types.get_data_protection_policy_request.GetDataProtectionPolicyRequest = {
        "log_group_identifier": log_group_identifier
    }

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