deleteSnapshot method

Future<DeleteSnapshotResponse> deleteSnapshot({
  1. required String snapshotId,
  2. String? clientRequestToken,
})

Deletes an Amazon FSx for OpenZFS snapshot. After deletion, the snapshot no longer exists, and its data is gone. Deleting a snapshot doesn't affect snapshots stored in a file system backup.

The DeleteSnapshot operation returns instantly. The snapshot appears with the lifecycle status of DELETING until the deletion is complete.

May throw BadRequest. May throw InternalServerError. May throw SnapshotNotFound.

Parameter snapshotId : The ID of the snapshot that you want to delete.

Implementation

Future<DeleteSnapshotResponse> deleteSnapshot({
  required String snapshotId,
  String? clientRequestToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSSimbaAPIService_v20180301.DeleteSnapshot'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'SnapshotId': snapshotId,
      'ClientRequestToken':
          clientRequestToken ?? _s.generateIdempotencyToken(),
    },
  );

  return DeleteSnapshotResponse.fromJson(jsonResponse.body);
}