Skip to content

get_resource_target

get_resource_target(
    arn: ResourceTargetArn,
    *,
    config_overrides: Optional[BackupExternalClientConfig] = None,
) -> GetResourceTargetOutput

Returns configuration, metadata, and status information for the specified resource target.

Parameters:

Raises:

Source code in docs_src/capo_backup_external/_services/backup_external.py
def get_resource_target(
    self,
    arn: "capo_backup_external.types.resource_target_arn.ResourceTargetArn",
    *,
    config_overrides: Optional[BackupExternalClientConfig] = None,
) -> (
    "capo_backup_external.types.get_resource_target_output.GetResourceTargetOutput"
):
    """Returns configuration, metadata, and status information for the specified resource target.

    Args:
        arn: The Amazon Resource Name (ARN) of the resource target.

    Raises:
        capo_backup_external.errors.access_denied_exception.AccessDeniedException: The request was denied because you do not have permission to perform the requested operation.
        capo_backup_external.errors.conflict_exception.ConflictException: The request conflicts with the current state of the specified resource.
        capo_backup_external.errors.internal_server_exception.InternalServerException: The request failed because of an internal server error.
        capo_backup_external.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource was not found.
        capo_backup_external.errors.throttling_exception.ThrottlingException: The request was denied because the request rate is too high.
        capo_backup_external.errors.validation_exception.ValidationException: The request contains invalid parameters.
        capo_backup_external.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_backup_external.types.get_resource_target_input.GetResourceTargetInput]",
    ) -> OperationResponse[
        "capo_backup_external.types.get_resource_target_output.GetResourceTargetOutput"
    ]:
        import capo_backup_external._operations.backup_external.get_resource_target

        output, http_response = (
            capo_backup_external._operations.backup_external.get_resource_target.get_resource_target(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_backup_external.types.get_resource_target_output.GetResourceTargetOutput",
    ) -> dict[str, Any]:
        import capo_backup_external.types.get_resource_target_output

        return (
            capo_backup_external.types.get_resource_target_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetResourceTarget", redact_output=_redact_output),
    )
    input_: capo_backup_external.types.get_resource_target_input.GetResourceTargetInput = {
        "arn": arn
    }

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