deleteVolume method

Future<DeleteVolumeResponse> deleteVolume({
  1. required String volumeId,
  2. String? clientRequestToken,
  3. DeleteVolumeOntapConfiguration? ontapConfiguration,
  4. DeleteVolumeOpenZFSConfiguration? openZFSConfiguration,
})

Deletes an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume.

May throw BadRequest. May throw IncompatibleParameterError. May throw InternalServerError. May throw ServiceLimitExceeded. May throw VolumeNotFound.

Parameter volumeId : The ID of the volume that you are deleting.

Parameter ontapConfiguration : For Amazon FSx for ONTAP volumes, specify whether to take a final backup of the volume and apply tags to the backup. To apply tags to the backup, you must have the fsx:TagResource permission.

Parameter openZFSConfiguration : For Amazon FSx for OpenZFS volumes, specify whether to delete all child volumes and snapshots.

Implementation

Future<DeleteVolumeResponse> deleteVolume({
  required String volumeId,
  String? clientRequestToken,
  DeleteVolumeOntapConfiguration? ontapConfiguration,
  DeleteVolumeOpenZFSConfiguration? openZFSConfiguration,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSSimbaAPIService_v20180301.DeleteVolume'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'VolumeId': volumeId,
      'ClientRequestToken':
          clientRequestToken ?? _s.generateIdempotencyToken(),
      if (ontapConfiguration != null)
        'OntapConfiguration': ontapConfiguration,
      if (openZFSConfiguration != null)
        'OpenZFSConfiguration': openZFSConfiguration,
    },
  );

  return DeleteVolumeResponse.fromJson(jsonResponse.body);
}