Skip to content

update_snapshot_policy async

update_snapshot_policy(
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    snapshot_policy_id: Optional[SnapshotPolicyId] = None,
    enabled: Optional[Flag] = None,
) -> UpdateSnapshotPolicyResponse

Updates an Amazon FSx for NetApp ONTAP snapshot policy. You can enable or disable the snapshot policy.

Parameters:

  • snapshot_policy_id (Optional[SnapshotPolicyId], default: None ) –

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

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

    Specifies whether the snapshot policy is enabled.

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.

  • SnapshotPolicyNotFound –

    No Amazon FSx snapshot 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_snapshot_policy(
    self,
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    client_request_token: Optional[
        "capo_fsx.types.client_request_token.ClientRequestToken"
    ] = None,
    snapshot_policy_id: Optional[
        "capo_fsx.types.snapshot_policy_id.SnapshotPolicyId"
    ] = None,
    enabled: Optional["capo_fsx.types.flag.Flag"] = None,
) -> "capo_fsx.types.update_snapshot_policy_response.UpdateSnapshotPolicyResponse":
    """<p>Updates an Amazon FSx for NetApp ONTAP snapshot policy. You can enable or disable the snapshot policy.</p>

    Args:
        snapshot_policy_id: <p>The ID of the snapshot policy that you want to update.</p>
        enabled: <p>Specifies whether the snapshot policy is enabled.</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.snapshot_policy_not_found.SnapshotPolicyNotFound: <p>No Amazon FSx snapshot 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_snapshot_policy_request.UpdateSnapshotPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_fsx.types.update_snapshot_policy_response.UpdateSnapshotPolicyResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.update_snapshot_policy

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSnapshotPolicy")
    )
    input_: capo_fsx.types.update_snapshot_policy_request.UpdateSnapshotPolicyRequest = {}
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if snapshot_policy_id is not None:
        input_["snapshot_policy_id"] = snapshot_policy_id
    if enabled is not None:
        input_["enabled"] = enabled

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