updateFileSystem method

Future<UpdateFileSystemResponse> updateFileSystem({
  1. required String fileSystemId,
  2. String? clientRequestToken,
  3. UpdateFileSystemLustreConfiguration? lustreConfiguration,
  4. int? storageCapacity,
  5. UpdateFileSystemWindowsConfiguration? windowsConfiguration,
})

Use this operation to update the configuration of an existing Amazon FSx file system. You can update multiple properties in a single request.

For Amazon FSx for Windows File Server file systems, you can update the following properties:

  • AutomaticBackupRetentionDays
  • DailyAutomaticBackupStartTime
  • SelfManagedActiveDirectoryConfiguration
  • StorageCapacity
  • ThroughputCapacity
  • WeeklyMaintenanceStartTime
For Amazon FSx for Lustre file systems, you can update the following properties:
  • AutoImportPolicy
  • AutomaticBackupRetentionDays
  • DailyAutomaticBackupStartTime
  • StorageCapacity
  • WeeklyMaintenanceStartTime

May throw BadRequest. May throw UnsupportedOperation. May throw IncompatibleParameterError. May throw InternalServerError. May throw FileSystemNotFound. May throw MissingFileSystemConfiguration. May throw ServiceLimitExceeded.

Parameter fileSystemId : Identifies the file system that you are updating.

Parameter clientRequestToken : A string of up to 64 ASCII characters that Amazon FSx uses to ensure idempotent updates. This string is automatically filled on your behalf when you use the AWS Command Line Interface (AWS CLI) or an AWS SDK.

Parameter storageCapacity : Use this parameter to increase the storage capacity of an Amazon FSx file system. Specifies the storage capacity target value, GiB, to increase the storage capacity for the file system that you're updating. You cannot make a storage capacity increase request if there is an existing storage capacity increase request in progress.

For Windows file systems, the storage capacity target value must be at least 10 percent (%) greater than the current storage capacity value. In order to increase storage capacity, the file system must have at least 16 MB/s of throughput capacity.

For Lustre file systems, the storage capacity target value can be the following:

  • For SCRATCH_2 and PERSISTENT_1 SSD deployment types, valid values are in multiples of 2400 GiB. The value must be greater than the current storage capacity.
  • For PERSISTENT HDD file systems, valid values are multiples of 6000 GiB for 12 MB/s/TiB file systems and multiples of 1800 GiB for 40 MB/s/TiB file systems. The values must be greater than the current storage capacity.
  • For SCRATCH_1 file systems, you cannot increase the storage capacity.
For more information, see Managing storage capacity in the Amazon FSx for Windows File Server User Guide and Managing storage and throughput capacity in the Amazon FSx for Lustre User Guide.

Parameter windowsConfiguration : The configuration updates for an Amazon FSx for Windows File Server file system.

Implementation

Future<UpdateFileSystemResponse> updateFileSystem({
  required String fileSystemId,
  String? clientRequestToken,
  UpdateFileSystemLustreConfiguration? lustreConfiguration,
  int? storageCapacity,
  UpdateFileSystemWindowsConfiguration? windowsConfiguration,
}) async {
  ArgumentError.checkNotNull(fileSystemId, 'fileSystemId');
  _s.validateStringLength(
    'fileSystemId',
    fileSystemId,
    11,
    21,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientRequestToken',
    clientRequestToken,
    1,
    63,
  );
  _s.validateNumRange(
    'storageCapacity',
    storageCapacity,
    0,
    2147483647,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSSimbaAPIService_v20180301.UpdateFileSystem'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FileSystemId': fileSystemId,
      'ClientRequestToken':
          clientRequestToken ?? _s.generateIdempotencyToken(),
      if (lustreConfiguration != null)
        'LustreConfiguration': lustreConfiguration,
      if (storageCapacity != null) 'StorageCapacity': storageCapacity,
      if (windowsConfiguration != null)
        'WindowsConfiguration': windowsConfiguration,
    },
  );

  return UpdateFileSystemResponse.fromJson(jsonResponse.body);
}