createLocationSmb method
- required List<
String> agentArns, - required String password,
- required String serverHostname,
- required String subdirectory,
- required String user,
- String? domain,
- SmbMountOptions? mountOptions,
- List<
TagListEntry> ? tags,
Defines a file system on a Server Message Block (SMB) server that can be read from or written to.
May throw InvalidRequestException. May throw InternalException.
Parameter agentArns
:
The Amazon Resource Names (ARNs) of agents to use for a Simple Message
Block (SMB) location.
Parameter password
:
The password of the user who can mount the share, has the permissions to
access files and folders in the SMB share.
Parameter serverHostname
:
The name of the SMB server. This value is the IP address or Domain Name
Service (DNS) name of the SMB server. An agent that is installed
on-premises uses this hostname to mount the SMB server in a network.
Parameter subdirectory
:
The subdirectory in the SMB file system that is used to read data from the
SMB source location or write data to the SMB destination. The SMB path
should be a path that's exported by the SMB server, or a subdirectory of
that path. The path should be such that it can be mounted by other SMB
clients in your network.
To transfer all the data in the folder you specified, DataSync needs to
have permissions to mount the SMB share, as well as to access all the data
in that share. To ensure this, either ensure that the user/password
specified belongs to the user who can mount the share, and who has the
appropriate permissions for all of the files and directories that you want
DataSync to access, or use credentials of a member of the Backup Operators
group to mount the share. Doing either enables the agent to access the
data. For the agent to access directories, you must additionally enable
all execute access.
Parameter user
:
The user who can mount the share, has the permissions to access files and
folders in the SMB share.
Parameter domain
:
The name of the Windows domain that the SMB server belongs to.
Parameter mountOptions
:
The mount options used by DataSync to access the SMB server.
Parameter tags
:
The key-value pair that represents the tag that you want to add to the
location. The value can be an empty string. We recommend using tags to
name your resources.
Implementation
Future<CreateLocationSmbResponse> createLocationSmb({
required List<String> agentArns,
required String password,
required String serverHostname,
required String subdirectory,
required String user,
String? domain,
SmbMountOptions? mountOptions,
List<TagListEntry>? tags,
}) async {
ArgumentError.checkNotNull(agentArns, 'agentArns');
ArgumentError.checkNotNull(password, 'password');
_s.validateStringLength(
'password',
password,
0,
104,
isRequired: true,
);
ArgumentError.checkNotNull(serverHostname, 'serverHostname');
_s.validateStringLength(
'serverHostname',
serverHostname,
0,
255,
isRequired: true,
);
ArgumentError.checkNotNull(subdirectory, 'subdirectory');
_s.validateStringLength(
'subdirectory',
subdirectory,
0,
4096,
isRequired: true,
);
ArgumentError.checkNotNull(user, 'user');
_s.validateStringLength(
'user',
user,
0,
104,
isRequired: true,
);
_s.validateStringLength(
'domain',
domain,
0,
253,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'FmrsService.CreateLocationSmb'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AgentArns': agentArns,
'Password': password,
'ServerHostname': serverHostname,
'Subdirectory': subdirectory,
'User': user,
if (domain != null) 'Domain': domain,
if (mountOptions != null) 'MountOptions': mountOptions,
if (tags != null) 'Tags': tags,
},
);
return CreateLocationSmbResponse.fromJson(jsonResponse.body);
}