:doc:`DataSync <../../datasync>` / Client / create_location_nfs

*******************
create_location_nfs
*******************



.. py:method:: DataSync.Client.create_location_nfs(**kwargs)

  

  Creates a transfer *location* for a Network File System (NFS) file server. DataSync can use this location as a source or destination for transferring data.

   

  Before you begin, make sure that you understand how DataSync `accesses NFS file servers <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationNfs>`_  


  **Request Syntax**
  ::

    response = client.create_location_nfs(
        Subdirectory='string',
        ServerHostname='string',
        OnPremConfig={
            'AgentArns': [
                'string',
            ]
        },
        MountOptions={
            'Version': 'AUTOMATIC'|'NFS3'|'NFS4_0'|'NFS4_1'
        },
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type Subdirectory: string
  :param Subdirectory: **[REQUIRED]** 

    Specifies the export path in your NFS file server that you want DataSync to mount.

     

    This path (or a subdirectory of the path) is where DataSync transfers data to or from. For information on configuring an export for DataSync, see `Accessing NFS file servers <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs>`__.

    

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

    Specifies the DNS name or IP address (IPv4 or IPv6) of the NFS file server that your DataSync agent connects to.

    

  
  :type OnPremConfig: dict
  :param OnPremConfig: **[REQUIRED]** 

    Specifies the Amazon Resource Name (ARN) of the DataSync agent that can connect to your NFS file server.

     

    You can specify more than one agent. For more information, see `Using multiple DataSync agents <https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents>`__.

    

  
    - **AgentArns** *(list) --* **[REQUIRED]** 

      The Amazon Resource Names (ARNs) of the DataSync agents that can connect to your NFS file server.

       

      You can specify more than one agent. For more information, see `Using multiple DataSync agents <https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents>`__.

      

    
      - *(string) --* 

      
  
  
  :type MountOptions: dict
  :param MountOptions: 

    Specifies the options that DataSync can use to mount your NFS file server.

    

  
    - **Version** *(string) --* 

      Specifies the NFS version that you want DataSync to use when mounting your NFS share. If the server refuses to use the version specified, the task fails.

       

      You can specify the following options:

       

      
      * ``AUTOMATIC`` (default): DataSync chooses NFS version 4.1.
       
      * ``NFS3``: Stateless protocol version that allows for asynchronous writes on the server.
       
      * ``NFSv4_0``: Stateful, firewall-friendly protocol version that supports delegations and pseudo file systems.
       
      * ``NFSv4_1``: Stateful protocol version that supports sessions, directory delegations, and parallel data processing. NFS version 4.1 also includes all features available in version 4.0.
      

       

      .. note::

        

        DataSync currently only supports NFS version 3 with Amazon FSx for NetApp ONTAP locations.

        

      

    
  
  :type Tags: list
  :param Tags: 

    Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least a name tag for your location.

    

  
    - *(dict) --* 

      A key-value pair representing a single tag that's been applied to an Amazon Web Services resource.

      

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

        The key for an Amazon Web Services resource tag.

        

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

        The value for an Amazon Web Services resource tag.

        

      
    

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

    
    ::

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

    

    - *(dict) --* 

      CreateLocationNfsResponse

      
      

      - **LocationArn** *(string) --* 

        The ARN of the transfer location that you created for your NFS file server.

        
  
  **Exceptions**
  
  *   :py:class:`DataSync.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`DataSync.Client.exceptions.InternalException`

  