createLocationFsxOpenZfs method

Future<CreateLocationFsxOpenZfsResponse> createLocationFsxOpenZfs({
  1. required String fsxFilesystemArn,
  2. required FsxProtocol protocol,
  3. required List<String> securityGroupArns,
  4. String? subdirectory,
  5. List<TagListEntry>? tags,
})

Creates a transfer location for an Amazon FSx for OpenZFS file system. DataSync can use this location as a source or destination for transferring data.

Before you begin, make sure that you understand how DataSync accesses FSx for OpenZFS file systems.

May throw InternalException. May throw InvalidRequestException.

Parameter fsxFilesystemArn : The Amazon Resource Name (ARN) of the FSx for OpenZFS file system.

Parameter protocol : The type of protocol that DataSync uses to access your file system.

Parameter securityGroupArns : The ARNs of the security groups that are used to configure the FSx for OpenZFS file system.

Parameter subdirectory : A subdirectory in the location's path that must begin with /fsx. DataSync uses this subdirectory to read or write data (depending on whether the file system is a source or destination location).

Parameter tags : The key-value pair that represents a tag that you want to add to the resource. The value can be an empty string. This value helps you manage, filter, and search for your resources. We recommend that you create a name tag for your location.

Implementation

Future<CreateLocationFsxOpenZfsResponse> createLocationFsxOpenZfs({
  required String fsxFilesystemArn,
  required FsxProtocol protocol,
  required List<String> securityGroupArns,
  String? subdirectory,
  List<TagListEntry>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'FmrsService.CreateLocationFsxOpenZfs'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FsxFilesystemArn': fsxFilesystemArn,
      'Protocol': protocol,
      'SecurityGroupArns': securityGroupArns,
      if (subdirectory != null) 'Subdirectory': subdirectory,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateLocationFsxOpenZfsResponse.fromJson(jsonResponse.body);
}