Modifies the following configuration parameters of the Network File System (NFS) transfer location that you're using with DataSync.
For more information, see Configuring transfers with an NFS file server.
Parameters:
-
location_arn
(LocationArn)
–
Specifies the Amazon Resource Name (ARN) of the NFS transfer location that you want to update.
-
subdirectory
(Optional[NfsSubdirectory], default:
None
)
–
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
(Optional[ServerHostname], default:
None
)
–
Specifies the DNS name or IP address (IPv4 or IPv6) of the NFS file server that your DataSync agent connects to.
Raises:
Source code in docs_src/capo_datasync/_services/data_sync.py
| def update_location_nfs(
self,
location_arn: "capo_datasync.types.location_arn.LocationArn",
*,
config_overrides: Optional[DataSyncClientConfig] = None,
subdirectory: Optional[
"capo_datasync.types.nfs_subdirectory.NfsSubdirectory"
] = None,
server_hostname: Optional[
"capo_datasync.types.server_hostname.ServerHostname"
] = None,
on_prem_config: Optional[
"capo_datasync.types.on_prem_config.OnPremConfig"
] = None,
mount_options: Optional[
"capo_datasync.types.nfs_mount_options.NfsMountOptions"
] = None,
) -> "capo_datasync.types.update_location_nfs_response.UpdateLocationNfsResponse":
"""<p>Modifies the following configuration parameters of the Network File System (NFS) transfer location that you're using with DataSync.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html">Configuring transfers with an NFS file server</a>.</p>
Args:
location_arn: <p>Specifies the Amazon Resource Name (ARN) of the NFS transfer location that you want to update.</p>
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>
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.
"""
def _handler(
req: "OperationRequest[capo_datasync.types.update_location_nfs_request.UpdateLocationNfsRequest]",
) -> OperationResponse[
"capo_datasync.types.update_location_nfs_response.UpdateLocationNfsResponse"
]:
if req.options.protocol == "awsJson1_1":
import capo_datasync._operations.fmrs_service.aws_json1_1.update_location_nfs
output, http_response = (
capo_datasync._operations.fmrs_service.aws_json1_1.update_location_nfs.update_location_nfs(
req.options, req.input
)
)
elif req.options.protocol == "rpcv2Cbor":
import capo_datasync._operations.fmrs_service.rpcv2_cbor.update_location_nfs
output, http_response = (
capo_datasync._operations.fmrs_service.rpcv2_cbor.update_location_nfs.update_location_nfs(
req.options, req.input
)
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateLocationNfs")
)
input_: capo_datasync.types.update_location_nfs_request.UpdateLocationNfsRequest = {
"location_arn": location_arn
}
if subdirectory is not None:
input_["subdirectory"] = subdirectory
if server_hostname is not None:
input_["server_hostname"] = server_hostname
if on_prem_config is not None:
input_["on_prem_config"] = on_prem_config
if mount_options is not None:
input_["mount_options"] = mount_options
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|