:doc:`Transfer <../../transfer>` / Client / import_host_key

***************
import_host_key
***************



.. py:method:: Transfer.Client.import_host_key(**kwargs)

  

  Adds a host key to the server that's specified by the ``ServerId`` parameter.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/ImportHostKey>`_  


  **Request Syntax**
  ::

    response = client.import_host_key(
        ServerId='string',
        HostKeyBody='string',
        Description='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ServerId: string
  :param ServerId: **[REQUIRED]** 

    The identifier of the server that contains the host key that you are importing.

    

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

    The private key portion of an SSH key pair.

     

    Transfer Family accepts RSA, ECDSA, and ED25519 keys.

    

  
  :type Description: string
  :param Description: 

    The text description that identifies this host key.

    

  
  :type Tags: list
  :param Tags: 

    Key-value pairs that can be used to group and search for host keys.

    

  
    - *(dict) --* 

      Creates a key-value pair for a specific resource. Tags are metadata that you can use to search for and group a resource for various purposes. You can apply tags to servers, users, and roles. A tag key can take more than one value. For example, to group servers for accounting purposes, you might create a tag called ``Group`` and assign the values ``Research`` and ``Accounting`` to that group.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The name assigned to the tag that you create.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

        Contains one or more values that you assigned to the key name you create.

        

      
    

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

    
    ::

      {
          'ServerId': 'string',
          'HostKeyId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ServerId** *(string) --* 

        Returns the server identifier that contains the imported key.

        
      

      - **HostKeyId** *(string) --* 

        Returns the host key identifier for the imported key.

        
  
  **Exceptions**
  
  *   :py:class:`Transfer.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Transfer.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`Transfer.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Transfer.Client.exceptions.InternalServiceError`

  
  *   :py:class:`Transfer.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`Transfer.Client.exceptions.ResourceExistsException`

  