upgradeDomain method

Future<UpgradeDomainResponse> upgradeDomain({
  1. required String domainName,
  2. required String targetVersion,
  3. Map<String, String>? advancedOptions,
  4. bool? performCheckOnly,
})

Allows you to either upgrade your domain or perform an upgrade eligibility check to a compatible version of OpenSearch or Elasticsearch.

May throw BaseException. May throw ResourceNotFoundException. May throw ResourceAlreadyExistsException. May throw DisabledOperationException. May throw ValidationException. May throw InternalException.

Parameter targetVersion : The version of OpenSearch you intend to upgrade the domain to.

Parameter performCheckOnly : When true, indicates that an upgrade eligibility check needs to be performed. Does not actually perform the upgrade.

Implementation

Future<UpgradeDomainResponse> upgradeDomain({
  required String domainName,
  required String targetVersion,
  Map<String, String>? advancedOptions,
  bool? performCheckOnly,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    3,
    28,
    isRequired: true,
  );
  ArgumentError.checkNotNull(targetVersion, 'targetVersion');
  _s.validateStringLength(
    'targetVersion',
    targetVersion,
    14,
    18,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'DomainName': domainName,
    'TargetVersion': targetVersion,
    if (advancedOptions != null) 'AdvancedOptions': advancedOptions,
    if (performCheckOnly != null) 'PerformCheckOnly': performCheckOnly,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/2021-01-01/opensearch/upgradeDomain',
    exceptionFnMap: _exceptionFns,
  );
  return UpgradeDomainResponse.fromJson(response);
}