associateFileSystem method
Associate an Amazon FSx file system with the FSx File Gateway. After the association process is complete, the file shares on the Amazon FSx file system are available for access through the gateway. This operation only supports the FSx File Gateway type.
May throw InternalServerError.
May throw InvalidGatewayRequestException.
Parameter clientToken :
A unique string value that you supply that is used by the FSx File Gateway
to ensure idempotent file system association creation.
Parameter locationARN :
The Amazon Resource Name (ARN) of the Amazon FSx file system to associate
with the FSx File Gateway.
Parameter password :
The password of the user credential.
Parameter userName :
The user name of the user credential that has permission to access the
root share D$ of the Amazon FSx file system. The user account must belong
to the Amazon FSx delegated admin user group.
Parameter auditDestinationARN :
The Amazon Resource Name (ARN) of the storage used for the audit logs.
Parameter endpointNetworkConfiguration :
Specifies the network configuration information for the gateway associated
with the Amazon FSx file system.
Parameter tags :
A list of up to 50 tags that can be assigned to the file system
association. Each tag is a key-value pair.
Implementation
Future<AssociateFileSystemOutput> associateFileSystem({
required String clientToken,
required String gatewayARN,
required String locationARN,
required String password,
required String userName,
String? auditDestinationARN,
CacheAttributes? cacheAttributes,
EndpointNetworkConfiguration? endpointNetworkConfiguration,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'StorageGateway_20130630.AssociateFileSystem'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ClientToken': clientToken,
'GatewayARN': gatewayARN,
'LocationARN': locationARN,
'Password': password,
'UserName': userName,
if (auditDestinationARN != null)
'AuditDestinationARN': auditDestinationARN,
if (cacheAttributes != null) 'CacheAttributes': cacheAttributes,
if (endpointNetworkConfiguration != null)
'EndpointNetworkConfiguration': endpointNetworkConfiguration,
if (tags != null) 'Tags': tags,
},
);
return AssociateFileSystemOutput.fromJson(jsonResponse.body);
}