addWorkingStorage method
Configures one or more gateway local disks as working storage for a gateway. This operation is only supported in the stored volume gateway type. This operation is deprecated in cached volume API version 20120630. Use AddUploadBuffer instead. In the request, you specify the gateway Amazon Resource Name (ARN) to which you want to add working storage, and one or more disk IDs that you want to configure as working storage.
May throw InvalidGatewayRequestException. May throw InternalServerError.
Parameter diskIds
:
An array of strings that identify disks that are to be configured as
working storage. Each string has a minimum length of 1 and maximum length
of 300. You can get the disk IDs from the ListLocalDisks API.
Implementation
Future<AddWorkingStorageOutput> addWorkingStorage({
required List<String> diskIds,
required String gatewayARN,
}) async {
ArgumentError.checkNotNull(diskIds, 'diskIds');
ArgumentError.checkNotNull(gatewayARN, 'gatewayARN');
_s.validateStringLength(
'gatewayARN',
gatewayARN,
50,
500,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'StorageGateway_20130630.AddWorkingStorage'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DiskIds': diskIds,
'GatewayARN': gatewayARN,
},
);
return AddWorkingStorageOutput.fromJson(jsonResponse.body);
}