Skip to content

create_location_nfs async

create_location_nfs(
    subdirectory: NfsSubdirectory,
    server_hostname: ServerHostname,
    on_prem_config: OnPremConfig,
    *,
    config_overrides: Optional[AsyncDataSyncClientConfig] = None,
    mount_options: Optional[NfsMountOptions] = None,
    tags: Optional[InputTagList] = None,
) -> CreateLocationNfsResponse

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.

Parameters:

  • subdirectory (NfsSubdirectory) –

    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.

  • server_hostname (ServerHostname) –

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

  • on_prem_config (OnPremConfig) –

    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.

  • mount_options (Optional[NfsMountOptions], default: None ) –

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

  • tags (Optional[InputTagList], default: None ) –

    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.

Raises:

Source code in docs_src/capo_datasync/_services/async_data_sync.py
async def create_location_nfs(
    self,
    subdirectory: "capo_datasync.types.nfs_subdirectory.NfsSubdirectory",
    server_hostname: "capo_datasync.types.server_hostname.ServerHostname",
    on_prem_config: "capo_datasync.types.on_prem_config.OnPremConfig",
    *,
    config_overrides: Optional[AsyncDataSyncClientConfig] = None,
    mount_options: Optional[
        "capo_datasync.types.nfs_mount_options.NfsMountOptions"
    ] = None,
    tags: Optional["capo_datasync.types.input_tag_list.InputTagList"] = None,
) -> "capo_datasync.types.create_location_nfs_response.CreateLocationNfsResponse":
    """<p>Creates a transfer <i>location</i> for a Network File System (NFS) file server. DataSync can use this location as a source or destination for transferring data.</p> <p>Before you begin, make sure that you understand how DataSync <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">accesses NFS file servers</a>.</p>

    Args:
        subdirectory: <p>Specifies the export path in your NFS file server that you want DataSync to mount.</p> <p>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 <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">Accessing NFS file servers</a>.</p>
        server_hostname: <p>Specifies the DNS name or IP address (IPv4 or IPv6) of the NFS file server that your DataSync agent connects to.</p>
        on_prem_config: <p>Specifies the Amazon Resource Name (ARN) of the DataSync agent that can connect to your NFS file server.</p> <p>You can specify more than one agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents">Using multiple DataSync agents</a>.</p>
        mount_options: <p>Specifies the options that DataSync can use to mount your NFS file server.</p>
        tags: <p>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.</p>

    Raises:
        capo_datasync.errors.internal_exception.InternalException: <p>This exception is thrown when an error occurs in the DataSync service.</p>
        capo_datasync.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_datasync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_datasync.types.create_location_nfs_request.CreateLocationNfsRequest]",
    ) -> AsyncOperationResponse[
        "capo_datasync.types.create_location_nfs_response.CreateLocationNfsResponse"
    ]:
        import capo_datasync._operations.fmrs_service.create_location_nfs

        (
            output,
            http_response,
        ) = await capo_datasync._operations.fmrs_service.create_location_nfs.async_create_location_nfs(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateLocationNfs")
    )
    input_: capo_datasync.types.create_location_nfs_request.CreateLocationNfsRequest = {
        "subdirectory": subdirectory,
        "server_hostname": server_hostname,
        "on_prem_config": on_prem_config,
    }
    if mount_options is not None:
        input_["mount_options"] = mount_options
    if tags is not None:
        input_["tags"] = tags

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