Skip to content

retrieve_tape_archive async

retrieve_tape_archive(
    tape_arn: TapeARN,
    gateway_arn: GatewayARN,
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
) -> RetrieveTapeArchiveOutput

Retrieves an archived virtual tape from the virtual tape shelf (VTS) to a tape gateway. Virtual tapes archived in the VTS are not associated with any gateway. However after a tape is retrieved, it is associated with a gateway, even though it is also listed in the VTS, that is, archive. This operation is only supported in the tape gateway type.

Once a tape is successfully retrieved to a gateway, it cannot be retrieved again to another gateway. You must archive the tape again before you can retrieve it to another gateway. This operation is only supported in the tape gateway type.

Parameters:

  • tape_arn (TapeARN) –

    The Amazon Resource Name (ARN) of the virtual tape you want to retrieve from the virtual tape shelf (VTS).

  • gateway_arn (GatewayARN) –

    The Amazon Resource Name (ARN) of the gateway you want to retrieve the virtual tape to. Use the ListGateways operation to return a list of gateways for your account and Amazon Web Services Region.

    You retrieve archived virtual tapes to only one gateway and the gateway must be a tape gateway.

Raises:

  • InternalServerError –

    An internal server error has occurred during the request. For more information, see the error and message fields.

  • InvalidGatewayRequestException –

    An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To retrieve an archived tape from the VTS Retrieves an archived virtual tape from the virtual tape shelf (VTS) to a gateway-VTL. Virtual tapes archived in the VTS are not associated with any gateway.

>>> await client.retrieve_tape_archive(tape_arn='arn:aws:storagegateway:us-east-1:999999999999:tape/TEST0AA2AF', gateway_arn='arn:aws:storagegateway:us-east-1:999999999999:gateway/sgw-12A3456B')
Source code in docs_src/capo_storage_gateway/_services/async_storage_gateway.py
async def retrieve_tape_archive(
    self,
    tape_arn: "capo_storage_gateway.types.tape_arn.TapeARN",
    gateway_arn: "capo_storage_gateway.types.gateway_arn.GatewayARN",
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
) -> "capo_storage_gateway.types.retrieve_tape_archive_output.RetrieveTapeArchiveOutput":
    """<p>Retrieves an archived virtual tape from the virtual tape shelf (VTS) to a tape gateway. Virtual tapes archived in the VTS are not associated with any gateway. However after a tape is retrieved, it is associated with a gateway, even though it is also listed in the VTS, that is, archive. This operation is only supported in the tape gateway type.</p> <p>Once a tape is successfully retrieved to a gateway, it cannot be retrieved again to another gateway. You must archive the tape again before you can retrieve it to another gateway. This operation is only supported in the tape gateway type.</p>

    Args:
        tape_arn: <p>The Amazon Resource Name (ARN) of the virtual tape you want to retrieve from the virtual tape shelf (VTS).</p>
        gateway_arn: <p>The Amazon Resource Name (ARN) of the gateway you want to retrieve the virtual tape to. Use the <a>ListGateways</a> operation to return a list of gateways for your account and Amazon Web Services Region.</p> <p>You retrieve archived virtual tapes to only one gateway and the gateway must be a tape gateway.</p>

    Raises:
        capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To retrieve an archived tape from the VTS
        Retrieves an archived virtual tape from the virtual tape shelf (VTS) to a gateway-VTL. Virtual tapes archived in the VTS are not associated with any gateway.

        >>> await client.retrieve_tape_archive(tape_arn='arn:aws:storagegateway:us-east-1:999999999999:tape/TEST0AA2AF', gateway_arn='arn:aws:storagegateway:us-east-1:999999999999:gateway/sgw-12A3456B')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_storage_gateway.types.retrieve_tape_archive_input.RetrieveTapeArchiveInput]",
    ) -> AsyncOperationResponse[
        "capo_storage_gateway.types.retrieve_tape_archive_output.RetrieveTapeArchiveOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.retrieve_tape_archive

        (
            output,
            http_response,
        ) = await capo_storage_gateway._operations.storage_gateway_20130630.retrieve_tape_archive.async_retrieve_tape_archive(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RetrieveTapeArchive")
    )
    input_: capo_storage_gateway.types.retrieve_tape_archive_input.RetrieveTapeArchiveInput = {
        "tape_arn": tape_arn,
        "gateway_arn": gateway_arn,
    }

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