terminateSession method

Future<TerminateSessionOutput> terminateSession({
  1. required String clusterId,
  2. required String sessionId,
})

Terminates an active session. After you call this operation, the session enters the TERMINATING state and then transitions to TERMINATED.

May throw InternalServerException. May throw InvalidRequestException.

Parameter clusterId : The ID of the cluster that the session belongs to.

Parameter sessionId : The ID of the session to terminate.

Implementation

Future<TerminateSessionOutput> terminateSession({
  required String clusterId,
  required String sessionId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'ElasticMapReduce.TerminateSession'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClusterId': clusterId,
      'SessionId': sessionId,
    },
  );

  return TerminateSessionOutput.fromJson(jsonResponse.body);
}