restoreFromSnapshot method
Restores a directory using an existing directory snapshot.
When you restore a directory from a snapshot, any changes made to the directory after the snapshot date are overwritten.
This action returns as soon as the restore operation is initiated. You can
monitor the progress of the restore operation by calling the
DescribeDirectories operation with the directory identifier. When
the DirectoryDescription.Stage value changes to
Active
, the restore operation is complete.
May throw EntityDoesNotExistException. May throw InvalidParameterException. May throw ClientException. May throw ServiceException.
Parameter snapshotId
:
The identifier of the snapshot to restore from.
Implementation
Future<void> restoreFromSnapshot({
required String snapshotId,
}) async {
ArgumentError.checkNotNull(snapshotId, 'snapshotId');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'DirectoryService_20150416.RestoreFromSnapshot'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'SnapshotId': snapshotId,
},
);
}