copySnapshotAndUpdateVolume method
Updates an existing volume by using a snapshot from another Amazon FSx for OpenZFS file system. For more information, see on-demand data replication in the Amazon FSx for OpenZFS User Guide.
May throw BadRequest.
May throw IncompatibleParameterError.
May throw InternalServerError.
May throw ServiceLimitExceeded.
Parameter volumeId :
Specifies the ID of the volume that you are copying the snapshot to.
Parameter copyStrategy :
Specifies the strategy to use when copying data from a snapshot to the
volume.
-
FULL_COPY- Copies all data from the snapshot to the volume. -
INCREMENTAL_COPY- Copies only the snapshot data that's changed since the previous replication.
Parameter options :
Confirms that you want to delete data on the destination volume that
wasn’t there during the previous snapshot replication.
Your replication will fail if you don’t include an option for a specific
type of data and that data is on your destination. For example, if you
don’t include DELETE_INTERMEDIATE_SNAPSHOTS and there are
intermediate snapshots on the destination, you can’t copy the snapshot.
-
DELETE_INTERMEDIATE_SNAPSHOTS- Deletes snapshots on the destination volume that aren’t on the source volume. -
DELETE_CLONED_VOLUMES- Deletes snapshot clones on the destination volume that aren't on the source volume. -
DELETE_INTERMEDIATE_DATA- Overwrites snapshots on the destination volume that don’t match the source snapshot that you’re copying.
Implementation
Future<CopySnapshotAndUpdateVolumeResponse> copySnapshotAndUpdateVolume({
required String sourceSnapshotARN,
required String volumeId,
String? clientRequestToken,
OpenZFSCopyStrategy? copyStrategy,
List<UpdateOpenZFSVolumeOption>? options,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSSimbaAPIService_v20180301.CopySnapshotAndUpdateVolume'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'SourceSnapshotARN': sourceSnapshotARN,
'VolumeId': volumeId,
'ClientRequestToken':
clientRequestToken ?? _s.generateIdempotencyToken(),
if (copyStrategy != null) 'CopyStrategy': copyStrategy.value,
if (options != null) 'Options': options.map((e) => e.value).toList(),
},
);
return CopySnapshotAndUpdateVolumeResponse.fromJson(jsonResponse.body);
}