Skip to content

update_snapmirror_policy async

update_snapmirror_policy(
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    snapmirror_policy_id: Optional[SnapmirrorPolicyId] = None,
    retention_rules: Optional[SnapmirrorPolicyRetentionRules] = None,
    transfer_schedule: Optional[SnapmirrorTransferScheduleName] = None,
    network_compression_enabled: Optional[Flag] = None,
    throttle_in_kbps: Optional[ThrottleInKbps] = None,
) -> UpdateSnapmirrorPolicyResponse

Updates an Amazon FSx for NetApp ONTAP SnapMirror policy.

Parameters:

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

    The ID of the SnapMirror policy that you want to update.

  • retention_rules (Optional[SnapmirrorPolicyRetentionRules], default: None ) –

    Specifies the rules that determine which snapshots SnapMirror retains on the destination volume, based on their SnapMirror labels. The rules that you specify replace all the SnapMirror policy's existing retention rules. To keep an existing rule, include it in the list. To remove all retention rules, specify an empty list.

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

    Specifies the name of the ONTAP schedule that determines when SnapMirror transfers data. To remove the transfer schedule, specify an empty string.

  • network_compression_enabled (Optional[Flag], default: None ) –

    Specifies whether SnapMirror compresses data when it transfers the data over the network.

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

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

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.

  • SnapmirrorPolicyNotFound –

    No Amazon FSx SnapMirror policies were found based on the supplied parameters.

  • UnknownServiceError –

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

Source code in docs_src/capo_fsx/_services/async_f_sx.py
async def update_snapmirror_policy(
    self,
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    client_request_token: Optional[
        "capo_fsx.types.client_request_token.ClientRequestToken"
    ] = None,
    snapmirror_policy_id: Optional[
        "capo_fsx.types.snapmirror_policy_id.SnapmirrorPolicyId"
    ] = None,
    retention_rules: Optional[
        "capo_fsx.types.snapmirror_policy_retention_rules.SnapmirrorPolicyRetentionRules"
    ] = None,
    transfer_schedule: Optional[
        "capo_fsx.types.snapmirror_transfer_schedule_name.SnapmirrorTransferScheduleName"
    ] = None,
    network_compression_enabled: Optional["capo_fsx.types.flag.Flag"] = None,
    throttle_in_kbps: Optional[
        "capo_fsx.types.throttle_in_kbps.ThrottleInKbps"
    ] = None,
) -> "capo_fsx.types.update_snapmirror_policy_response.UpdateSnapmirrorPolicyResponse":
    """<p>Updates an Amazon FSx for NetApp ONTAP SnapMirror policy.</p>

    Args:
        snapmirror_policy_id: <p>The ID of the SnapMirror policy that you want to update.</p>
        retention_rules: <p>Specifies the rules that determine which snapshots SnapMirror retains on the destination volume, based on their SnapMirror labels. The rules that you specify replace all the SnapMirror policy's existing retention rules. To keep an existing rule, include it in the list. To remove all retention rules, specify an empty list.</p>
        transfer_schedule: <p>Specifies the name of the ONTAP schedule that determines when SnapMirror transfers data. To remove the transfer schedule, specify an empty string.</p>
        network_compression_enabled: <p>Specifies whether SnapMirror compresses data when it transfers the data over the network.</p>
        throttle_in_kbps: <p>Specifies the maximum bandwidth, in kilobytes per second (KBps), that SnapMirror uses to transfer data. A value of <code>0</code> means that the bandwidth is unlimited.</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.snapmirror_policy_not_found.SnapmirrorPolicyNotFound: <p>No Amazon FSx SnapMirror policies were found based on the supplied parameters.</p>
        capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_fsx.types.update_snapmirror_policy_request.UpdateSnapmirrorPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_fsx.types.update_snapmirror_policy_response.UpdateSnapmirrorPolicyResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.update_snapmirror_policy

        (
            output,
            http_response,
        ) = await capo_fsx._operations.aws_simba_api_service_v20180301.update_snapmirror_policy.async_update_snapmirror_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSnapmirrorPolicy")
    )
    input_: capo_fsx.types.update_snapmirror_policy_request.UpdateSnapmirrorPolicyRequest = {}
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if snapmirror_policy_id is not None:
        input_["snapmirror_policy_id"] = snapmirror_policy_id
    if retention_rules is not None:
        input_["retention_rules"] = retention_rules
    if transfer_schedule is not None:
        input_["transfer_schedule"] = transfer_schedule
    if network_compression_enabled is not None:
        input_["network_compression_enabled"] = network_compression_enabled
    if throttle_in_kbps is not None:
        input_["throttle_in_kbps"] = throttle_in_kbps

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output