Skip to content

/AWS1/IF_AMP=>DESCRIBEANOMALYDETECTOR()

About DescribeAnomalyDetector

Retrieves detailed information about a specific anomaly detector, including its status and configuration.

Method Signature

METHODS /AWS1/IF_AMP~DESCRIBEANOMALYDETECTOR
  IMPORTING
    !IV_WORKSPACEID TYPE /AWS1/AMPWORKSPACEID OPTIONAL
    !IV_ANOMALYDETECTORID TYPE /AWS1/AMPANOMALYDETECTORID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ampdscanomalydetect01
  RAISING
    /AWS1/CX_AMPACCESSDENIEDEX
    /AWS1/CX_AMPINTERNALSERVEREX
    /AWS1/CX_AMPRESOURCENOTFOUNDEX
    /AWS1/CX_AMPTHROTTLINGEX
    /AWS1/CX_AMPVALIDATIONEX
    /AWS1/CX_AMPCLIENTEXC
    /AWS1/CX_AMPSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_workspaceid TYPE /AWS1/AMPWORKSPACEID /AWS1/AMPWORKSPACEID

The identifier of the workspace containing the anomaly detector.

iv_anomalydetectorid TYPE /AWS1/AMPANOMALYDETECTORID /AWS1/AMPANOMALYDETECTORID

The identifier of the anomaly detector to describe.

RETURNING

oo_output TYPE REF TO /aws1/cl_ampdscanomalydetect01 /AWS1/CL_AMPDSCANOMALYDETECT01

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->describeanomalydetector(
  iv_anomalydetectorid = |string|
  iv_workspaceid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_anomalydetectordescript = lo_result->get_anomalydetector( ).
  IF lo_anomalydetectordescript IS NOT INITIAL.
    lv_anomalydetectorarn = lo_anomalydetectordescript->get_arn( ).
    lv_anomalydetectorid = lo_anomalydetectordescript->get_anomalydetectorid( ).
    lv_anomalydetectoralias = lo_anomalydetectordescript->get_alias( ).
    lv_anomalydetectorevaluati = lo_anomalydetectordescript->get_evalintervalinseconds( ).
    lo_anomalydetectormissingd = lo_anomalydetectordescript->get_missingdataaction( ).
    IF lo_anomalydetectormissingd IS NOT INITIAL.
      lv_boolean = lo_anomalydetectormissingd->get_markasanomaly( ).
      lv_boolean = lo_anomalydetectormissingd->get_skip( ).
    ENDIF.
    lo_anomalydetectorconfigur = lo_anomalydetectordescript->get_configuration( ).
    IF lo_anomalydetectorconfigur IS NOT INITIAL.
      lo_randomcutforestconfigur = lo_anomalydetectorconfigur->get_randomcutforest( ).
      IF lo_randomcutforestconfigur IS NOT INITIAL.
        lv_randomcutforestquery = lo_randomcutforestconfigur->get_query( ).
        lv_integer = lo_randomcutforestconfigur->get_shinglesize( ).
        lv_integer = lo_randomcutforestconfigur->get_samplesize( ).
        lo_ignorenearexpected = lo_randomcutforestconfigur->get_ignorenearexpectedfrma00( ).
        IF lo_ignorenearexpected IS NOT INITIAL.
          lv_double = lo_ignorenearexpected->get_amount( ).
          lv_double = lo_ignorenearexpected->get_ratio( ).
        ENDIF.
        lo_ignorenearexpected = lo_randomcutforestconfigur->get_ignorenearexpectedfrmb00( ).
        IF lo_ignorenearexpected IS NOT INITIAL.
          lv_double = lo_ignorenearexpected->get_amount( ).
          lv_double = lo_ignorenearexpected->get_ratio( ).
        ENDIF.
      ENDIF.
    ENDIF.
    LOOP AT lo_anomalydetectordescript->get_labels( ) into ls_row.
      lv_key = ls_row-key.
      lo_value = ls_row-value.
      IF lo_value IS NOT INITIAL.
        lv_prometheusmetriclabelva = lo_value->get_value( ).
      ENDIF.
    ENDLOOP.
    lo_anomalydetectorstatus = lo_anomalydetectordescript->get_status( ).
    IF lo_anomalydetectorstatus IS NOT INITIAL.
      lv_anomalydetectorstatusco = lo_anomalydetectorstatus->get_statuscode( ).
      lv_string = lo_anomalydetectorstatus->get_statusreason( ).
    ENDIF.
    lv_timestamp = lo_anomalydetectordescript->get_createdat( ).
    lv_timestamp = lo_anomalydetectordescript->get_modifiedat( ).
    LOOP AT lo_anomalydetectordescript->get_tags( ) into ls_row_1.
      lv_key_1 = ls_row_1-key.
      lo_value_1 = ls_row_1-value.
      IF lo_value_1 IS NOT INITIAL.
        lv_tagvalue = lo_value_1->get_value( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDIF.