deleteVolume method

Future<DeleteVolumeOutput> deleteVolume({
  1. required String volumeARN,
})

Deletes the specified storage volume that you previously created using the CreateCachediSCSIVolume or CreateStorediSCSIVolume API. This operation is only supported in the cached volume and stored volume types. For stored volume gateways, the local disk that was configured as the storage volume is not deleted. You can reuse the local disk to create another storage volume.

Before you delete a volume, make sure there are no iSCSI connections to the volume you are deleting. You should also make sure there is no snapshot in progress. You can use the Amazon Elastic Compute Cloud (Amazon EC2) API to query snapshots on the volume you are deleting and check the snapshot status. For more information, go to DescribeSnapshots in the Amazon Elastic Compute Cloud API Reference.

In the request, you must provide the Amazon Resource Name (ARN) of the storage volume you want to delete.

May throw InvalidGatewayRequestException. May throw InternalServerError.

Parameter volumeARN : The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to return a list of gateway volumes.

Implementation

Future<DeleteVolumeOutput> deleteVolume({
  required String volumeARN,
}) async {
  ArgumentError.checkNotNull(volumeARN, 'volumeARN');
  _s.validateStringLength(
    'volumeARN',
    volumeARN,
    50,
    500,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StorageGateway_20130630.DeleteVolume'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'VolumeARN': volumeARN,
    },
  );

  return DeleteVolumeOutput.fromJson(jsonResponse.body);
}