/AWS1/IF_CWT=>DESCRIBEALARMHISTORY()¶
About DescribeAlarmHistory¶
Retrieves the history for the specified alarm. You can filter the results by date range or item type. If an alarm name is not specified, the histories for either all metric alarms or all composite alarms are returned.
CloudWatch retains the history of an alarm even if you delete the alarm.
To use this operation and return information about a composite alarm, you must be
signed on with the cloudwatch:DescribeAlarmHistory permission that is
scoped to *. You can't return information about composite alarms if your
cloudwatch:DescribeAlarmHistory permission has a narrower scope.
Method Signature¶
METHODS /AWS1/IF_CWT~DESCRIBEALARMHISTORY
IMPORTING
!IV_ALARMNAME TYPE /AWS1/CWTALARMNAME OPTIONAL
!IV_ALARMCONTRIBUTORID TYPE /AWS1/CWTCONTRIBUTORID OPTIONAL
!IT_ALARMTYPES TYPE /AWS1/CL_CWTALARMTYPES_W=>TT_ALARMTYPES OPTIONAL
!IV_HISTORYITEMTYPE TYPE /AWS1/CWTHISTORYITEMTYPE OPTIONAL
!IV_STARTDATE TYPE /AWS1/CWTTIMESTAMP OPTIONAL
!IV_ENDDATE TYPE /AWS1/CWTTIMESTAMP OPTIONAL
!IV_MAXRECORDS TYPE /AWS1/CWTMAXRECORDS OPTIONAL
!IV_NEXTTOKEN TYPE /AWS1/CWTNEXTTOKEN OPTIONAL
!IV_SCANBY TYPE /AWS1/CWTSCANBY OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cwtdscalarmhistoryout
RAISING
/AWS1/CX_CWTINVALIDNEXTTOKEN
/AWS1/CX_CWTCLIENTEXC
/AWS1/CX_CWTSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Optional arguments:¶
iv_alarmname TYPE /AWS1/CWTALARMNAME /AWS1/CWTALARMNAME¶
The name of the alarm.
iv_alarmcontributorid TYPE /AWS1/CWTCONTRIBUTORID /AWS1/CWTCONTRIBUTORID¶
The unique identifier of a specific alarm contributor to filter the alarm history results.
it_alarmtypes TYPE /AWS1/CL_CWTALARMTYPES_W=>TT_ALARMTYPES TT_ALARMTYPES¶
Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter, only metric alarms are returned.
iv_historyitemtype TYPE /AWS1/CWTHISTORYITEMTYPE /AWS1/CWTHISTORYITEMTYPE¶
The type of alarm histories to retrieve.
iv_startdate TYPE /AWS1/CWTTIMESTAMP /AWS1/CWTTIMESTAMP¶
The starting date to retrieve alarm history.
iv_enddate TYPE /AWS1/CWTTIMESTAMP /AWS1/CWTTIMESTAMP¶
The ending date to retrieve alarm history.
iv_maxrecords TYPE /AWS1/CWTMAXRECORDS /AWS1/CWTMAXRECORDS¶
The maximum number of alarm history records to retrieve.
iv_nexttoken TYPE /AWS1/CWTNEXTTOKEN /AWS1/CWTNEXTTOKEN¶
The token returned by a previous call to indicate that there is more data available.
iv_scanby TYPE /AWS1/CWTSCANBY /AWS1/CWTSCANBY¶
Specified whether to return the newest or oldest alarm history first. Specify
TimestampDescendingto have the newest event history returned first, and specifyTimestampAscendingto have the oldest history returned first.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_cwtdscalarmhistoryout /AWS1/CL_CWTDSCALARMHISTORYOUT¶
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->describealarmhistory(
it_alarmtypes = VALUE /aws1/cl_cwtalarmtypes_w=>tt_alarmtypes(
( new /aws1/cl_cwtalarmtypes_w( |string| ) )
)
iv_alarmcontributorid = |string|
iv_alarmname = |string|
iv_enddate = '20150101000000.0000000'
iv_historyitemtype = |string|
iv_maxrecords = 123
iv_nexttoken = |string|
iv_scanby = |string|
iv_startdate = '20150101000000.0000000'
).
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_alarmhistoryitems( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_alarmname = lo_row_1->get_alarmname( ).
lv_contributorid = lo_row_1->get_alarmcontributorid( ).
lv_alarmtype = lo_row_1->get_alarmtype( ).
lv_timestamp = lo_row_1->get_timestamp( ).
lv_historyitemtype = lo_row_1->get_historyitemtype( ).
lv_historysummary = lo_row_1->get_historysummary( ).
lv_historydata = lo_row_1->get_historydata( ).
LOOP AT lo_row_1->get_alarmcontribattributes( ) into ls_row_2.
lv_key = ls_row_2-key.
lo_value = ls_row_2-value.
IF lo_value IS NOT INITIAL.
lv_attributevalue = lo_value->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.