Skip to content

/AWS1/IF_CWT=>GETALARMMUTERULE()

About GetAlarmMuteRule

Retrieves details for a specific alarm mute rule.

This operation returns complete information about the mute rule, including its configuration, status, targeted alarms, and metadata.

The returned status indicates the current state of the mute rule:

  • SCHEDULED: The mute rule is configured and will become active in the future

  • ACTIVE: The mute rule is currently muting alarm actions

  • EXPIRED: The mute rule has passed its expiration date and will no longer become active

Permissions

To retrieve details for a mute rule, you need the cloudwatch:GetAlarmMuteRule permission on the alarm mute rule resource.

Method Signature

METHODS /AWS1/IF_CWT~GETALARMMUTERULE
  IMPORTING
    !IV_ALARMMUTERULENAME TYPE /AWS1/CWTNAME OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cwtgetalrmmuteruleout
  RAISING
    /AWS1/CX_CWTRESOURCENOTFOUNDEX
    /AWS1/CX_CWTCLIENTEXC
    /AWS1/CX_CWTSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_alarmmuterulename TYPE /AWS1/CWTNAME /AWS1/CWTNAME

The name of the alarm mute rule to retrieve.

RETURNING

oo_output TYPE REF TO /aws1/cl_cwtgetalrmmuteruleout /AWS1/CL_CWTGETALRMMUTERULEOUT

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->getalarmmuterule( |string| ).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_name = lo_result->get_name( ).
  lv_arn = lo_result->get_alarmmuterulearn( ).
  lv_alarmdescription = lo_result->get_description( ).
  lo_rule = lo_result->get_rule( ).
  IF lo_rule IS NOT INITIAL.
    lo_schedule = lo_rule->get_schedule( ).
    IF lo_schedule IS NOT INITIAL.
      lv_expression = lo_schedule->get_expression( ).
      lv_duration = lo_schedule->get_duration( ).
      lv_timezone = lo_schedule->get_timezone( ).
    ENDIF.
  ENDIF.
  lo_mutetargets = lo_result->get_mutetargets( ).
  IF lo_mutetargets IS NOT INITIAL.
    LOOP AT lo_mutetargets->get_alarmnames( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_name = lo_row_1->get_value( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
  lv_timestamp = lo_result->get_startdate( ).
  lv_timestamp = lo_result->get_expiredate( ).
  lv_alarmmuterulestatus = lo_result->get_status( ).
  lv_timestamp = lo_result->get_lastupdatedtimestamp( ).
  lv_mutetype = lo_result->get_mutetype( ).
ENDIF.