:doc:`CloudHSMV2 <../../cloudhsmv2>` / Client / restore_backup

**************
restore_backup
**************



.. py:method:: CloudHSMV2.Client.restore_backup(**kwargs)

  

  Restores a specified CloudHSM backup that is in the ``PENDING_DELETION`` state. For more information on deleting a backup, see  DeleteBackup.

   

  **Cross-account use:** No. You cannot perform this operation on an CloudHSM backup in a different Amazon Web Services account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/RestoreBackup>`_  


  **Request Syntax**
  ::

    response = client.restore_backup(
        BackupId='string'
    )
    
  :type BackupId: string
  :param BackupId: **[REQUIRED]** 

    The ID of the backup to be restored. To find the ID of a backup, use the  DescribeBackups operation.

    

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

    
    ::

      {
          'Backup': {
              'BackupId': 'string',
              'BackupArn': 'string',
              'BackupState': 'CREATE_IN_PROGRESS'|'READY'|'DELETED'|'PENDING_DELETION',
              'ClusterId': 'string',
              'CreateTimestamp': datetime(2015, 1, 1),
              'CopyTimestamp': datetime(2015, 1, 1),
              'NeverExpires': True|False,
              'SourceRegion': 'string',
              'SourceBackup': 'string',
              'SourceCluster': 'string',
              'DeleteTimestamp': datetime(2015, 1, 1),
              'TagList': [
                  {
                      'Key': 'string',
                      'Value': 'string'
                  },
              ],
              'HsmType': 'string',
              'Mode': 'FIPS'|'NON_FIPS'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Backup** *(dict) --* 

        Information on the ``Backup`` object created.

        
        

        - **BackupId** *(string) --* 

          The identifier (ID) of the backup.

          
        

        - **BackupArn** *(string) --* 

          The Amazon Resource Name (ARN) of the backup.

          
        

        - **BackupState** *(string) --* 

          The state of the backup.

          
        

        - **ClusterId** *(string) --* 

          The identifier (ID) of the cluster that was backed up.

          
        

        - **CreateTimestamp** *(datetime) --* 

          The date and time when the backup was created.

          
        

        - **CopyTimestamp** *(datetime) --* 

          The date and time when the backup was copied from a source backup.

          
        

        - **NeverExpires** *(boolean) --* 

          Specifies whether the service should exempt a backup from the retention policy for the cluster. ``True`` exempts a backup from the retention policy. ``False`` means the service applies the backup retention policy defined at the cluster.

          
        

        - **SourceRegion** *(string) --* 

          The AWS Region that contains the source backup from which the new backup was copied.

          
        

        - **SourceBackup** *(string) --* 

          The identifier (ID) of the source backup from which the new backup was copied.

          
        

        - **SourceCluster** *(string) --* 

          The identifier (ID) of the cluster containing the source backup from which the new backup was copied.

          
        

        - **DeleteTimestamp** *(datetime) --* 

          The date and time when the backup will be permanently deleted.

          
        

        - **TagList** *(list) --* 

          The list of tags for the backup.

          
          

          - *(dict) --* 

            Contains a tag. A tag is a key-value pair.

            
            

            - **Key** *(string) --* 

              The key of the tag.

              
            

            - **Value** *(string) --* 

              The value of the tag.

              
        
      
        

        - **HsmType** *(string) --* 

          The HSM type used to create the backup.

          
        

        - **Mode** *(string) --* 

          The mode of the cluster that was backed up.

          
    
  
  **Exceptions**
  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmAccessDeniedException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmInternalFailureException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmInvalidRequestException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmResourceNotFoundException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmServiceException`

  