:doc:`StorageGateway <../../storagegateway>` / Client / cancel_retrieval

****************
cancel_retrieval
****************



.. py:method:: StorageGateway.Client.cancel_retrieval(**kwargs)

  

  Cancels retrieval of a virtual tape from the virtual tape shelf (VTS) to a gateway after the retrieval process is initiated. The virtual tape is returned to the VTS. This operation is only supported in the tape gateway type.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/storagegateway-2013-06-30/CancelRetrieval>`_  


  **Request Syntax**
  ::

    response = client.cancel_retrieval(
        GatewayARN='string',
        TapeARN='string'
    )
    
  :type GatewayARN: string
  :param GatewayARN: **[REQUIRED]** 

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

    

  
  :type TapeARN: string
  :param TapeARN: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the virtual tape you want to cancel retrieval for.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'TapeARN': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      CancelRetrievalOutput

      
      

      - **TapeARN** *(string) --* 

        The Amazon Resource Name (ARN) of the virtual tape for which retrieval was canceled.

        
  
  **Exceptions**
  
  *   :py:class:`StorageGateway.Client.exceptions.InvalidGatewayRequestException`

  
  *   :py:class:`StorageGateway.Client.exceptions.InternalServerError`

  

  **Examples**

  Cancels retrieval of a virtual tape from the virtual tape shelf (VTS) to a gateway after the retrieval process is initiated.
  ::

    response = client.cancel_retrieval(
        GatewayARN='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B',
        TapeARN='arn:aws:storagegateway:us-east-1:999999999999:tape/AMZN01A2A4',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'TapeARN': 'arn:aws:storagegateway:us-east-1:999999999999:tape/AMZN01A2A4',
        'ResponseMetadata': {
            '...': '...',
        },
    }

  