Skip to content

create_location_fsx_ontap

create_location_fsx_ontap(
    protocol: FsxProtocol,
    security_group_arns: Ec2SecurityGroupArnList,
    storage_virtual_machine_arn: StorageVirtualMachineArn,
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
    subdirectory: Optional[FsxOntapSubdirectory] = None,
    tags: Optional[InputTagList] = None,
) -> CreateLocationFsxOntapResponse

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.

Parameters:

  • security_group_arns (Ec2SecurityGroupArnList) –

    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.

  • storage_virtual_machine_arn (StorageVirtualMachineArn) –

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

  • subdirectory (Optional[FsxOntapSubdirectory], default: None ) –

    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.

    Don't specify a junction path in the SVM's root volume. For more information, see Managing FSx for ONTAP storage virtual machines in the Amazon FSx for NetApp ONTAP User Guide.

  • tags (Optional[InputTagList], default: None ) –

    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.

Raises:

Source code in docs_src/capo_datasync/_services/data_sync.py
def create_location_fsx_ontap(
    self,
    protocol: "capo_datasync.types.fsx_protocol.FsxProtocol",
    security_group_arns: "capo_datasync.types.ec2_security_group_arn_list.Ec2SecurityGroupArnList",
    storage_virtual_machine_arn: "capo_datasync.types.storage_virtual_machine_arn.StorageVirtualMachineArn",
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
    subdirectory: Optional[
        "capo_datasync.types.fsx_ontap_subdirectory.FsxOntapSubdirectory"
    ] = None,
    tags: Optional["capo_datasync.types.input_tag_list.InputTagList"] = None,
) -> "capo_datasync.types.create_location_fsx_ontap_response.CreateLocationFsxOntapResponse":
    """<p>Creates a transfer <i>location</i> for an Amazon FSx for NetApp ONTAP file system. DataSync can use this location as a source or destination for transferring data.</p> <p>Before you begin, make sure that you understand how DataSync <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-ontap-location.html#create-ontap-location-access">accesses FSx for ONTAP file systems</a>.</p>

    Args:
        security_group_arns: <p>Specifies the Amazon EC2 security groups that provide access to your file system's preferred subnet.</p> <p>The security groups must allow outbound traffic on the following ports (depending on the protocol you use):</p> <ul> <li> <p> <b>Network File System (NFS)</b>: TCP ports 111, 635, and 2049</p> </li> <li> <p> <b>Server Message Block (SMB)</b>: TCP port 445</p> </li> </ul> <p>Your file system's security groups must also allow inbound traffic on the same ports.</p>
        storage_virtual_machine_arn: <p>Specifies the ARN of the storage virtual machine (SVM) in your file system where you want to copy data to or from.</p>
        subdirectory: <p>Specifies a path to the file share in the SVM where you want to transfer data to or from.</p> <p>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 <code>/vol1</code>, <code>/vol1/tree1</code>, or <code>/share1</code>.</p> <note> <p>Don't specify a junction path in the SVM's root volume. For more information, see <a href="https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/managing-svms.html">Managing FSx for ONTAP storage virtual machines</a> in the <i>Amazon FSx for NetApp ONTAP User Guide</i>.</p> </note>
        tags: <p>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.</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.create_location_fsx_ontap_request.CreateLocationFsxOntapRequest]",
    ) -> OperationResponse[
        "capo_datasync.types.create_location_fsx_ontap_response.CreateLocationFsxOntapResponse"
    ]:
        import capo_datasync._operations.fmrs_service.create_location_fsx_ontap

        output, http_response = (
            capo_datasync._operations.fmrs_service.create_location_fsx_ontap.create_location_fsx_ontap(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_datasync.types.create_location_fsx_ontap_request.CreateLocationFsxOntapRequest",
    ) -> dict[str, Any]:
        import capo_datasync.types.create_location_fsx_ontap_request

        return (
            capo_datasync.types.create_location_fsx_ontap_request.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateLocationFsxOntap", redact_input=_redact_input),
    )
    input_: capo_datasync.types.create_location_fsx_ontap_request.CreateLocationFsxOntapRequest = {
        "protocol": protocol,
        "security_group_arns": security_group_arns,
        "storage_virtual_machine_arn": storage_virtual_machine_arn,
    }
    if subdirectory is not None:
        input_["subdirectory"] = subdirectory
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output