startDomainMaintenance method

Future<StartDomainMaintenanceResponse> startDomainMaintenance({
  1. required MaintenanceType action,
  2. required String domainName,
  3. String? nodeId,
})

Starts the node maintenance process on the data node. These processes can include a node reboot, an Opensearch or Elasticsearch process restart, or a Dashboard or Kibana restart.

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

Parameter action : The name of the action.

Parameter domainName : The name of the domain.

Parameter nodeId : The ID of the data node.

Implementation

Future<StartDomainMaintenanceResponse> startDomainMaintenance({
  required MaintenanceType action,
  required String domainName,
  String? nodeId,
}) async {
  final $payload = <String, dynamic>{
    'Action': action.value,
    if (nodeId != null) 'NodeId': nodeId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/2021-01-01/opensearch/domain/${Uri.encodeComponent(domainName)}/domainMaintenance',
    exceptionFnMap: _exceptionFns,
  );
  return StartDomainMaintenanceResponse.fromJson(response);
}