Skip to content

/AWS1/IF_MPC=>LISTASSESSMENTS()

About ListAssessments

Returns a paginated list of assessments associated with an entity or change set in AWS Marketplace. An assessment is the result of evaluating a product or change set against a framework, such as AMI Security or Container Security.

Use the AssessmentTargetFilter to scope results to a specific entity or change set, and use FrameworkFilters to scope results to a single framework. To retrieve detailed control-level results for an individual assessment, use the DescribeAssessment action.

Results are sorted by assessment creation time in descending order.

Method Signature

METHODS /AWS1/IF_MPC~LISTASSESSMENTS
  IMPORTING
    !IV_CATALOG TYPE /AWS1/MPCCATALOG OPTIONAL
    !IV_FRAMEWORKID TYPE /AWS1/MPCFRAMEWORKID OPTIONAL
    !IO_ASSESSMENTTARGETFILTER TYPE REF TO /AWS1/CL_MPCASSMNTTARGETFILTER OPTIONAL
    !IO_FRAMEWORKFILTERS TYPE REF TO /AWS1/CL_MPCFRAMEWORKFILTERS OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/MPCLISTASSMTSMAXRSLTINT OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/MPCNEXTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mpclistassmtsresponse
  RAISING
    /AWS1/CX_MPCACCESSDENIEDEX
    /AWS1/CX_MPCINTERNALSERVICEEX
    /AWS1/CX_MPCTHROTTLINGEX
    /AWS1/CX_MPCVALIDATIONEX
    /AWS1/CX_MPCCLIENTEXC
    /AWS1/CX_MPCSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_catalog TYPE /AWS1/MPCCATALOG /AWS1/MPCCATALOG

The catalog related to the request. Fixed value: AWSMarketplace

Optional arguments:

iv_frameworkid TYPE /AWS1/MPCFRAMEWORKID /AWS1/MPCFRAMEWORKID

The unique identifier of a framework. When specified, only assessments performed against this framework are returned. For example, AMISecurity.

io_assessmenttargetfilter TYPE REF TO /AWS1/CL_MPCASSMNTTARGETFILTER /AWS1/CL_MPCASSMNTTARGETFILTER

Filters the list of assessments to those performed against a specific entity or change set.

io_frameworkfilters TYPE REF TO /AWS1/CL_MPCFRAMEWORKFILTERS /AWS1/CL_MPCFRAMEWORKFILTERS

Framework-specific filters. Set exactly one member to filter results to assessments performed against that framework.

iv_maxresults TYPE /AWS1/MPCLISTASSMTSMAXRSLTINT /AWS1/MPCLISTASSMTSMAXRSLTINT

Specifies the upper limit of the elements on a single page. If a value isn't provided, the default value is 20. Valid values range from 1 to 100.

iv_nexttoken TYPE /AWS1/MPCNEXTTOKEN /AWS1/MPCNEXTTOKEN

The value of the next token, if it exists. null if there are no more results.

RETURNING

oo_output TYPE REF TO /aws1/cl_mpclistassmtsresponse /AWS1/CL_MPCLISTASSMTSRESPONSE

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->listassessments(
  io_assessmenttargetfilter = new /aws1/cl_mpcassmnttargetfilter(
    iv_changesetid = |string|
    iv_entityid = |string|
  )
  io_frameworkfilters = new /aws1/cl_mpcframeworkfilters(
    io_amisecurityfilters = new /aws1/cl_mpcamisecurityfilters( |string| )
    io_containersecurityfilters = new /aws1/cl_mpccontnrsecfilters( |string| )
  )
  iv_catalog = |string|
  iv_frameworkid = |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_assessmentsummarylist( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_arn = lo_row_1->get_assessmentarn( ).
      lv_resourceid = lo_row_1->get_assessmentid( ).
      lv_versionedframeworkid = lo_row_1->get_frameworkid( ).
      lo_assessmenttargetsummary = lo_row_1->get_assessmenttargetsummary( ).
      IF lo_assessmenttargetsummary IS NOT INITIAL.
        lv_resourceid = lo_assessmenttargetsummary->get_entityid( ).
        lv_resourceid = lo_assessmenttargetsummary->get_changesetid( ).
      ENDIF.
      lo_frameworksummary = lo_row_1->get_frameworksummary( ).
      IF lo_frameworksummary IS NOT INITIAL.
        lo_amisecuritysummary = lo_frameworksummary->get_amisecuritysummary( ).
        IF lo_amisecuritysummary IS NOT INITIAL.
          lv_resourceid = lo_amisecuritysummary->get_deliveryoptionid( ).
        ENDIF.
        lo_containersecuritysummar = lo_frameworksummary->get_containersecuritysummary( ).
        IF lo_containersecuritysummar IS NOT INITIAL.
          lv_resourceid = lo_containersecuritysummar->get_deliveryoptionid( ).
        ENDIF.
      ENDIF.
      lv_assessmentresult = lo_row_1->get_assessmentresult( ).
      lv_datetimeiso8601 = lo_row_1->get_createdat( ).
      lv_datetimeiso8601 = lo_row_1->get_expiresat( ).
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.