addUploadBuffer method

Future<AddUploadBufferOutput> addUploadBuffer({
  1. required List<String> diskIds,
  2. required String gatewayARN,
})

Configures one or more gateway local disks as upload buffer for a specified gateway. This operation is supported for the stored volume, cached volume and tape gateway types.

In the request, you specify the gateway Amazon Resource Name (ARN) to which you want to add upload buffer, and one or more disk IDs that you want to configure as upload buffer.

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<AddUploadBufferOutput> addUploadBuffer({
  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.AddUploadBuffer'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DiskIds': diskIds,
      'GatewayARN': gatewayARN,
    },
  );

  return AddUploadBufferOutput.fromJson(jsonResponse.body);
}