Skip to content

/AWS1/CL_EMR=>GETCLUSTERSESSIONCREDENTIALS()

About GetClusterSessionCredentials

Provides temporary, HTTP basic credentials that are associated with a given runtime IAM role and used by a cluster with fine-grained access control activated. You can use these credentials to connect to cluster endpoints that support username and password authentication.

Method Signature

IMPORTING

Required arguments:

iv_clusterid TYPE /AWS1/EMRXMLSTRINGMAXLEN256 /AWS1/EMRXMLSTRINGMAXLEN256

The unique identifier of the cluster.

Optional arguments:

iv_executionrolearn TYPE /AWS1/EMRARNTYPE /AWS1/EMRARNTYPE

The Amazon Resource Name (ARN) of the runtime role for interactive workload submission on the cluster. The runtime role can be a cross-account IAM role. The runtime role ARN is a combination of account ID, role name, and role type using the following format: arn:partition:service:region:account:resource.

RETURNING

oo_output TYPE REF TO /aws1/cl_emrgetclstsesscreds01 /AWS1/CL_EMRGETCLSTSESSCREDS01

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

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->/aws1/if_emr~getclustersessioncredentials(
  iv_clusterid = |string|
  iv_executionrolearn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  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.
  lv_date = lo_result->get_expiresat( ).
ENDIF.