Skip to content

/AWS1/IF_EL2=>MODIFYRULE()

About ModifyRule

Replaces the specified properties of the specified rule. Any properties that you do not specify are unchanged.

To add an item to a list, remove an item from a list, or update an item in a list, you must provide the entire list. For example, to add an action, specify a list with the current actions plus the new action.

Method Signature

METHODS /AWS1/IF_EL2~MODIFYRULE
  IMPORTING
    !IV_RULEARN TYPE /AWS1/EL2RULEARN OPTIONAL
    !IT_CONDITIONS TYPE /AWS1/CL_EL2RULECONDITION=>TT_RULECONDITIONLIST OPTIONAL
    !IT_ACTIONS TYPE /AWS1/CL_EL2ACTION=>TT_ACTIONS OPTIONAL
    !IT_TRANSFORMS TYPE /AWS1/CL_EL2RULETRANSFORM=>TT_RULETRANSFORMLIST OPTIONAL
    !IV_RESETTRANSFORMS TYPE /AWS1/EL2RESETTRANSFORMS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_el2modifyruleoutput
  RAISING
    /AWS1/CX_EL2INCOMPATIBLEPROT00
    /AWS1/CX_EL2INVLOADBALANCERA00
    /AWS1/CX_EL2OPNOTPERMITTEDEX
    /AWS1/CX_EL2RULENOTFOUNDEX
    /AWS1/CX_EL2TGTGRASSOCIATION00
    /AWS1/CX_EL2TGTGROUPNOTFOUNDEX
    /AWS1/CX_EL2TOOMANYACTIONSEX
    /AWS1/CX_EL2TOOMANYREGSFORTG00
    /AWS1/CX_EL2TOOMANYTARGETSEX
    /AWS1/CX_EL2TOOMANYUNIQUETGT00
    /AWS1/CX_EL2UNSUPPEDPROTOCOLEX
    /AWS1/CX_EL2CLIENTEXC
    /AWS1/CX_EL2SERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_rulearn TYPE /AWS1/EL2RULEARN /AWS1/EL2RULEARN

The Amazon Resource Name (ARN) of the rule.

Optional arguments:

it_conditions TYPE /AWS1/CL_EL2RULECONDITION=>TT_RULECONDITIONLIST TT_RULECONDITIONLIST

The conditions.

it_actions TYPE /AWS1/CL_EL2ACTION=>TT_ACTIONS TT_ACTIONS

The actions.

it_transforms TYPE /AWS1/CL_EL2RULETRANSFORM=>TT_RULETRANSFORMLIST TT_RULETRANSFORMLIST

The transforms to apply to requests that match this rule. You can add one host header rewrite transform and one URL rewrite transform. If you specify Transforms, you can't specify ResetTransforms.

iv_resettransforms TYPE /AWS1/EL2RESETTRANSFORMS /AWS1/EL2RESETTRANSFORMS

Indicates whether to remove all transforms from the rule. If you specify ResetTransforms, you can't specify Transforms.

RETURNING

oo_output TYPE REF TO /aws1/cl_el2modifyruleoutput /AWS1/CL_EL2MODIFYRULEOUTPUT

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->modifyrule(
  it_actions = VALUE /aws1/cl_el2action=>tt_actions(
    (
      new /aws1/cl_el2action(
        io_authenticatecognitoconfig = new /aws1/cl_el2authncognitoactcfg(
          it_authntctnreqextraparams = VALUE /aws1/cl_el2authcognitoactau00=>tt_authcognitoactauthreqextr00(
            (
              VALUE /aws1/cl_el2authcognitoactau00=>ts_authcognitoactauth00_maprow(
                value = new /aws1/cl_el2authcognitoactau00( |string| )
                key = |string|
              )
            )
          )
          iv_onunauthenticatedrequest = |string|
          iv_scope = |string|
          iv_sessioncookiename = |string|
          iv_sessiontimeout = 123
          iv_userpoolarn = |string|
          iv_userpoolclientid = |string|
          iv_userpooldomain = |string|
        )
        io_authenticateoidcconfig = new /aws1/cl_el2authntctoidcactcfg(
          it_authntctnreqextraparams = VALUE /aws1/cl_el2authoidcactauthr00=>tt_authoidcactauthreqextraprms(
            (
              VALUE /aws1/cl_el2authoidcactauthr00=>ts_authoidcactauthreq00_maprow(
                value = new /aws1/cl_el2authoidcactauthr00( |string| )
                key = |string|
              )
            )
          )
          iv_authorizationendpoint = |string|
          iv_clientid = |string|
          iv_clientsecret = |string|
          iv_issuer = |string|
          iv_onunauthenticatedrequest = |string|
          iv_scope = |string|
          iv_sessioncookiename = |string|
          iv_sessiontimeout = 123
          iv_tokenendpoint = |string|
          iv_useexistingclientsecret = ABAP_TRUE
          iv_userinfoendpoint = |string|
        )
        io_fixedresponseconfig = new /aws1/cl_el2fixedrspactioncfg(
          iv_contenttype = |string|
          iv_messagebody = |string|
          iv_statuscode = |string|
        )
        io_forwardconfig = new /aws1/cl_el2forwardactioncfg(
          io_targetgroupstickinesscfg = new /aws1/cl_el2tgtgrstickinesscfg(
            iv_durationseconds = 123
            iv_enabled = ABAP_TRUE
          )
          it_targetgroups = VALUE /aws1/cl_el2targetgrouptuple=>tt_targetgrouplist(
            (
              new /aws1/cl_el2targetgrouptuple(
                iv_targetgrouparn = |string|
                iv_weight = 123
              )
            )
          )
        )
        io_jwtvalidationconfig = new /aws1/cl_el2jwtvalidationact00(
          it_additionalclaims = VALUE /aws1/cl_el2jwtvalidationact01=>tt_jwtvalidationactaddlclaims(
            (
              new /aws1/cl_el2jwtvalidationact01(
                it_values = VALUE /aws1/cl_el2jwtvalidationact02=>tt_jwtvalidationactaddlclaim00(
                  ( new /aws1/cl_el2jwtvalidationact02( |string| ) )
                )
                iv_format = |string|
                iv_name = |string|
              )
            )
          )
          iv_issuer = |string|
          iv_jwksendpoint = |string|
        )
        io_redirectconfig = new /aws1/cl_el2rediractionconfig(
          iv_host = |string|
          iv_path = |string|
          iv_port = |string|
          iv_protocol = |string|
          iv_query = |string|
          iv_statuscode = |string|
        )
        iv_order = 123
        iv_targetgrouparn = |string|
        iv_type = |string|
      )
    )
  )
  it_conditions = VALUE /aws1/cl_el2rulecondition=>tt_ruleconditionlist(
    (
      new /aws1/cl_el2rulecondition(
        io_hostheaderconfig = new /aws1/cl_el2hostheadercondcfg(
          it_regexvalues = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
            ( new /aws1/cl_el2listofstring_w( |string| ) )
          )
          it_values = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
            ( new /aws1/cl_el2listofstring_w( |string| ) )
          )
        )
        io_httpheaderconfig = new /aws1/cl_el2httpheadercondcfg(
          it_regexvalues = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
            ( new /aws1/cl_el2listofstring_w( |string| ) )
          )
          it_values = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
            ( new /aws1/cl_el2listofstring_w( |string| ) )
          )
          iv_httpheadername = |string|
        )
        io_httprequestmethodconfig = new /aws1/cl_el2httpreqmethcondcfg(
          it_values = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
            ( new /aws1/cl_el2listofstring_w( |string| ) )
          )
        )
        io_pathpatternconfig = new /aws1/cl_el2pathpatcondconfig(
          it_regexvalues = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
            ( new /aws1/cl_el2listofstring_w( |string| ) )
          )
          it_values = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
            ( new /aws1/cl_el2listofstring_w( |string| ) )
          )
        )
        io_querystringconfig = new /aws1/cl_el2querystringcondcfg(
          it_values = VALUE /aws1/cl_el2querystrkeyvalpair=>tt_querystringkeyvaluepairlist(
            (
              new /aws1/cl_el2querystrkeyvalpair(
                iv_key = |string|
                iv_value = |string|
              )
            )
          )
        )
        io_sourceipconfig = new /aws1/cl_el2sourceipcondconfig(
          it_values = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
            ( new /aws1/cl_el2listofstring_w( |string| ) )
          )
        )
        it_regexvalues = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
          ( new /aws1/cl_el2listofstring_w( |string| ) )
        )
        it_values = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
          ( new /aws1/cl_el2listofstring_w( |string| ) )
        )
        iv_field = |string|
      )
    )
  )
  it_transforms = VALUE /aws1/cl_el2ruletransform=>tt_ruletransformlist(
    (
      new /aws1/cl_el2ruletransform(
        io_hostheaderrewriteconfig = new /aws1/cl_el2hostheaderrewrit00(
          it_rewrites = VALUE /aws1/cl_el2rewriteconfig=>tt_rewriteconfiglist(
            (
              new /aws1/cl_el2rewriteconfig(
                iv_regex = |string|
                iv_replace = |string|
              )
            )
          )
        )
        io_urlrewriteconfig = new /aws1/cl_el2urlrewriteconfig(
          it_rewrites = VALUE /aws1/cl_el2rewriteconfig=>tt_rewriteconfiglist(
            (
              new /aws1/cl_el2rewriteconfig(
                iv_regex = |string|
                iv_replace = |string|
              )
            )
          )
        )
        iv_type = |string|
      )
    )
  )
  iv_resettransforms = ABAP_TRUE
  iv_rulearn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_rules( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_rulearn = lo_row_1->get_rulearn( ).
      lv_string = lo_row_1->get_priority( ).
      LOOP AT lo_row_1->get_conditions( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_conditionfieldname = lo_row_3->get_field( ).
          LOOP AT lo_row_3->get_values( ) into lo_row_4.
            lo_row_5 = lo_row_4.
            IF lo_row_5 IS NOT INITIAL.
              lv_stringvalue = lo_row_5->get_value( ).
            ENDIF.
          ENDLOOP.
          lo_hostheaderconditionconf = lo_row_3->get_hostheaderconfig( ).
          IF lo_hostheaderconditionconf IS NOT INITIAL.
            LOOP AT lo_hostheaderconditionconf->get_values( ) into lo_row_4.
              lo_row_5 = lo_row_4.
              IF lo_row_5 IS NOT INITIAL.
                lv_stringvalue = lo_row_5->get_value( ).
              ENDIF.
            ENDLOOP.
            LOOP AT lo_hostheaderconditionconf->get_regexvalues( ) into lo_row_4.
              lo_row_5 = lo_row_4.
              IF lo_row_5 IS NOT INITIAL.
                lv_stringvalue = lo_row_5->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
          lo_pathpatternconditioncon = lo_row_3->get_pathpatternconfig( ).
          IF lo_pathpatternconditioncon IS NOT INITIAL.
            LOOP AT lo_pathpatternconditioncon->get_values( ) into lo_row_4.
              lo_row_5 = lo_row_4.
              IF lo_row_5 IS NOT INITIAL.
                lv_stringvalue = lo_row_5->get_value( ).
              ENDIF.
            ENDLOOP.
            LOOP AT lo_pathpatternconditioncon->get_regexvalues( ) into lo_row_4.
              lo_row_5 = lo_row_4.
              IF lo_row_5 IS NOT INITIAL.
                lv_stringvalue = lo_row_5->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
          lo_httpheaderconditionconf = lo_row_3->get_httpheaderconfig( ).
          IF lo_httpheaderconditionconf IS NOT INITIAL.
            lv_httpheaderconditionname = lo_httpheaderconditionconf->get_httpheadername( ).
            LOOP AT lo_httpheaderconditionconf->get_values( ) into lo_row_4.
              lo_row_5 = lo_row_4.
              IF lo_row_5 IS NOT INITIAL.
                lv_stringvalue = lo_row_5->get_value( ).
              ENDIF.
            ENDLOOP.
            LOOP AT lo_httpheaderconditionconf->get_regexvalues( ) into lo_row_4.
              lo_row_5 = lo_row_4.
              IF lo_row_5 IS NOT INITIAL.
                lv_stringvalue = lo_row_5->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
          lo_querystringconditioncon = lo_row_3->get_querystringconfig( ).
          IF lo_querystringconditioncon IS NOT INITIAL.
            LOOP AT lo_querystringconditioncon->get_values( ) into lo_row_6.
              lo_row_7 = lo_row_6.
              IF lo_row_7 IS NOT INITIAL.
                lv_stringvalue = lo_row_7->get_key( ).
                lv_stringvalue = lo_row_7->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
          lo_httprequestmethodcondit = lo_row_3->get_httprequestmethodconfig( ).
          IF lo_httprequestmethodcondit IS NOT INITIAL.
            LOOP AT lo_httprequestmethodcondit->get_values( ) into lo_row_4.
              lo_row_5 = lo_row_4.
              IF lo_row_5 IS NOT INITIAL.
                lv_stringvalue = lo_row_5->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
          lo_sourceipconditionconfig = lo_row_3->get_sourceipconfig( ).
          IF lo_sourceipconditionconfig IS NOT INITIAL.
            LOOP AT lo_sourceipconditionconfig->get_values( ) into lo_row_4.
              lo_row_5 = lo_row_4.
              IF lo_row_5 IS NOT INITIAL.
                lv_stringvalue = lo_row_5->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
          LOOP AT lo_row_3->get_regexvalues( ) into lo_row_4.
            lo_row_5 = lo_row_4.
            IF lo_row_5 IS NOT INITIAL.
              lv_stringvalue = lo_row_5->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_actions( ) into lo_row_8.
        lo_row_9 = lo_row_8.
        IF lo_row_9 IS NOT INITIAL.
          lv_actiontypeenum = lo_row_9->get_type( ).
          lv_targetgrouparn = lo_row_9->get_targetgrouparn( ).
          lo_authenticateoidcactionc = lo_row_9->get_authenticateoidcconfig( ).
          IF lo_authenticateoidcactionc IS NOT INITIAL.
            lv_authenticateoidcactioni = lo_authenticateoidcactionc->get_issuer( ).
            lv_authenticateoidcactiona = lo_authenticateoidcactionc->get_authorizationendpoint( ).
            lv_authenticateoidcactiont = lo_authenticateoidcactionc->get_tokenendpoint( ).
            lv_authenticateoidcactionu = lo_authenticateoidcactionc->get_userinfoendpoint( ).
            lv_authenticateoidcactionc_1 = lo_authenticateoidcactionc->get_clientid( ).
            lv_authenticateoidcactionc_2 = lo_authenticateoidcactionc->get_clientsecret( ).
            lv_authenticateoidcactions = lo_authenticateoidcactionc->get_sessioncookiename( ).
            lv_authenticateoidcactions_1 = lo_authenticateoidcactionc->get_scope( ).
            lv_authenticateoidcactions_2 = lo_authenticateoidcactionc->get_sessiontimeout( ).
            LOOP AT lo_authenticateoidcactionc->get_authntctnreqextraparams( ) into ls_row_10.
              lv_key = ls_row_10-key.
              lo_value = ls_row_10-value.
              IF lo_value IS NOT INITIAL.
                lv_authenticateoidcactiona_1 = lo_value->get_value( ).
              ENDIF.
            ENDLOOP.
            lv_authenticateoidcactionc_3 = lo_authenticateoidcactionc->get_onunauthenticatedrequest( ).
            lv_authenticateoidcactionu_1 = lo_authenticateoidcactionc->get_useexistingclientsecret( ).
          ENDIF.
          lo_authenticatecognitoacti = lo_row_9->get_authntctcognitoconfig( ).
          IF lo_authenticatecognitoacti IS NOT INITIAL.
            lv_authenticatecognitoacti_1 = lo_authenticatecognitoacti->get_userpoolarn( ).
            lv_authenticatecognitoacti_2 = lo_authenticatecognitoacti->get_userpoolclientid( ).
            lv_authenticatecognitoacti_3 = lo_authenticatecognitoacti->get_userpooldomain( ).
            lv_authenticatecognitoacti_4 = lo_authenticatecognitoacti->get_sessioncookiename( ).
            lv_authenticatecognitoacti_5 = lo_authenticatecognitoacti->get_scope( ).
            lv_authenticatecognitoacti_6 = lo_authenticatecognitoacti->get_sessiontimeout( ).
            LOOP AT lo_authenticatecognitoacti->get_authntctnreqextraparams( ) into ls_row_11.
              lv_key_1 = ls_row_11-key.
              lo_value_1 = ls_row_11-value.
              IF lo_value_1 IS NOT INITIAL.
                lv_authenticatecognitoacti_7 = lo_value_1->get_value( ).
              ENDIF.
            ENDLOOP.
            lv_authenticatecognitoacti_8 = lo_authenticatecognitoacti->get_onunauthenticatedrequest( ).
          ENDIF.
          lv_actionorder = lo_row_9->get_order( ).
          lo_redirectactionconfig = lo_row_9->get_redirectconfig( ).
          IF lo_redirectactionconfig IS NOT INITIAL.
            lv_redirectactionprotocol = lo_redirectactionconfig->get_protocol( ).
            lv_redirectactionport = lo_redirectactionconfig->get_port( ).
            lv_redirectactionhost = lo_redirectactionconfig->get_host( ).
            lv_redirectactionpath = lo_redirectactionconfig->get_path( ).
            lv_redirectactionquery = lo_redirectactionconfig->get_query( ).
            lv_redirectactionstatuscod = lo_redirectactionconfig->get_statuscode( ).
          ENDIF.
          lo_fixedresponseactionconf = lo_row_9->get_fixedresponseconfig( ).
          IF lo_fixedresponseactionconf IS NOT INITIAL.
            lv_fixedresponseactionmess = lo_fixedresponseactionconf->get_messagebody( ).
            lv_fixedresponseactionstat = lo_fixedresponseactionconf->get_statuscode( ).
            lv_fixedresponseactioncont = lo_fixedresponseactionconf->get_contenttype( ).
          ENDIF.
          lo_forwardactionconfig = lo_row_9->get_forwardconfig( ).
          IF lo_forwardactionconfig IS NOT INITIAL.
            LOOP AT lo_forwardactionconfig->get_targetgroups( ) into lo_row_12.
              lo_row_13 = lo_row_12.
              IF lo_row_13 IS NOT INITIAL.
                lv_targetgrouparn = lo_row_13->get_targetgrouparn( ).
                lv_targetgroupweight = lo_row_13->get_weight( ).
              ENDIF.
            ENDLOOP.
            lo_targetgroupstickinessco = lo_forwardactionconfig->get_targetgroupstickinesscfg( ).
            IF lo_targetgroupstickinessco IS NOT INITIAL.
              lv_targetgroupstickinessen = lo_targetgroupstickinessco->get_enabled( ).
              lv_targetgroupstickinessdu = lo_targetgroupstickinessco->get_durationseconds( ).
            ENDIF.
          ENDIF.
          lo_jwtvalidationactionconf = lo_row_9->get_jwtvalidationconfig( ).
          IF lo_jwtvalidationactionconf IS NOT INITIAL.
            lv_jwtvalidationactionjwks = lo_jwtvalidationactionconf->get_jwksendpoint( ).
            lv_jwtvalidationactionissu = lo_jwtvalidationactionconf->get_issuer( ).
            LOOP AT lo_jwtvalidationactionconf->get_additionalclaims( ) into lo_row_14.
              lo_row_15 = lo_row_14.
              IF lo_row_15 IS NOT INITIAL.
                lv_jwtvalidationactionaddi = lo_row_15->get_format( ).
                lv_jwtvalidationactionaddi_1 = lo_row_15->get_name( ).
                LOOP AT lo_row_15->get_values( ) into lo_row_16.
                  lo_row_17 = lo_row_16.
                  IF lo_row_17 IS NOT INITIAL.
                    lv_jwtvalidationactionaddi_2 = lo_row_17->get_value( ).
                  ENDIF.
                ENDLOOP.
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDLOOP.
      lv_isdefault = lo_row_1->get_isdefault( ).
      LOOP AT lo_row_1->get_transforms( ) into lo_row_18.
        lo_row_19 = lo_row_18.
        IF lo_row_19 IS NOT INITIAL.
          lv_transformtypeenum = lo_row_19->get_type( ).
          lo_hostheaderrewriteconfig = lo_row_19->get_hostheaderrewriteconfig( ).
          IF lo_hostheaderrewriteconfig IS NOT INITIAL.
            LOOP AT lo_hostheaderrewriteconfig->get_rewrites( ) into lo_row_20.
              lo_row_21 = lo_row_20.
              IF lo_row_21 IS NOT INITIAL.
                lv_stringvalue = lo_row_21->get_regex( ).
                lv_stringvalue = lo_row_21->get_replace( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
          lo_urlrewriteconfig = lo_row_19->get_urlrewriteconfig( ).
          IF lo_urlrewriteconfig IS NOT INITIAL.
            LOOP AT lo_urlrewriteconfig->get_rewrites( ) into lo_row_20.
              lo_row_21 = lo_row_20.
              IF lo_row_21 IS NOT INITIAL.
                lv_stringvalue = lo_row_21->get_regex( ).
                lv_stringvalue = lo_row_21->get_replace( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
ENDIF.

To modify a rule

This example modifies the condition for the specified rule.

DATA(lo_result) = lo_client->modifyrule(
  it_conditions = VALUE /aws1/cl_el2rulecondition=>tt_ruleconditionlist(
    (
      new /aws1/cl_el2rulecondition(
        it_values = VALUE /aws1/cl_el2listofstring_w=>tt_listofstring(
          ( new /aws1/cl_el2listofstring_w( |/images/*| ) )
        )
        iv_field = |path-pattern|
      )
    )
  )
  iv_rulearn = |arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee|
).