Skip to content

/AWS1/IF_MPG=>SEARCHAGREEMENTS()

About SearchAgreements

Searches across all agreements that a proposer or an acceptor has in AWS Marketplace. The search returns a list of agreements with basic agreement information.

Method Signature

METHODS /AWS1/IF_MPG~SEARCHAGREEMENTS
  IMPORTING
    !IV_CATALOG TYPE /AWS1/MPGCATALOG OPTIONAL
    !IT_FILTERS TYPE /AWS1/CL_MPGFILTER=>TT_FILTERLIST OPTIONAL
    !IO_SORT TYPE REF TO /AWS1/CL_MPGSORT OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/MPGMAXRESULTS OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/MPGNEXTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mpgsrchagreementsout
  RAISING
    /AWS1/CX_MPGACCESSDENIEDEX
    /AWS1/CX_MPGINTERNALSERVEREX
    /AWS1/CX_MPGTHROTTLINGEX
    /AWS1/CX_MPGVALIDATIONEX
    /AWS1/CX_MPGCLIENTEXC
    /AWS1/CX_MPGSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

iv_catalog TYPE /AWS1/MPGCATALOG /AWS1/MPGCATALOG

The catalog in which the agreement was created.

it_filters TYPE /AWS1/CL_MPGFILTER=>TT_FILTERLIST TT_FILTERLIST

The filter name and value pair used to return a specific list of results.

The following filters are supported:

  • ResourceIdentifier – The unique identifier of the resource.

  • ResourceType – Type of the resource, which is the product (AmiProduct, ContainerProduct, SaaSProduct, ProfessionalServicesProduct, or MachineLearningProduct).

  • PartyType – The party type of the caller. Use Proposer or Acceptor.

  • AcceptorAccountId – The AWS account ID of the party accepting the agreement terms.

  • OfferId – The unique identifier of the offer in which the terms are registered in the agreement token.

  • Status – The current status of the agreement. Values include ACTIVE, CANCELLED, EXPIRED, RENEWED, REPLACED, and TERMINATED.

  • BeforeEndTime – A date used to filter agreements with a date before the endTime of an agreement.

  • AfterEndTime – A date used to filter agreements with a date after the endTime of an agreement.

  • BeforeStartTime – A date used to filter agreements with a date before the startTime of an agreement.

  • AfterStartTime – A date used to filter agreements with a date after the startTime of an agreement.

  • BeforeLastUpdateTime – A date used to filter agreements with a date before the lastUpdateTime of an agreement.

  • AfterLastUpdateTime – A date used to filter agreements with a date after the lastUpdateTime of an agreement.

  • AgreementType – The type of agreement. Supported value includes PurchaseAgreement.

  • OfferSetId – A unique identifier for the offer set containing this offer. All agreements created from offers in this set include this identifier as context.

  • EndTimeBehaviorType – What happens to the agreement when it reaches its end date. Values include RENEW, REPLACE, and EXPIRE.

  • EndTimeBehaviorReasonCode – The reason why the agreement doesn't renew at its end date. Values include PROPOSER_RENEW_OPTED_OUT, ACCEPTOR_RENEW_OPTED_OUT, NO_RENEWAL_TERM, and RENEWAL_LIMIT_EXHAUSTED.

  • InitialAgreementId – The unique identifier of the very first agreement in a chain of related agreements. Use this filter to return every agreement in the same chain.

  • LicenseArn – The Amazon Resource Name (ARN) of the AWS License Manager license associated with an entitlement granted by the agreement.

A proposer can use any combination of the preceding filters along with AgreementType, which is required.

The following filter combinations are supported when the PartyType is Acceptor:

  • AgreementType

  • AgreementType + Status

  • AgreementType + EndTime

  • AgreementType + Status + EndTime

  • AgreementType + ResourceIdentifier

  • AgreementType + ResourceIdentifier + EndTime

  • AgreementType + ResourceIdentifier + Status

  • AgreementType + ResourceIdentifier + Status + EndTime

  • AgreementType + ResourceType

  • AgreementType + ResourceType + EndTime

  • AgreementType + OfferId

  • AgreementType + OfferId + EndTime

  • AgreementType + OfferId + Status

  • AgreementType + OfferId + Status + EndTime

  • AgreementType + OfferSetId

  • AgreementType + OfferSetId + EndTime

  • AgreementType + OfferSetId + Status

  • AgreementType + OfferSetId + Status + EndTime

To filter by EndTime, you can use BeforeEndTime, AfterEndTime, or both.

io_sort TYPE REF TO /AWS1/CL_MPGSORT /AWS1/CL_MPGSORT

An object that contains the SortBy and SortOrder attributes. For SearchAgreements, SortBy supports EndTime for both party types, and StartTime and LastUpdateTime only when PartyType is Proposer. The default SortBy value is EndTime.

iv_maxresults TYPE /AWS1/MPGMAXRESULTS /AWS1/MPGMAXRESULTS

The maximum number of agreements to return in the response.

iv_nexttoken TYPE /AWS1/MPGNEXTTOKEN /AWS1/MPGNEXTTOKEN

A token to specify where to start pagination.

RETURNING

oo_output TYPE REF TO /aws1/cl_mpgsrchagreementsout /AWS1/CL_MPGSRCHAGREEMENTSOUT

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->searchagreements(
  io_sort = new /aws1/cl_mpgsort(
    iv_sortby = |string|
    iv_sortorder = |string|
  )
  it_filters = VALUE /aws1/cl_mpgfilter=>tt_filterlist(
    (
      new /aws1/cl_mpgfilter(
        it_values = VALUE /aws1/cl_mpgfiltervaluelist_w=>tt_filtervaluelist(
          ( new /aws1/cl_mpgfiltervaluelist_w( |string| ) )
        )
        iv_name = |string|
      )
    )
  )
  iv_catalog = |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_agreementviewsummaries( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_resourceid = lo_row_1->get_agreementid( ).
      lv_timestamp = lo_row_1->get_acceptancetime( ).
      lv_timestamp = lo_row_1->get_starttime( ).
      lv_timestamp = lo_row_1->get_endtime( ).
      lv_timestamp = lo_row_1->get_lastupdatetime( ).
      lv_agreementtype = lo_row_1->get_agreementtype( ).
      lo_acceptor = lo_row_1->get_acceptor( ).
      IF lo_acceptor IS NOT INITIAL.
        lv_awsaccountid = lo_acceptor->get_accountid( ).
      ENDIF.
      lo_proposer = lo_row_1->get_proposer( ).
      IF lo_proposer IS NOT INITIAL.
        lv_awsaccountid = lo_proposer->get_accountid( ).
      ENDIF.
      lo_proposalsummary = lo_row_1->get_proposalsummary( ).
      IF lo_proposalsummary IS NOT INITIAL.
        LOOP AT lo_proposalsummary->get_resources( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_resourceid = lo_row_3->get_id( ).
            lv_agreementresourcetype = lo_row_3->get_type( ).
          ENDIF.
        ENDLOOP.
        lv_offerid = lo_proposalsummary->get_offerid( ).
        lv_offersetid = lo_proposalsummary->get_offersetid( ).
      ENDIF.
      lv_agreementstatus = lo_row_1->get_status( ).
      LOOP AT lo_row_1->get_entitlements( ) into lo_row_4.
        lo_row_5 = lo_row_4.
        IF lo_row_5 IS NOT INITIAL.
          lv_string = lo_row_5->get_licensearn( ).
        ENDIF.
      ENDLOOP.
      lv_resourceid = lo_row_1->get_initialagreementid( ).
      lv_endtimebehaviortype = lo_row_1->get_endtimebehaviortype( ).
      lv_endtimebehaviorreasonco = lo_row_1->get_endtimebehaviorrc( ).
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.