createLocationFsxOntap method

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

Creates a transfer location for an Amazon FSx for NetApp ONTAP 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 ONTAP file systems.

May throw InternalException. May throw InvalidRequestException.

Parameter securityGroupArns : Specifies the Amazon EC2 security groups that provide access to your file system's preferred subnet.

The security groups must allow outbound traffic on the following ports (depending on the protocol you use):

  • Network File System (NFS): TCP ports 111, 635, and 2049
  • Server Message Block (SMB): TCP port 445
Your file system's security groups must also allow inbound traffic on the same ports.

Parameter storageVirtualMachineArn : Specifies the ARN of the storage virtual machine (SVM) in your file system where you want to copy data to or from.

Parameter subdirectory : Specifies a path to the file share in the SVM where you want to transfer data to or from.

You can specify a junction path (also known as a mount point), qtree path (for NFS file shares), or share name (for SMB file shares). For example, your mount path might be /vol1, /vol1/tree1, or /share1.

Parameter tags : 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.

Implementation

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

  return CreateLocationFsxOntapResponse.fromJson(jsonResponse.body);
}