Skip to content

update_snapshot

update_snapshot(
    *,
    config_overrides: Optional[FSxClientConfig] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    name: Optional[SnapshotName] = None,
    snapshot_id: Optional[SnapshotId] = None,
    ontap_configuration: Optional[UpdateOntapSnapshotConfiguration] = None,
) -> UpdateSnapshotResponse

Updates an Amazon FSx for OpenZFS or Amazon FSx for NetApp ONTAP snapshot.

For Amazon FSx for OpenZFS snapshots, you can update only the name. For Amazon FSx for NetApp ONTAP snapshots, you can update the name and the properties in OntapConfiguration.

Parameters:

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.

  • SnapshotNotFound –

    No Amazon FSx snapshots 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/f_sx.py
def update_snapshot(
    self,
    *,
    config_overrides: Optional[FSxClientConfig] = None,
    client_request_token: Optional[
        "capo_fsx.types.client_request_token.ClientRequestToken"
    ] = None,
    name: Optional["capo_fsx.types.snapshot_name.SnapshotName"] = None,
    snapshot_id: Optional["capo_fsx.types.snapshot_id.SnapshotId"] = None,
    ontap_configuration: Optional[
        "capo_fsx.types.update_ontap_snapshot_configuration.UpdateOntapSnapshotConfiguration"
    ] = None,
) -> "capo_fsx.types.update_snapshot_response.UpdateSnapshotResponse":
    """<p>Updates an Amazon FSx for OpenZFS or Amazon FSx for NetApp ONTAP snapshot.</p> <p>For Amazon FSx for OpenZFS snapshots, you can update only the name. For Amazon FSx for NetApp ONTAP snapshots, you can update the name and the properties in <code>OntapConfiguration</code>.</p>

    Args:
        name: <p>The name of the snapshot to update.</p>
        snapshot_id: <p>The ID of the snapshot that you want to update, in the format <code>fsvolsnap-0123456789abcdef0</code>.</p>
        ontap_configuration: <p>The configuration of the ONTAP snapshot that you are updating.</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_not_found.SnapshotNotFound: <p>No Amazon FSx snapshots were found based on 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.update_snapshot_request.UpdateSnapshotRequest]",
    ) -> OperationResponse[
        "capo_fsx.types.update_snapshot_response.UpdateSnapshotResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.update_snapshot

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

    def _redact_output(
        output: "capo_fsx.types.update_snapshot_response.UpdateSnapshotResponse",
    ) -> dict[str, Any]:
        import capo_fsx.types.update_snapshot_response

        return capo_fsx.types.update_snapshot_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateSnapshot", redact_output=_redact_output),
    )
    input_: capo_fsx.types.update_snapshot_request.UpdateSnapshotRequest = {}
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if name is not None:
        input_["name"] = name
    if snapshot_id is not None:
        input_["snapshot_id"] = snapshot_id
    if ontap_configuration is not None:
        input_["ontap_configuration"] = ontap_configuration

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