Skip to content

/AWS1/IF_BDO=>GETMEMORY()

About GetMemory

Retrieve an existing Amazon Bedrock AgentCore Memory resource.

Method Signature

METHODS /AWS1/IF_BDO~GETMEMORY
  IMPORTING
    !IV_MEMORYID TYPE /AWS1/BDOMEMORYID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdogetmemoryoutput
  RAISING
    /AWS1/CX_BDOACCESSDENIEDEX
    /AWS1/CX_BDORESOURCENOTFOUNDEX
    /AWS1/CX_BDOSERVICEEXCEPTION
    /AWS1/CX_BDOTHROTTLEDEXCEPTION
    /AWS1/CX_BDOVALIDATIONEX
    /AWS1/CX_BDOCLIENTEXC
    /AWS1/CX_BDOSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_memoryid TYPE /AWS1/BDOMEMORYID /AWS1/BDOMEMORYID

The unique identifier of the memory to retrieve.

RETURNING

oo_output TYPE REF TO /aws1/cl_bdogetmemoryoutput /AWS1/CL_BDOGETMEMORYOUTPUT

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->getmemory( |string| ).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_memory = lo_result->get_memory( ).
  IF lo_memory IS NOT INITIAL.
    lv_memoryarn = lo_memory->get_arn( ).
    lv_memoryid = lo_memory->get_id( ).
    lv_name = lo_memory->get_name( ).
    lv_description = lo_memory->get_description( ).
    lv_arn = lo_memory->get_encryptionkeyarn( ).
    lv_arn = lo_memory->get_memoryexecutionrolearn( ).
    lv_integer = lo_memory->get_eventexpiryduration( ).
    lv_memorystatus = lo_memory->get_status( ).
    lv_string = lo_memory->get_failurereason( ).
    lv_timestamp = lo_memory->get_createdat( ).
    lv_timestamp = lo_memory->get_updatedat( ).
    LOOP AT lo_memory->get_strategies( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_memorystrategyid = lo_row_1->get_strategyid( ).
        lv_name = lo_row_1->get_name( ).
        lv_description = lo_row_1->get_description( ).
        lo_strategyconfiguration = lo_row_1->get_configuration( ).
        IF lo_strategyconfiguration IS NOT INITIAL.
          lv_overridetype = lo_strategyconfiguration->get_type( ).
          lo_extractionconfiguration = lo_strategyconfiguration->get_extraction( ).
          IF lo_extractionconfiguration IS NOT INITIAL.
            lo_customextractionconfigu = lo_extractionconfiguration->get_customextractionconf( ).
            IF lo_customextractionconfigu IS NOT INITIAL.
              lo_semanticextractionoverr = lo_customextractionconfigu->get_semanticextoverride( ).
              IF lo_semanticextractionoverr IS NOT INITIAL.
                lv_prompt = lo_semanticextractionoverr->get_appendtoprompt( ).
                lv_string = lo_semanticextractionoverr->get_modelid( ).
              ENDIF.
              lo_userpreferenceextractio = lo_customextractionconfigu->get_userprefextoverride( ).
              IF lo_userpreferenceextractio IS NOT INITIAL.
                lv_prompt = lo_userpreferenceextractio->get_appendtoprompt( ).
                lv_string = lo_userpreferenceextractio->get_modelid( ).
              ENDIF.
              lo_episodicextractionoverr = lo_customextractionconfigu->get_episodicextoverride( ).
              IF lo_episodicextractionoverr IS NOT INITIAL.
                lv_prompt = lo_episodicextractionoverr->get_appendtoprompt( ).
                lv_string = lo_episodicextractionoverr->get_modelid( ).
              ENDIF.
            ENDIF.
          ENDIF.
          lo_consolidationconfigurat = lo_strategyconfiguration->get_consolidation( ).
          IF lo_consolidationconfigurat IS NOT INITIAL.
            lo_customconsolidationconf = lo_consolidationconfigurat->get_customconsolconf( ).
            IF lo_customconsolidationconf IS NOT INITIAL.
              lo_semanticconsolidationov = lo_customconsolidationconf->get_semanticconsoloverride( ).
              IF lo_semanticconsolidationov IS NOT INITIAL.
                lv_prompt = lo_semanticconsolidationov->get_appendtoprompt( ).
                lv_string = lo_semanticconsolidationov->get_modelid( ).
              ENDIF.
              lo_summaryconsolidationove = lo_customconsolidationconf->get_summaryconsoloverride( ).
              IF lo_summaryconsolidationove IS NOT INITIAL.
                lv_prompt = lo_summaryconsolidationove->get_appendtoprompt( ).
                lv_string = lo_summaryconsolidationove->get_modelid( ).
              ENDIF.
              lo_userpreferenceconsolida = lo_customconsolidationconf->get_userprefconsoloverride( ).
              IF lo_userpreferenceconsolida IS NOT INITIAL.
                lv_prompt = lo_userpreferenceconsolida->get_appendtoprompt( ).
                lv_string = lo_userpreferenceconsolida->get_modelid( ).
              ENDIF.
              lo_episodicconsolidationov = lo_customconsolidationconf->get_episodicconsoloverride( ).
              IF lo_episodicconsolidationov IS NOT INITIAL.
                lv_prompt = lo_episodicconsolidationov->get_appendtoprompt( ).
                lv_string = lo_episodicconsolidationov->get_modelid( ).
              ENDIF.
            ENDIF.
          ENDIF.
          lo_reflectionconfiguration = lo_strategyconfiguration->get_reflection( ).
          IF lo_reflectionconfiguration IS NOT INITIAL.
            lo_customreflectionconfigu = lo_reflectionconfiguration->get_customreflectionconf( ).
            IF lo_customreflectionconfigu IS NOT INITIAL.
              lo_episodicreflectionoverr = lo_customreflectionconfigu->get_episodicreflectionovrd( ).
              IF lo_episodicreflectionoverr IS NOT INITIAL.
                lv_prompt = lo_episodicreflectionoverr->get_appendtoprompt( ).
                lv_string = lo_episodicreflectionoverr->get_modelid( ).
                LOOP AT lo_episodicreflectionoverr->get_namespaces( ) into lo_row_2.
                  lo_row_3 = lo_row_2.
                  IF lo_row_3 IS NOT INITIAL.
                    lv_namespace = lo_row_3->get_value( ).
                  ENDIF.
                ENDLOOP.
              ENDIF.
            ENDIF.
            lo_episodicreflectionconfi = lo_reflectionconfiguration->get_episodicreflectionconf( ).
            IF lo_episodicreflectionconfi IS NOT INITIAL.
              LOOP AT lo_episodicreflectionconfi->get_namespaces( ) into lo_row_2.
                lo_row_3 = lo_row_2.
                IF lo_row_3 IS NOT INITIAL.
                  lv_namespace = lo_row_3->get_value( ).
                ENDIF.
              ENDLOOP.
            ENDIF.
          ENDIF.
          lo_selfmanagedconfiguratio = lo_strategyconfiguration->get_selfmanagedconfiguration( ).
          IF lo_selfmanagedconfiguratio IS NOT INITIAL.
            LOOP AT lo_selfmanagedconfiguratio->get_triggerconditions( ) into lo_row_4.
              lo_row_5 = lo_row_4.
              IF lo_row_5 IS NOT INITIAL.
                lo_messagebasedtrigger = lo_row_5->get_messagebasedtrigger( ).
                IF lo_messagebasedtrigger IS NOT INITIAL.
                  lv_integer = lo_messagebasedtrigger->get_messagecount( ).
                ENDIF.
                lo_tokenbasedtrigger = lo_row_5->get_tokenbasedtrigger( ).
                IF lo_tokenbasedtrigger IS NOT INITIAL.
                  lv_integer = lo_tokenbasedtrigger->get_tokencount( ).
                ENDIF.
                lo_timebasedtrigger = lo_row_5->get_timebasedtrigger( ).
                IF lo_timebasedtrigger IS NOT INITIAL.
                  lv_integer = lo_timebasedtrigger->get_idlesessiontimeout( ).
                ENDIF.
              ENDIF.
            ENDLOOP.
            lo_invocationconfiguration = lo_selfmanagedconfiguratio->get_invocationconfiguration( ).
            IF lo_invocationconfiguration IS NOT INITIAL.
              lv_arn = lo_invocationconfiguration->get_topicarn( ).
              lv_string = lo_invocationconfiguration->get_payloaddlvrybucketname( ).
            ENDIF.
            lv_integer = lo_selfmanagedconfiguratio->get_historicalctxwindowsize( ).
          ENDIF.
        ENDIF.
        lv_memorystrategytype = lo_row_1->get_type( ).
        LOOP AT lo_row_1->get_namespaces( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_namespace = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
        lv_timestamp = lo_row_1->get_createdat( ).
        lv_timestamp = lo_row_1->get_updatedat( ).
        lv_memorystrategystatus = lo_row_1->get_status( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDIF.