Skip to content

/AWS1/IF_SHB=>GETRESOURCESTRENDSV2()

About GetResourcesTrendsV2

Returns resource trend data based on the specified criteria. This operation helps you analyze patterns and changes in resource compliance over time.

Method Signature

METHODS /AWS1/IF_SHB~GETRESOURCESTRENDSV2
  IMPORTING
    !IO_FILTERS TYPE REF TO /AWS1/CL_SHBRESTRENDSFILTERS OPTIONAL
    !IV_STARTTIME TYPE /AWS1/SHBTIMESTAMP OPTIONAL
    !IV_ENDTIME TYPE /AWS1/SHBTIMESTAMP OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/SHBNEXTTOKEN OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/SHBMAXRESULTS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_shbgetrestrendsv2rsp
  RAISING
    /AWS1/CX_SHBACCESSDENIEDEX
    /AWS1/CX_SHBINTERNALSERVEREX
    /AWS1/CX_SHBTHROTTLINGEX
    /AWS1/CX_SHBVALIDATIONEX
    /AWS1/CX_SHBCLIENTEXC
    /AWS1/CX_SHBSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_starttime TYPE /AWS1/SHBTIMESTAMP /AWS1/SHBTIMESTAMP

The starting timestamp for the time period to analyze resources trends, in ISO 8601 format.

iv_endtime TYPE /AWS1/SHBTIMESTAMP /AWS1/SHBTIMESTAMP

The ending timestamp for the time period to analyze resources trends, in ISO 8601 format.

Optional arguments:

io_filters TYPE REF TO /AWS1/CL_SHBRESTRENDSFILTERS /AWS1/CL_SHBRESTRENDSFILTERS

The filters to apply to the resources trend data.

iv_nexttoken TYPE /AWS1/SHBNEXTTOKEN /AWS1/SHBNEXTTOKEN

The token to use for paginating results. This value is returned in the response if more results are available.

iv_maxresults TYPE /AWS1/SHBMAXRESULTS /AWS1/SHBMAXRESULTS

The maximum number of trend data points to return in a single response.

RETURNING

oo_output TYPE REF TO /aws1/cl_shbgetrestrendsv2rsp /AWS1/CL_SHBGETRESTRENDSV2RSP

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->getresourcestrendsv2(
  io_filters = new /aws1/cl_shbrestrendsfilters(
    it_compositefilters = VALUE /aws1/cl_shbrestrendscomposi00=>tt_restrendscompositefiltlist(
      (
        new /aws1/cl_shbrestrendscomposi00(
          it_nestedcompositefilters = VALUE /aws1/cl_shbrestrendscomposi00=>tt_restrendscompositefiltlist(
          )
          it_stringfilters = VALUE /aws1/cl_shbrestrendsstrfilter=>tt_restrendsstringfilterlist(
            (
              new /aws1/cl_shbrestrendsstrfilter(
                io_filter = new /aws1/cl_shbstringfilter(
                  iv_comparison = |string|
                  iv_value = |string|
                )
                iv_fieldname = |string|
              )
            )
          )
          iv_operator = |string|
        )
      )
    )
    iv_compositeoperator = |string|
  )
  iv_endtime = '20150101000000.0000000'
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_starttime = '20150101000000.0000000'
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_granularityfield = lo_result->get_granularity( ).
  LOOP AT lo_result->get_trendsmetrics( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_timestamp = lo_row_1->get_timestamp( ).
      lo_resourcestrendsvalues = lo_row_1->get_trendsvalues( ).
      IF lo_resourcestrendsvalues IS NOT INITIAL.
        lo_resourcescount = lo_resourcestrendsvalues->get_resourcescount( ).
        IF lo_resourcescount IS NOT INITIAL.
          lv_trendsvaluecount = lo_resourcescount->get_allresources( ).
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.