getSessionEndpoint method

Future<GetSessionEndpointOutput> getSessionEndpoint({
  1. required String clusterId,
  2. required String sessionId,
})

Returns the Spark Connect endpoint URL and a time-limited authentication token for the specified session. Use the endpoint and token to connect a PySpark client to the session. Call this operation again when the token expires to obtain a new one.

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.

Implementation

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

  return GetSessionEndpointOutput.fromJson(jsonResponse.body);
}