updateNumberOfDomainControllers method

Future<void> updateNumberOfDomainControllers({
  1. required int desiredNumber,
  2. required String directoryId,
})

Adds or removes domain controllers to or from the directory. Based on the difference between current value and new value (provided through this API call), domain controllers will be added or removed. It may take up to 45 minutes for any new domain controllers to become fully active once the requested number of domain controllers is updated. During this time, you cannot make another update request.

May throw EntityDoesNotExistException. May throw DirectoryUnavailableException. May throw DomainControllerLimitExceededException. May throw InvalidParameterException. May throw UnsupportedOperationException. May throw ClientException. May throw ServiceException.

Parameter desiredNumber : The number of domain controllers desired in the directory.

Parameter directoryId : Identifier of the directory to which the domain controllers will be added or removed.

Implementation

Future<void> updateNumberOfDomainControllers({
  required int desiredNumber,
  required String directoryId,
}) async {
  ArgumentError.checkNotNull(desiredNumber, 'desiredNumber');
  _s.validateNumRange(
    'desiredNumber',
    desiredNumber,
    2,
    1152921504606846976,
    isRequired: true,
  );
  ArgumentError.checkNotNull(directoryId, 'directoryId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'DirectoryService_20150416.UpdateNumberOfDomainControllers'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DesiredNumber': desiredNumber,
      'DirectoryId': directoryId,
    },
  );
}