Skip to content

create_snapmirror_relationship

create_snapmirror_relationship(
    *,
    config_overrides: Optional[FSxClientConfig] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    source: Optional[CreateSnapmirrorSource] = None,
    destination: Optional[CreateSnapmirrorDestination] = None,
    policy_id: Optional[SnapmirrorPolicyId] = None,
    transfer_schedule: Optional[SnapmirrorTransferScheduleName] = None,
    throttle_in_kbps: Optional[ThrottleInKbps] = None,
    tags: Optional[Tags] = None,
) -> CreateSnapmirrorRelationshipResponse

Creates a SnapMirror relationship that replicates data from a source volume to a destination volume on an Amazon FSx for NetApp ONTAP file system.

The CreateSnapmirrorRelationship operation returns while the SnapMirror relationship's lifecycle state is still CREATING. You can check the SnapMirror relationship creation status by calling the DescribeSnapmirrorRelationships operation.

Parameters:

  • source (Optional[CreateSnapmirrorSource], default: None ) –

    Specifies the source endpoint of the SnapMirror relationship.

  • destination (Optional[CreateSnapmirrorDestination], default: None ) –

    Specifies the destination endpoint of the SnapMirror relationship.

  • policy_id (Optional[SnapmirrorPolicyId], default: None ) –

    Specifies the ID of the SnapMirror policy that the SnapMirror relationship uses.

  • transfer_schedule (Optional[SnapmirrorTransferScheduleName], default: None ) –

    Specifies the name of the ONTAP schedule that determines when SnapMirror transfers data for the relationship. This schedule overrides the transfer schedule of the SnapMirror policy.

  • throttle_in_kbps (Optional[ThrottleInKbps], default: None ) –

    Specifies the maximum bandwidth, in kilobytes per second (KBps), that SnapMirror uses to transfer data for the relationship. A value of 0 means that the bandwidth is unlimited. This value overrides the throttle of the SnapMirror policy.

Raises:

  • BadRequest –

    A generic error indicating a failure with a client request.

  • IncompatibleParameterError –

    The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.

  • InternalServerError –

    A generic error indicating a server-side failure.

  • ServiceLimitExceeded –

    An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.

  • UnsupportedOperation –

    The requested operation is not supported for this resource or API.

  • VolumeNotFound –

    No Amazon FSx volumes were found based upon the supplied parameters.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_fsx/_services/f_sx.py
def create_snapmirror_relationship(
    self,
    *,
    config_overrides: Optional[FSxClientConfig] = None,
    client_request_token: Optional[
        "capo_fsx.types.client_request_token.ClientRequestToken"
    ] = None,
    source: Optional[
        "capo_fsx.types.create_snapmirror_source.CreateSnapmirrorSource"
    ] = None,
    destination: Optional[
        "capo_fsx.types.create_snapmirror_destination.CreateSnapmirrorDestination"
    ] = None,
    policy_id: Optional[
        "capo_fsx.types.snapmirror_policy_id.SnapmirrorPolicyId"
    ] = None,
    transfer_schedule: Optional[
        "capo_fsx.types.snapmirror_transfer_schedule_name.SnapmirrorTransferScheduleName"
    ] = None,
    throttle_in_kbps: Optional[
        "capo_fsx.types.throttle_in_kbps.ThrottleInKbps"
    ] = None,
    tags: Optional["capo_fsx.types.tags.Tags"] = None,
) -> "capo_fsx.types.create_snapmirror_relationship_response.CreateSnapmirrorRelationshipResponse":
    """<p>Creates a SnapMirror relationship that replicates data from a source volume to a destination volume on an Amazon FSx for NetApp ONTAP file system.</p> <p>The <code>CreateSnapmirrorRelationship</code> operation returns while the SnapMirror relationship's lifecycle state is still <code>CREATING</code>. You can check the SnapMirror relationship creation status by calling the DescribeSnapmirrorRelationships operation.</p>

    Args:
        source: <p>Specifies the source endpoint of the SnapMirror relationship.</p>
        destination: <p>Specifies the destination endpoint of the SnapMirror relationship.</p>
        policy_id: <p>Specifies the ID of the SnapMirror policy that the SnapMirror relationship uses.</p>
        transfer_schedule: <p>Specifies the name of the ONTAP schedule that determines when SnapMirror transfers data for the relationship. This schedule overrides the transfer schedule of the SnapMirror policy.</p>
        throttle_in_kbps: <p>Specifies the maximum bandwidth, in kilobytes per second (KBps), that SnapMirror uses to transfer data for the relationship. A value of <code>0</code> means that the bandwidth is unlimited. This value overrides the throttle of the SnapMirror policy.</p>

    Raises:
        capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
        capo_fsx.errors.incompatible_parameter_error.IncompatibleParameterError: <p>The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.</p>
        capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</p>
        capo_fsx.errors.service_limit_exceeded.ServiceLimitExceeded: <p>An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.</p>
        capo_fsx.errors.unsupported_operation.UnsupportedOperation: <p>The requested operation is not supported for this resource or API.</p>
        capo_fsx.errors.volume_not_found.VolumeNotFound: <p>No Amazon FSx volumes were found based upon the supplied parameters.</p>
        capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_fsx.types.create_snapmirror_relationship_request.CreateSnapmirrorRelationshipRequest]",
    ) -> OperationResponse[
        "capo_fsx.types.create_snapmirror_relationship_response.CreateSnapmirrorRelationshipResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.create_snapmirror_relationship

        output, http_response = (
            capo_fsx._operations.aws_simba_api_service_v20180301.create_snapmirror_relationship.create_snapmirror_relationship(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSnapmirrorRelationship")
    )
    input_: capo_fsx.types.create_snapmirror_relationship_request.CreateSnapmirrorRelationshipRequest = {}
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if source is not None:
        input_["source"] = source
    if destination is not None:
        input_["destination"] = destination
    if policy_id is not None:
        input_["policy_id"] = policy_id
    if transfer_schedule is not None:
        input_["transfer_schedule"] = transfer_schedule
    if throttle_in_kbps is not None:
        input_["throttle_in_kbps"] = throttle_in_kbps
    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