Skip to content

/AWS1/IF_CNT=>DESCRIBEMETRIC()

About DescribeMetric

Retrieves the full definition of an existing metric from the specified Connect Customer instance.

Method Signature

METHODS /AWS1/IF_CNT~DESCRIBEMETRIC
  IMPORTING
    !IV_INSTANCEID TYPE /AWS1/CNTINSTANCEID OPTIONAL
    !IV_METRICID TYPE /AWS1/CNTMETRICID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cntdescrmetricrsp
  RAISING
    /AWS1/CX_CNTACCESSDENIEDEX
    /AWS1/CX_CNTINTERNALSERVICEEX
    /AWS1/CX_CNTINVALIDPARAMETEREX
    /AWS1/CX_CNTINVALIDREQUESTEX
    /AWS1/CX_CNTRESOURCENOTFOUNDEX
    /AWS1/CX_CNTTHROTTLINGEX
    /AWS1/CX_CNTCLIENTEXC
    /AWS1/CX_CNTSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_instanceid TYPE /AWS1/CNTINSTANCEID /AWS1/CNTINSTANCEID

The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

iv_metricid TYPE /AWS1/CNTMETRICID /AWS1/CNTMETRICID

The identifier of the metric to describe. Adding the $SAVED qualifier will describe the saved version of the metric. Adding $LATEST or omitting a qualifier will describe the published version.

RETURNING

oo_output TYPE REF TO /aws1/cl_cntdescrmetricrsp /AWS1/CL_CNTDESCRMETRICRSP

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->describemetric(
  iv_instanceid = |string|
  iv_metricid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_metricdefinition = lo_result->get_metric( ).
  IF lo_metricdefinition IS NOT INITIAL.
    lv_arn = lo_metricdefinition->get_arn( ).
    lv_metricid = lo_metricdefinition->get_id( ).
    lv_metricname = lo_metricdefinition->get_name( ).
    lv_metricdescription = lo_metricdefinition->get_description( ).
    lo_metriccalculation = lo_metricdefinition->get_metriccalculation( ).
    IF lo_metriccalculation IS NOT INITIAL.
      LOOP AT lo_metriccalculation->get_calculationcomponents( ) into lo_row.
        lo_row_1 = lo_row.
        IF lo_row_1 IS NOT INITIAL.
          lv_componentalias = lo_row_1->get_alias( ).
          lv_metricname = lo_row_1->get_metricname( ).
          lv_metricid = lo_row_1->get_metricid( ).
          LOOP AT lo_row_1->get_metricfilters( ) into lo_row_2.
            lo_row_3 = lo_row_2.
            IF lo_row_3 IS NOT INITIAL.
              lv_metricfilterkey = lo_row_3->get_metricfilterkey( ).
              lv_boolean = lo_row_3->get_negate( ).
              lo_metricfilternumbercondi = lo_row_3->get_numbercondition( ).
              IF lo_metricfilternumbercondi IS NOT INITIAL.
                lv_metricfilternumbercondi_1 = lo_metricfilternumbercondi->get_comparison( ).
                LOOP AT lo_metricfilternumbercondi->get_values( ) into lo_row_4.
                  lo_row_5 = lo_row_4.
                  IF lo_row_5 IS NOT INITIAL.
                    lv_double = lo_row_5->get_value( ).
                  ENDIF.
                ENDLOOP.
              ENDIF.
              lo_metricfilterstringcondi = lo_row_3->get_stringcondition( ).
              IF lo_metricfilterstringcondi IS NOT INITIAL.
                lv_metricfilterstringcondi_1 = lo_metricfilterstringcondi->get_comparison( ).
                LOOP AT lo_metricfilterstringcondi->get_values( ) into lo_row_6.
                  lo_row_7 = lo_row_6.
                  IF lo_row_7 IS NOT INITIAL.
                    lv_string = lo_row_7->get_value( ).
                  ENDIF.
                ENDLOOP.
              ENDIF.
              lo_metricfilterbooleancond = lo_row_3->get_booleancondition( ).
              IF lo_metricfilterbooleancond IS NOT INITIAL.
                lv_metricfilterbooleancond_1 = lo_metricfilterbooleancond->get_comparison( ).
              ENDIF.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
      lv_calculationexpression = lo_metriccalculation->get_calculation( ).
    ENDIF.
    lv_metriccreationmethod = lo_metricdefinition->get_creationmethod( ).
    lv_metricstatus = lo_metricdefinition->get_status( ).
    lv_metrictype = lo_metricdefinition->get_type( ).
    lv_metricunit = lo_metricdefinition->get_unit( ).
    lv_trendindicator = lo_metricdefinition->get_positivetrendindicator( ).
    LOOP AT lo_metricdefinition->get_groupings( ) into lo_row_8.
      lo_row_9 = lo_row_8.
      IF lo_row_9 IS NOT INITIAL.
        lv_string = lo_row_9->get_value( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_metricdefinition->get_filters( ) into lo_row_10.
      lo_row_11 = lo_row_10.
      IF lo_row_11 IS NOT INITIAL.
        lv_filterid = lo_row_11->get_id( ).
        lv_availablefiltertype = lo_row_11->get_type( ).
      ENDIF.
    ENDLOOP.
    lv_timestamp = lo_metricdefinition->get_effectivetime( ).
    lv_refreshrate = lo_metricdefinition->get_refreshrate( ).
    lv_metriccategory = lo_metricdefinition->get_category( ).
    LOOP AT lo_metricdefinition->get_supportedstats( ) into lo_row_12.
      lo_row_13 = lo_row_12.
      IF lo_row_13 IS NOT INITIAL.
        lv_string = lo_row_13->get_value( ).
      ENDIF.
    ENDLOOP.
    lv_defaultstat = lo_metricdefinition->get_defaultstat( ).
    lv_supportspreaggregatecal = lo_metricdefinition->get_supportspreaggregatecalc( ).
    lv_supportscustomcalculati = lo_metricdefinition->get_supportscustomcalc( ).
    lv_primaryeventsource = lo_metricdefinition->get_primaryeventsource( ).
    lv_primaryeventsourceeffec = lo_metricdefinition->get_prmryevsrceffctvetsmptyp( ).
    lv_timestamp = lo_metricdefinition->get_createdtime( ).
    lo_createdbyinfo = lo_metricdefinition->get_createduser( ).
    IF lo_createdbyinfo IS NOT INITIAL.
      lv_arn = lo_createdbyinfo->get_connectuserarn( ).
      lv_arn = lo_createdbyinfo->get_awsidentityarn( ).
    ENDIF.
    lv_regionname = lo_metricdefinition->get_lastmodifiedregion( ).
    lv_timestamp = lo_metricdefinition->get_lastmodifiedtime( ).
    lo_createdbyinfo = lo_metricdefinition->get_lastmodifieduser( ).
    IF lo_createdbyinfo IS NOT INITIAL.
      lv_arn = lo_createdbyinfo->get_connectuserarn( ).
      lv_arn = lo_createdbyinfo->get_awsidentityarn( ).
    ENDIF.
    LOOP AT lo_metricdefinition->get_tags( ) into ls_row_14.
      lv_key = ls_row_14-key.
      lo_value = ls_row_14-value.
      IF lo_value IS NOT INITIAL.
        lv_tagvalue = lo_value->get_value( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDIF.