Skip to content

/AWS1/CL_GDY=>LISTCOVERAGE()

About ListCoverage

Lists coverage details for your GuardDuty account. If you're a GuardDuty administrator, you can retrieve all resources associated with the active member accounts in your organization.

Make sure the accounts have Runtime Monitoring enabled and GuardDuty agent running on their resources.

Method Signature

IMPORTING

Required arguments:

iv_detectorid TYPE /AWS1/GDYDETECTORID /AWS1/GDYDETECTORID

The unique ID of the detector whose coverage details you want to retrieve.

To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.

Optional arguments:

iv_nexttoken TYPE /AWS1/GDYSTRING /AWS1/GDYSTRING

A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request to a list action. For subsequent calls, use the NextToken value returned from the previous request to continue listing results after the first page.

iv_maxresults TYPE /AWS1/GDYMAXRESULTS /AWS1/GDYMAXRESULTS

The maximum number of results to return in the response.

io_filtercriteria TYPE REF TO /AWS1/CL_GDYCOVERAGEFILTERCRIT /AWS1/CL_GDYCOVERAGEFILTERCRIT

Represents the criteria used to filter the coverage details.

io_sortcriteria TYPE REF TO /AWS1/CL_GDYCOVERAGESORTCRIT /AWS1/CL_GDYCOVERAGESORTCRIT

Represents the criteria used to sort the coverage details.

RETURNING

oo_output TYPE REF TO /aws1/cl_gdylistcoveragersp /AWS1/CL_GDYLISTCOVERAGERSP

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->/aws1/if_gdy~listcoverage(
  io_filtercriteria = new /aws1/cl_gdycoveragefiltercrit(
    it_filtercriterion = VALUE /aws1/cl_gdycoveragefiltcrit00=>tt_coveragefiltercriterionlist(
      (
        new /aws1/cl_gdycoveragefiltcrit00(
          io_filtercondition = new /aws1/cl_gdycoveragefiltercond(
            it_equals = VALUE /aws1/cl_gdyequals_w=>tt_equals(
              ( new /aws1/cl_gdyequals_w( |string| ) )
            )
            it_notequals = VALUE /aws1/cl_gdynotequals_w=>tt_notequals(
              ( new /aws1/cl_gdynotequals_w( |string| ) )
            )
          )
          iv_criterionkey = |string|
        )
      )
    )
  )
  io_sortcriteria = new /aws1/cl_gdycoveragesortcrit(
    iv_attributename = |string|
    iv_orderby = |string|
  )
  iv_detectorid = |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_resources( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_string = lo_row_1->get_resourceid( ).
      lv_detectorid = lo_row_1->get_detectorid( ).
      lv_accountid = lo_row_1->get_accountid( ).
      lo_coverageresourcedetails = lo_row_1->get_resourcedetails( ).
      IF lo_coverageresourcedetails IS NOT INITIAL.
        lo_coverageeksclusterdetai = lo_coverageresourcedetails->get_eksclusterdetails( ).
        IF lo_coverageeksclusterdetai IS NOT INITIAL.
          lv_string = lo_coverageeksclusterdetai->get_clustername( ).
          lv_long = lo_coverageeksclusterdetai->get_coverednodes( ).
          lv_long = lo_coverageeksclusterdetai->get_compatiblenodes( ).
          lo_addondetails = lo_coverageeksclusterdetai->get_addondetails( ).
          IF lo_addondetails IS NOT INITIAL.
            lv_string = lo_addondetails->get_addonversion( ).
            lv_string = lo_addondetails->get_addonstatus( ).
          ENDIF.
          lv_managementtype = lo_coverageeksclusterdetai->get_managementtype( ).
        ENDIF.
        lv_resourcetype = lo_coverageresourcedetails->get_resourcetype( ).
        lo_coverageecsclusterdetai = lo_coverageresourcedetails->get_ecsclusterdetails( ).
        IF lo_coverageecsclusterdetai IS NOT INITIAL.
          lv_string = lo_coverageecsclusterdetai->get_clustername( ).
          lo_fargatedetails = lo_coverageecsclusterdetai->get_fargatedetails( ).
          IF lo_fargatedetails IS NOT INITIAL.
            LOOP AT lo_fargatedetails->get_issues( ) into lo_row_2.
              lo_row_3 = lo_row_2.
              IF lo_row_3 IS NOT INITIAL.
                lv_string = lo_row_3->get_value( ).
              ENDIF.
            ENDLOOP.
            lv_managementtype = lo_fargatedetails->get_managementtype( ).
          ENDIF.
          lo_containerinstancedetail = lo_coverageecsclusterdetai->get_containerinstancedetails( ).
          IF lo_containerinstancedetail IS NOT INITIAL.
            lv_long = lo_containerinstancedetail->get_coveredcontainerinsts( ).
            lv_long = lo_containerinstancedetail->get_compatiblecontainerinsts( ).
          ENDIF.
        ENDIF.
        lo_coverageec2instancedeta = lo_coverageresourcedetails->get_ec2instancedetails( ).
        IF lo_coverageec2instancedeta IS NOT INITIAL.
          lv_string = lo_coverageec2instancedeta->get_instanceid( ).
          lv_string = lo_coverageec2instancedeta->get_instancetype( ).
          lv_string = lo_coverageec2instancedeta->get_clusterarn( ).
          lo_agentdetails = lo_coverageec2instancedeta->get_agentdetails( ).
          IF lo_agentdetails IS NOT INITIAL.
            lv_string = lo_agentdetails->get_version( ).
          ENDIF.
          lv_managementtype = lo_coverageec2instancedeta->get_managementtype( ).
        ENDIF.
      ENDIF.
      lv_coveragestatus = lo_row_1->get_coveragestatus( ).
      lv_string = lo_row_1->get_issue( ).
      lv_timestamp = lo_row_1->get_updatedat( ).
    ENDIF.
  ENDLOOP.
  lv_string = lo_result->get_nexttoken( ).
ENDIF.