Skip to content

/AWS1/IF_EMR=>GETSESSIONENDPOINT()

About GetSessionEndpoint

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.

Method Signature

METHODS /AWS1/IF_EMR~GETSESSIONENDPOINT
  IMPORTING
    !IV_CLUSTERID TYPE /AWS1/EMRCLUSTERID OPTIONAL
    !IV_SESSIONID TYPE /AWS1/EMRSESSIONID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_emrgetsessendptoutput
  RAISING
    /AWS1/CX_EMRINTERNALSERVEREX
    /AWS1/CX_EMRINVALIDREQUESTEX
    /AWS1/CX_EMRCLIENTEXC
    /AWS1/CX_EMRSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_clusterid TYPE /AWS1/EMRCLUSTERID /AWS1/EMRCLUSTERID

The ID of the cluster that the session belongs to.

iv_sessionid TYPE /AWS1/EMRSESSIONID /AWS1/EMRSESSIONID

The ID of the session.

RETURNING

oo_output TYPE REF TO /aws1/cl_emrgetsessendptoutput /AWS1/CL_EMRGETSESSENDPTOUTPUT

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->getsessionendpoint(
  iv_clusterid = |string|
  iv_sessionid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_xmlstring = lo_result->get_endpoint( ).
  lv_sensitivestring = lo_result->get_authtoken( ).
  lv_date = lo_result->get_authtokenexpirationtime( ).
  lo_credentials = lo_result->get_credentials( ).
  IF lo_credentials IS NOT INITIAL.
    lo_usernamepassword = lo_credentials->get_usernamepassword( ).
    IF lo_usernamepassword IS NOT INITIAL.
      lv_xmlstringmaxlen256 = lo_usernamepassword->get_username( ).
      lv_xmlstringmaxlen256 = lo_usernamepassword->get_password( ).
    ENDIF.
  ENDIF.
ENDIF.