Skip to content

/AWS1/IF_CNT=>SEARCHMETRICS()

About SearchMetrics

Searches for metrics in the specified Connect Customer instance using search criteria and optional tag-based filters. Use pagination to ensure that the operation returns quickly and successfully.

Method Signature

METHODS /AWS1/IF_CNT~SEARCHMETRICS
  IMPORTING
    !IV_INSTANCEID TYPE /AWS1/CNTINSTANCEID OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/CNTNEXTTOKEN OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/CNTMAXRESULT100 OPTIONAL
    !IO_SEARCHFILTER TYPE REF TO /AWS1/CL_CNTMETRICSEARCHFILTER OPTIONAL
    !IO_SEARCHCRITERIA TYPE REF TO /AWS1/CL_CNTMETRICSEARCHCRIT OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cntsearchmetricsrsp
  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.

Optional arguments:

iv_nexttoken TYPE /AWS1/CNTNEXTTOKEN /AWS1/CNTNEXTTOKEN

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

iv_maxresults TYPE /AWS1/CNTMAXRESULT100 /AWS1/CNTMAXRESULT100

The maximum number of results to return per page.

io_searchfilter TYPE REF TO /AWS1/CL_CNTMETRICSEARCHFILTER /AWS1/CL_CNTMETRICSEARCHFILTER

Filters to be applied to search results.

io_searchcriteria TYPE REF TO /AWS1/CL_CNTMETRICSEARCHCRIT /AWS1/CL_CNTMETRICSEARCHCRIT

The search criteria to filter the metrics.

RETURNING

oo_output TYPE REF TO /aws1/cl_cntsearchmetricsrsp /AWS1/CL_CNTSEARCHMETRICSRSP

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->searchmetrics(
  io_searchcriteria = new /aws1/cl_cntmetricsearchcrit(
    io_booleancondition = new /aws1/cl_cntbooleancondition(
      iv_comparisontype = |string|
      iv_fieldname = |string|
    )
    io_stringcondition = new /aws1/cl_cntstringcondition(
      iv_comparisontype = |string|
      iv_fieldname = |string|
      iv_value = |string|
    )
    it_andconditions = VALUE /aws1/cl_cntmetricsearchcrit=>tt_metricsearchconditionlist(
      (
        new /aws1/cl_cntmetricsearchcrit(
          io_booleancondition = new /aws1/cl_cntbooleancondition(
            iv_comparisontype = |string|
            iv_fieldname = |string|
          )
          io_stringcondition = new /aws1/cl_cntstringcondition(
            iv_comparisontype = |string|
            iv_fieldname = |string|
            iv_value = |string|
          )
          it_orconditions = VALUE /aws1/cl_cntmetricsearchcrit=>tt_metricsearchconditionlist(
          )
        )
      )
    )
    it_orconditions = VALUE /aws1/cl_cntmetricsearchcrit=>tt_metricsearchconditionlist(
      (
        new /aws1/cl_cntmetricsearchcrit(
          io_booleancondition = new /aws1/cl_cntbooleancondition(
            iv_comparisontype = |string|
            iv_fieldname = |string|
          )
          io_stringcondition = new /aws1/cl_cntstringcondition(
            iv_comparisontype = |string|
            iv_fieldname = |string|
            iv_value = |string|
          )
          it_andconditions = VALUE /aws1/cl_cntmetricsearchcrit=>tt_metricsearchconditionlist(
          )
        )
      )
    )
  )
  io_searchfilter = new /aws1/cl_cntmetricsearchfilter(
    io_tagfilter = new /aws1/cl_cntctlplanetagfilter(
      io_tagcondition = new /aws1/cl_cnttagcondition(
        iv_tagkey = |string|
        iv_tagvalue = |string|
      )
      it_andconditions = VALUE /aws1/cl_cnttagcondition=>tt_tagandconditionlist(
        (
          new /aws1/cl_cnttagcondition(
            iv_tagkey = |string|
            iv_tagvalue = |string|
          )
        )
      )
      it_orconditions = VALUE /aws1/cl_cnttagcondition=>tt_tagorconditionlist(
        (
          VALUE /aws1/cl_cnttagcondition=>tt_tagandconditionlist(
            (
              new /aws1/cl_cnttagcondition(
                iv_tagkey = |string|
                iv_tagvalue = |string|
              )
            )
          )
        )
      )
    )
  )
  iv_instanceid = |string|
  iv_maxresults = 123
  iv_nexttoken = |string|
).

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