Skip to content

/AWS1/IF_COA=>UPDATEAUTOMATIONRULE()

About UpdateAutomationRule

Updates an existing automation rule.

Method Signature

METHODS /AWS1/IF_COA~UPDATEAUTOMATIONRULE
  IMPORTING
    !IV_RULEARN TYPE /AWS1/COARULEARN OPTIONAL
    !IV_RULEREVISION TYPE /AWS1/COALONG OPTIONAL
    !IV_NAME TYPE /AWS1/COARULENAME OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/COARULEDESCRIPTION OPTIONAL
    !IV_RULETYPE TYPE /AWS1/COARULETYPE OPTIONAL
    !IO_ORGANIZATIONCONFIGURATION TYPE REF TO /AWS1/CL_COAORGANIZATIONCONF OPTIONAL
    !IV_PRIORITY TYPE /AWS1/COASTRING OPTIONAL
    !IT_RECOMMENDEDACTIONTYPES TYPE /AWS1/CL_COARECDACTTYPELIST_W=>TT_RECOMMENDEDACTIONTYPELIST OPTIONAL
    !IO_CRITERIA TYPE REF TO /AWS1/CL_COACRITERIA OPTIONAL
    !IO_SCHEDULE TYPE REF TO /AWS1/CL_COASCHEDULE OPTIONAL
    !IV_STATUS TYPE /AWS1/COARULESTATUS OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/COACLIENTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_coaupdateautorulersp
  RAISING
    /AWS1/CX_COAACCESSDENIEDEX
    /AWS1/CX_COAFORBIDDENEXCEPTION
    /AWS1/CX_COAIDEMTOKENINUSEEX
    /AWS1/CX_COAIDEMPARAMMMEX
    /AWS1/CX_COAINTERNALSERVEREX
    /AWS1/CX_COAINVPARAMVALUEEX
    /AWS1/CX_COAOPTINREQUIREDEX
    /AWS1/CX_COARESOURCENOTFOUNDEX
    /AWS1/CX_COASERVICEUNAVAILEX
    /AWS1/CX_COATHROTTLINGEX
    /AWS1/CX_COACLIENTEXC
    /AWS1/CX_COASERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_rulearn TYPE /AWS1/COARULEARN /AWS1/COARULEARN

The ARN of the rule to update.

iv_rulerevision TYPE /AWS1/COALONG /AWS1/COALONG

The revision number of the rule to update.

Optional arguments:

iv_name TYPE /AWS1/COARULENAME /AWS1/COARULENAME

The updated name of the automation rule. Must be 1-128 characters long and contain only alphanumeric characters, underscores, and hyphens.

iv_description TYPE /AWS1/COARULEDESCRIPTION /AWS1/COARULEDESCRIPTION

The updated description of the automation rule. Can be up to 1024 characters long and contain alphanumeric characters, underscores, hyphens, spaces, and certain special characters.

iv_ruletype TYPE /AWS1/COARULETYPE /AWS1/COARULETYPE

The updated type of automation rule. Can be either OrganizationRule for organization-wide rules or AccountRule for account-specific rules.

io_organizationconfiguration TYPE REF TO /AWS1/CL_COAORGANIZATIONCONF /AWS1/CL_COAORGANIZATIONCONF

Updated configuration settings for organization-wide rules, including rule application order and target account IDs.

iv_priority TYPE /AWS1/COASTRING /AWS1/COASTRING

The updated priority level of the automation rule, used to determine execution order when multiple rules apply to the same resource.

it_recommendedactiontypes TYPE /AWS1/CL_COARECDACTTYPELIST_W=>TT_RECOMMENDEDACTIONTYPELIST TT_RECOMMENDEDACTIONTYPELIST

Updated list of recommended action types that this rule can execute, such as SnapshotAndDeleteUnattachedEbsVolume or UpgradeEbsVolumeType.

io_criteria TYPE REF TO /AWS1/CL_COACRITERIA /AWS1/CL_COACRITERIA

criteria

io_schedule TYPE REF TO /AWS1/CL_COASCHEDULE /AWS1/CL_COASCHEDULE

The updated schedule configuration for when the automation rule should execute, including cron expression, timezone, and execution window.

iv_status TYPE /AWS1/COARULESTATUS /AWS1/COARULESTATUS

The updated status of the automation rule. Can be Active or Inactive.

iv_clienttoken TYPE /AWS1/COACLIENTTOKEN /AWS1/COACLIENTTOKEN

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Must be 1-64 characters long and contain only alphanumeric characters, underscores, and hyphens.

RETURNING

oo_output TYPE REF TO /aws1/cl_coaupdateautorulersp /AWS1/CL_COAUPDATEAUTORULERSP

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->updateautomationrule(
  io_criteria = new /aws1/cl_coacriteria(
    it_ebsvolumesizeingib = VALUE /aws1/cl_coaintegercritcond=>tt_integercriteriacondlist(
      (
        new /aws1/cl_coaintegercritcond(
          it_values = VALUE /aws1/cl_coaintegerlist_w=>tt_integerlist(
            ( new /aws1/cl_coaintegerlist_w( 123 ) )
          )
          iv_comparison = |string|
        )
      )
    )
    it_ebsvolumetype = VALUE /aws1/cl_coastringcriteriacond=>tt_stringcriteriaconditionlist(
      (
        new /aws1/cl_coastringcriteriacond(
          it_values = VALUE /aws1/cl_coastringcritvalues_w=>tt_stringcriteriavalues(
            ( new /aws1/cl_coastringcritvalues_w( |string| ) )
          )
          iv_comparison = |string|
        )
      )
    )
    it_estimatedmonthlysavings = VALUE /aws1/cl_coadoublecriteriacond=>tt_doublecriteriaconditionlist(
      (
        new /aws1/cl_coadoublecriteriacond(
          it_values = VALUE /aws1/cl_coadoublelist_w=>tt_doublelist(
            ( new /aws1/cl_coadoublelist_w( |0.1| ) )
          )
          iv_comparison = |string|
        )
      )
    )
    it_lookbackperiodindays = VALUE /aws1/cl_coaintegercritcond=>tt_integercriteriacondlist(
      (
        new /aws1/cl_coaintegercritcond(
          it_values = VALUE /aws1/cl_coaintegerlist_w=>tt_integerlist(
            ( new /aws1/cl_coaintegerlist_w( 123 ) )
          )
          iv_comparison = |string|
        )
      )
    )
    it_region = VALUE /aws1/cl_coastringcriteriacond=>tt_stringcriteriaconditionlist(
      (
        new /aws1/cl_coastringcriteriacond(
          it_values = VALUE /aws1/cl_coastringcritvalues_w=>tt_stringcriteriavalues(
            ( new /aws1/cl_coastringcritvalues_w( |string| ) )
          )
          iv_comparison = |string|
        )
      )
    )
    it_resourcearn = VALUE /aws1/cl_coastringcriteriacond=>tt_stringcriteriaconditionlist(
      (
        new /aws1/cl_coastringcriteriacond(
          it_values = VALUE /aws1/cl_coastringcritvalues_w=>tt_stringcriteriavalues(
            ( new /aws1/cl_coastringcritvalues_w( |string| ) )
          )
          iv_comparison = |string|
        )
      )
    )
    it_resourcetag = VALUE /aws1/cl_coarestagscritcond=>tt_resourcetagscritcondlist(
      (
        new /aws1/cl_coarestagscritcond(
          it_values = VALUE /aws1/cl_coastringcritvalues_w=>tt_stringcriteriavalues(
            ( new /aws1/cl_coastringcritvalues_w( |string| ) )
          )
          iv_comparison = |string|
          iv_key = |string|
        )
      )
    )
    it_restartneeded = VALUE /aws1/cl_coastringcriteriacond=>tt_stringcriteriaconditionlist(
      (
        new /aws1/cl_coastringcriteriacond(
          it_values = VALUE /aws1/cl_coastringcritvalues_w=>tt_stringcriteriavalues(
            ( new /aws1/cl_coastringcritvalues_w( |string| ) )
          )
          iv_comparison = |string|
        )
      )
    )
  )
  io_organizationconfiguration = new /aws1/cl_coaorganizationconf(
    it_accountids = VALUE /aws1/cl_coaorgconfacctids_w=>tt_organizationconfaccountids(
      ( new /aws1/cl_coaorgconfacctids_w( |string| ) )
    )
    iv_ruleapplyorder = |string|
  )
  io_schedule = new /aws1/cl_coaschedule(
    iv_executionwindowinminutes = 123
    iv_scheduleexpression = |string|
    iv_schedulexprsntimezone = |string|
  )
  it_recommendedactiontypes = VALUE /aws1/cl_coarecdacttypelist_w=>tt_recommendedactiontypelist(
    ( new /aws1/cl_coarecdacttypelist_w( |string| ) )
  )
  iv_clienttoken = |string|
  iv_description = |string|
  iv_name = |string|
  iv_priority = |string|
  iv_rulearn = |string|
  iv_rulerevision = 123
  iv_ruletype = |string|
  iv_status = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_rulearn = lo_result->get_rulearn( ).
  lv_long = lo_result->get_rulerevision( ).
  lv_rulename = lo_result->get_name( ).
  lv_string = lo_result->get_description( ).
  lv_ruletype = lo_result->get_ruletype( ).
  lo_organizationconfigurati = lo_result->get_organizationconf( ).
  IF lo_organizationconfigurati IS NOT INITIAL.
    lv_ruleapplyorder = lo_organizationconfigurati->get_ruleapplyorder( ).
    LOOP AT lo_organizationconfigurati->get_accountids( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_accountid = lo_row_1->get_value( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
  lv_string = lo_result->get_priority( ).
  LOOP AT lo_result->get_recommendedactiontypes( ) into lo_row_2.
    lo_row_3 = lo_row_2.
    IF lo_row_3 IS NOT INITIAL.
      lv_recommendedactiontype = lo_row_3->get_value( ).
    ENDIF.
  ENDLOOP.
  lo_criteria = lo_result->get_criteria( ).
  IF lo_criteria IS NOT INITIAL.
    LOOP AT lo_criteria->get_region( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_comparisonoperator = lo_row_5->get_comparison( ).
        LOOP AT lo_row_5->get_values( ) into lo_row_6.
          lo_row_7 = lo_row_6.
          IF lo_row_7 IS NOT INITIAL.
            lv_stringcriteriavalue = lo_row_7->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    LOOP AT lo_criteria->get_resourcearn( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_comparisonoperator = lo_row_5->get_comparison( ).
        LOOP AT lo_row_5->get_values( ) into lo_row_6.
          lo_row_7 = lo_row_6.
          IF lo_row_7 IS NOT INITIAL.
            lv_stringcriteriavalue = lo_row_7->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    LOOP AT lo_criteria->get_ebsvolumetype( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_comparisonoperator = lo_row_5->get_comparison( ).
        LOOP AT lo_row_5->get_values( ) into lo_row_6.
          lo_row_7 = lo_row_6.
          IF lo_row_7 IS NOT INITIAL.
            lv_stringcriteriavalue = lo_row_7->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    LOOP AT lo_criteria->get_ebsvolumesizeingib( ) into lo_row_8.
      lo_row_9 = lo_row_8.
      IF lo_row_9 IS NOT INITIAL.
        lv_comparisonoperator = lo_row_9->get_comparison( ).
        LOOP AT lo_row_9->get_values( ) into lo_row_10.
          lo_row_11 = lo_row_10.
          IF lo_row_11 IS NOT INITIAL.
            lv_integer = lo_row_11->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    LOOP AT lo_criteria->get_estimatedmonthlysavings( ) into lo_row_12.
      lo_row_13 = lo_row_12.
      IF lo_row_13 IS NOT INITIAL.
        lv_comparisonoperator = lo_row_13->get_comparison( ).
        LOOP AT lo_row_13->get_values( ) into lo_row_14.
          lo_row_15 = lo_row_14.
          IF lo_row_15 IS NOT INITIAL.
            lv_double = lo_row_15->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    LOOP AT lo_criteria->get_resourcetag( ) into lo_row_16.
      lo_row_17 = lo_row_16.
      IF lo_row_17 IS NOT INITIAL.
        lv_comparisonoperator = lo_row_17->get_comparison( ).
        lv_stringcriteriavalue = lo_row_17->get_key( ).
        LOOP AT lo_row_17->get_values( ) into lo_row_6.
          lo_row_7 = lo_row_6.
          IF lo_row_7 IS NOT INITIAL.
            lv_stringcriteriavalue = lo_row_7->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    LOOP AT lo_criteria->get_lookbackperiodindays( ) into lo_row_8.
      lo_row_9 = lo_row_8.
      IF lo_row_9 IS NOT INITIAL.
        lv_comparisonoperator = lo_row_9->get_comparison( ).
        LOOP AT lo_row_9->get_values( ) into lo_row_10.
          lo_row_11 = lo_row_10.
          IF lo_row_11 IS NOT INITIAL.
            lv_integer = lo_row_11->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    LOOP AT lo_criteria->get_restartneeded( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_comparisonoperator = lo_row_5->get_comparison( ).
        LOOP AT lo_row_5->get_values( ) into lo_row_6.
          lo_row_7 = lo_row_6.
          IF lo_row_7 IS NOT INITIAL.
            lv_stringcriteriavalue = lo_row_7->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
  ENDIF.
  lo_schedule = lo_result->get_schedule( ).
  IF lo_schedule IS NOT INITIAL.
    lv_string = lo_schedule->get_scheduleexpression( ).
    lv_string = lo_schedule->get_schedulexprsntimezone( ).
    lv_integer = lo_schedule->get_executionwindowinminutes( ).
  ENDIF.
  lv_rulestatus = lo_result->get_status( ).
  lv_timestamp = lo_result->get_createdtimestamp( ).
  lv_timestamp = lo_result->get_lastupdatedtimestamp( ).
ENDIF.