Skip to content

/AWS1/IF_IAM=>GETROLETEMPLATEVERSION()

About GetRoleTemplateVersion

Retrieves information about a version of the specified role template. Role templates define a reusable configuration—including role name and path patterns, trust policy, inline and managed policies, permissions boundary, tags, and maximum session duration—that you use to create IAM roles with AcquireRole.

If you do not specify a minor version, the service returns the template's default minor version.

Method Signature

METHODS /AWS1/IF_IAM~GETROLETEMPLATEVERSION
  IMPORTING
    !IV_TEMPLATEARN TYPE /AWS1/IAMARNTYPE OPTIONAL
    !IV_MINORVERSION TYPE /AWS1/IAMMINORVERSIONTYPE OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_iamgetroletmplvrsrsp
  RAISING
    /AWS1/CX_IAMINVALIDINPUTEX
    /AWS1/CX_IAMNOSUCHENTITYEX
    /AWS1/CX_IAMSERVICEFAILUREEX
    /AWS1/CX_IAMCLIENTEXC
    /AWS1/CX_IAMSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_templatearn TYPE /AWS1/IAMARNTYPE /AWS1/IAMARNTYPE

The Amazon Resource Name (ARN) of the role template whose version you want to retrieve.

For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

Optional arguments:

iv_minorversion TYPE /AWS1/IAMMINORVERSIONTYPE /AWS1/IAMMINORVERSIONTYPE

The minor version of the role template to retrieve. If you do not specify a minor version, the service returns the template's default minor version.

RETURNING

oo_output TYPE REF TO /aws1/cl_iamgetroletmplvrsrsp /AWS1/CL_IAMGETROLETMPLVRSRSP

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->getroletemplateversion(
  iv_minorversion = 123
  iv_templatearn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_roletemplateversion = lo_result->get_roletemplateversion( ).
  IF lo_roletemplateversion IS NOT INITIAL.
    lv_arntype = lo_roletemplateversion->get_templatearn( ).
    lv_roletemplatenametype = lo_roletemplateversion->get_templatename( ).
    lv_idtype = lo_roletemplateversion->get_templateversionid( ).
    lv_roletemplatedescription = lo_roletemplateversion->get_description( ).
    lv_integertype = lo_roletemplateversion->get_majorversion( ).
    lv_minorversiontype = lo_roletemplateversion->get_defaultminorversion( ).
    lv_managedbytypetype = lo_roletemplateversion->get_managedbytype( ).
    lv_managedbyvaluetype = lo_roletemplateversion->get_managedbyvalue( ).
    lv_booleantype = lo_roletemplateversion->get_enabled( ).
    lv_minorversiontype = lo_roletemplateversion->get_minorversion( ).
    lv_rolenamepatterntype = lo_roletemplateversion->get_rolenamepattern( ).
    lv_rolepathpatterntype = lo_roletemplateversion->get_rolepathpattern( ).
    lv_roledescriptionpatternt = lo_roletemplateversion->get_roledescriptionpattern( ).
    lv_policydocumenttype = lo_roletemplateversion->get_assumerolepolicydoctmpl( ).
    LOOP AT lo_roletemplateversion->get_inlinepolicytemplates( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_policynametype = lo_row_1->get_policyname( ).
        lv_policydocumenttype = lo_row_1->get_policydocument( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_roletemplateversion->get_managedpolicyarns( ) into lo_row_2.
      lo_row_3 = lo_row_2.
      IF lo_row_3 IS NOT INITIAL.
        lv_arntype = lo_row_3->get_value( ).
      ENDIF.
    ENDLOOP.
    lv_arntype = lo_roletemplateversion->get_permissionboundaryarn( ).
    LOOP AT lo_roletemplateversion->get_parametersdefinition( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_parameternametype = lo_row_5->get_name( ).
        lv_parametertypetype = lo_row_5->get_type( ).
        lv_parametersubtypetype = lo_row_5->get_subtype( ).
        lv_parameterdescriptiontyp = lo_row_5->get_description( ).
        lv_booleantype = lo_row_5->get_isrequired( ).
        lv_parameterdefaultvaluety = lo_row_5->get_defaultvalue( ).
        lv_booleantype = lo_row_5->get_immutable( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_roletemplateversion->get_roletagstemplate( ) into lo_row_6.
      lo_row_7 = lo_row_6.
      IF lo_row_7 IS NOT INITIAL.
        lv_tagtemplatekeytype = lo_row_7->get_key( ).
        lv_tagtemplatevaluetype = lo_row_7->get_value( ).
      ENDIF.
    ENDLOOP.
    lv_rolemaxsessiondurationt = lo_roletemplateversion->get_maxsessionduration( ).
    lv_booleantype = lo_roletemplateversion->get_versionenabled( ).
    lv_datetype = lo_roletemplateversion->get_createtimestamp( ).
    lv_datetype = lo_roletemplateversion->get_updatetimestamp( ).
  ENDIF.
ENDIF.