Skip to content

/AWS1/IF_BDO=>CREATEGATEWAYTARGET()

About CreateGatewayTarget

Creates a target for a gateway. A target defines an endpoint that the gateway can connect to.

To create a target, you must specify the gateway identifier and target configuration.

Method Signature

IMPORTING

Required arguments:

iv_gatewayidentifier TYPE /AWS1/BDOGATEWAYIDENTIFIER /AWS1/BDOGATEWAYIDENTIFIER

The identifier of the gateway to create a target for. This can be either the gateway ID or the gateway ARN.

iv_name TYPE /AWS1/BDOTARGETNAME /AWS1/BDOTARGETNAME

The name of the gateway target. The name must be unique within the gateway.

io_targetconfiguration TYPE REF TO /AWS1/CL_BDOTARGETCONF /AWS1/CL_BDOTARGETCONF

The configuration settings for the target, including endpoint information and schema definitions.

it_credentialproviderconfs TYPE /AWS1/CL_BDOCREDPROVIDERCONF=>TT_CREDENTIALPROVIDERCONFS TT_CREDENTIALPROVIDERCONFS

The credential provider configurations for the target. These configurations specify how the gateway authenticates with the target endpoint.

Optional arguments:

iv_description TYPE /AWS1/BDOTARGETDESCRIPTION /AWS1/BDOTARGETDESCRIPTION

The description of the gateway target.

iv_clienttoken TYPE /AWS1/BDOCLIENTTOKEN /AWS1/BDOCLIENTTOKEN

A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request but does not return an error.

RETURNING

oo_output TYPE REF TO /aws1/cl_bdocreategwtargetrsp /AWS1/CL_BDOCREATEGWTARGETRSP

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_bdo~creategatewaytarget(
  io_targetconfiguration = new /aws1/cl_bdotargetconf(
    io_mcp = new /aws1/cl_bdomcptargetconf(
      io_lambda = new /aws1/cl_bdomcplmdtargetconf(
        io_toolschema = new /aws1/cl_bdotoolschema(
          io_s3 = new /aws1/cl_bdos3configuration(
            iv_bucketowneraccountid = |string|
            iv_uri = |string|
          )
          it_inlinepayload = VALUE /aws1/cl_bdotooldefinition=>tt_tooldefinitions(
            (
              new /aws1/cl_bdotooldefinition(
                io_inputschema = new /aws1/cl_bdoschemadefinition(
                  io_items = new /aws1/cl_bdoschemadefinition(
                    it_properties = VALUE /aws1/cl_bdoschemadefinition=>tt_schemaproperties(
                      (
                        VALUE /aws1/cl_bdoschemadefinition=>ts_schemaproperties_maprow(
                          key = |string|
                          value = new /aws1/cl_bdoschemadefinition(
                            it_required = VALUE /aws1/cl_bdorequiredprops_w=>tt_requiredproperties(
                              ( new /aws1/cl_bdorequiredprops_w( |string| ) )
                            )
                            iv_description = |string|
                            iv_type = |string|
                          )
                        )
                      )
                    )
                    it_required = VALUE /aws1/cl_bdorequiredprops_w=>tt_requiredproperties(
                      ( new /aws1/cl_bdorequiredprops_w( |string| ) )
                    )
                    iv_description = |string|
                    iv_type = |string|
                  )
                  it_properties = VALUE /aws1/cl_bdoschemadefinition=>tt_schemaproperties(
                    (
                      VALUE /aws1/cl_bdoschemadefinition=>ts_schemaproperties_maprow(
                        key = |string|
                        value = new /aws1/cl_bdoschemadefinition(
                          io_items = new /aws1/cl_bdoschemadefinition(
                            it_required = VALUE /aws1/cl_bdorequiredprops_w=>tt_requiredproperties(
                              ( new /aws1/cl_bdorequiredprops_w( |string| ) )
                            )
                            iv_description = |string|
                            iv_type = |string|
                          )
                          it_required = VALUE /aws1/cl_bdorequiredprops_w=>tt_requiredproperties(
                            ( new /aws1/cl_bdorequiredprops_w( |string| ) )
                          )
                          iv_description = |string|
                          iv_type = |string|
                        )
                      )
                    )
                  )
                  it_required = VALUE /aws1/cl_bdorequiredprops_w=>tt_requiredproperties(
                    ( new /aws1/cl_bdorequiredprops_w( |string| ) )
                  )
                  iv_description = |string|
                  iv_type = |string|
                )
                io_outputschema = new /aws1/cl_bdoschemadefinition(
                  io_items = new /aws1/cl_bdoschemadefinition(
                    it_properties = VALUE /aws1/cl_bdoschemadefinition=>tt_schemaproperties(
                      (
                        VALUE /aws1/cl_bdoschemadefinition=>ts_schemaproperties_maprow(
                          key = |string|
                          value = new /aws1/cl_bdoschemadefinition(
                            it_required = VALUE /aws1/cl_bdorequiredprops_w=>tt_requiredproperties(
                              ( new /aws1/cl_bdorequiredprops_w( |string| ) )
                            )
                            iv_description = |string|
                            iv_type = |string|
                          )
                        )
                      )
                    )
                    it_required = VALUE /aws1/cl_bdorequiredprops_w=>tt_requiredproperties(
                      ( new /aws1/cl_bdorequiredprops_w( |string| ) )
                    )
                    iv_description = |string|
                    iv_type = |string|
                  )
                  it_properties = VALUE /aws1/cl_bdoschemadefinition=>tt_schemaproperties(
                    (
                      VALUE /aws1/cl_bdoschemadefinition=>ts_schemaproperties_maprow(
                        key = |string|
                        value = new /aws1/cl_bdoschemadefinition(
                          io_items = new /aws1/cl_bdoschemadefinition(
                            it_required = VALUE /aws1/cl_bdorequiredprops_w=>tt_requiredproperties(
                              ( new /aws1/cl_bdorequiredprops_w( |string| ) )
                            )
                            iv_description = |string|
                            iv_type = |string|
                          )
                          it_required = VALUE /aws1/cl_bdorequiredprops_w=>tt_requiredproperties(
                            ( new /aws1/cl_bdorequiredprops_w( |string| ) )
                          )
                          iv_description = |string|
                          iv_type = |string|
                        )
                      )
                    )
                  )
                  it_required = VALUE /aws1/cl_bdorequiredprops_w=>tt_requiredproperties(
                    ( new /aws1/cl_bdorequiredprops_w( |string| ) )
                  )
                  iv_description = |string|
                  iv_type = |string|
                )
                iv_description = |string|
                iv_name = |string|
              )
            )
          )
        )
        iv_lambdaarn = |string|
      )
      io_openapischema = new /aws1/cl_bdoapischemaconf(
        io_s3 = new /aws1/cl_bdos3configuration(
          iv_bucketowneraccountid = |string|
          iv_uri = |string|
        )
        iv_inlinepayload = |string|
      )
      io_smithymodel = new /aws1/cl_bdoapischemaconf(
        io_s3 = new /aws1/cl_bdos3configuration(
          iv_bucketowneraccountid = |string|
          iv_uri = |string|
        )
        iv_inlinepayload = |string|
      )
    )
  )
  it_credentialproviderconfs = VALUE /aws1/cl_bdocredproviderconf=>tt_credentialproviderconfs(
    (
      new /aws1/cl_bdocredproviderconf(
        io_credentialprovider = new /aws1/cl_bdocredentialprovider(
          io_apikeycredentialprovider = new /aws1/cl_bdogwapikeycredpvdr(
            iv_credentiallocation = |string|
            iv_credentialparametername = |string|
            iv_credentialprefix = |string|
            iv_providerarn = |string|
          )
          io_oauthcredentialprovider = new /aws1/cl_bdooauthcredprovider(
            it_customparameters = VALUE /aws1/cl_bdooauthcustparams_w=>tt_oauthcustomparameters(
              (
                VALUE /aws1/cl_bdooauthcustparams_w=>ts_oauthcustomparams_maprow(
                  key = |string|
                  value = new /aws1/cl_bdooauthcustparams_w( |string| )
                )
              )
            )
            it_scopes = VALUE /aws1/cl_bdooauthscopes_w=>tt_oauthscopes(
              ( new /aws1/cl_bdooauthscopes_w( |string| ) )
            )
            iv_providerarn = |string|
          )
        )
        iv_credentialprovidertype = |string|
      )
    )
  )
  iv_clienttoken = |string|
  iv_description = |string|
  iv_gatewayidentifier = |string|
  iv_name = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_gatewayarn = lo_result->get_gatewayarn( ).
  lv_targetid = lo_result->get_targetid( ).
  lv_datetimestamp = lo_result->get_createdat( ).
  lv_datetimestamp = lo_result->get_updatedat( ).
  lv_targetstatus = lo_result->get_status( ).
  LOOP AT lo_result->get_statusreasons( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_statusreason = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
  lv_targetname = lo_result->get_name( ).
  lv_targetdescription = lo_result->get_description( ).
  lo_targetconfiguration = lo_result->get_targetconfiguration( ).
  IF lo_targetconfiguration IS NOT INITIAL.
    lo_mcptargetconfiguration = lo_targetconfiguration->get_mcp( ).
    IF lo_mcptargetconfiguration IS NOT INITIAL.
      lo_apischemaconfiguration = lo_mcptargetconfiguration->get_openapischema( ).
      IF lo_apischemaconfiguration IS NOT INITIAL.
        lo_s3configuration = lo_apischemaconfiguration->get_s3( ).
        IF lo_s3configuration IS NOT INITIAL.
          lv_s3bucketuri = lo_s3configuration->get_uri( ).
          lv_awsaccountid = lo_s3configuration->get_bucketowneraccountid( ).
        ENDIF.
        lv_inlinepayload = lo_apischemaconfiguration->get_inlinepayload( ).
      ENDIF.
      lo_apischemaconfiguration = lo_mcptargetconfiguration->get_smithymodel( ).
      IF lo_apischemaconfiguration IS NOT INITIAL.
        lo_s3configuration = lo_apischemaconfiguration->get_s3( ).
        IF lo_s3configuration IS NOT INITIAL.
          lv_s3bucketuri = lo_s3configuration->get_uri( ).
          lv_awsaccountid = lo_s3configuration->get_bucketowneraccountid( ).
        ENDIF.
        lv_inlinepayload = lo_apischemaconfiguration->get_inlinepayload( ).
      ENDIF.
      lo_mcplambdatargetconfigur = lo_mcptargetconfiguration->get_lambda( ).
      IF lo_mcplambdatargetconfigur IS NOT INITIAL.
        lv_lambdafunctionarn = lo_mcplambdatargetconfigur->get_lambdaarn( ).
        lo_toolschema = lo_mcplambdatargetconfigur->get_toolschema( ).
        IF lo_toolschema IS NOT INITIAL.
          lo_s3configuration = lo_toolschema->get_s3( ).
          IF lo_s3configuration IS NOT INITIAL.
            lv_s3bucketuri = lo_s3configuration->get_uri( ).
            lv_awsaccountid = lo_s3configuration->get_bucketowneraccountid( ).
          ENDIF.
          LOOP AT lo_toolschema->get_inlinepayload( ) into lo_row_2.
            lo_row_3 = lo_row_2.
            IF lo_row_3 IS NOT INITIAL.
              lv_string = lo_row_3->get_name( ).
              lv_string = lo_row_3->get_description( ).
              lo_schemadefinition = lo_row_3->get_inputschema( ).
              IF lo_schemadefinition IS NOT INITIAL.
                lv_schematype = lo_schemadefinition->get_type( ).
                LOOP AT lo_schemadefinition->get_properties( ) into ls_row_4.
                  lv_key = ls_row_4-key.
                  lo_value = ls_row_4-value.
                  IF lo_value IS NOT INITIAL.
                    lv_schematype = lo_value->get_type( ).
                    " Skipping ls_row_4-value to avoid recursion
                    LOOP AT lo_value->get_required( ) into lo_row_5.
                      lo_row_6 = lo_row_5.
                      IF lo_row_6 IS NOT INITIAL.
                        lv_string = lo_row_6->get_value( ).
                      ENDIF.
                    ENDLOOP.
                    lo_schemadefinition_1 = lo_value->get_items( ).
                    IF lo_schemadefinition_1 IS NOT INITIAL.
                      lv_schematype = lo_schemadefinition_1->get_type( ).
                      " Skipping lo_value->get_items( ) to avoid recursion
                      LOOP AT lo_schemadefinition_1->get_required( ) into lo_row_5.
                        lo_row_6 = lo_row_5.
                        IF lo_row_6 IS NOT INITIAL.
                          lv_string = lo_row_6->get_value( ).
                        ENDIF.
                      ENDLOOP.
                      " Skipping lo_value->get_items( ) to avoid recursion
                      lv_string = lo_schemadefinition_1->get_description( ).
                    ENDIF.
                    lv_string = lo_value->get_description( ).
                  ENDIF.
                ENDLOOP.
                LOOP AT lo_schemadefinition->get_required( ) into lo_row_5.
                  lo_row_6 = lo_row_5.
                  IF lo_row_6 IS NOT INITIAL.
                    lv_string = lo_row_6->get_value( ).
                  ENDIF.
                ENDLOOP.
                lo_schemadefinition_1 = lo_schemadefinition->get_items( ).
                IF lo_schemadefinition_1 IS NOT INITIAL.
                  lv_schematype = lo_schemadefinition_1->get_type( ).
                  LOOP AT lo_schemadefinition_1->get_properties( ) into ls_row_4.
                    lv_key = ls_row_4-key.
                    lo_value = ls_row_4-value.
                    IF lo_value IS NOT INITIAL.
                      lv_schematype = lo_value->get_type( ).
                      " Skipping ls_row_4-value to avoid recursion
                      LOOP AT lo_value->get_required( ) into lo_row_5.
                        lo_row_6 = lo_row_5.
                        IF lo_row_6 IS NOT INITIAL.
                          lv_string = lo_row_6->get_value( ).
                        ENDIF.
                      ENDLOOP.
                      " Skipping ls_row_4-value to avoid recursion
                      lv_string = lo_value->get_description( ).
                    ENDIF.
                  ENDLOOP.
                  LOOP AT lo_schemadefinition_1->get_required( ) into lo_row_5.
                    lo_row_6 = lo_row_5.
                    IF lo_row_6 IS NOT INITIAL.
                      lv_string = lo_row_6->get_value( ).
                    ENDIF.
                  ENDLOOP.
                  " Skipping lo_schemadefinition->get_items( ) to avoid recursion
                  lv_string = lo_schemadefinition_1->get_description( ).
                ENDIF.
                lv_string = lo_schemadefinition->get_description( ).
              ENDIF.
              lo_schemadefinition = lo_row_3->get_outputschema( ).
              IF lo_schemadefinition IS NOT INITIAL.
                lv_schematype = lo_schemadefinition->get_type( ).
                LOOP AT lo_schemadefinition->get_properties( ) into ls_row_4.
                  lv_key = ls_row_4-key.
                  lo_value = ls_row_4-value.
                  IF lo_value IS NOT INITIAL.
                    lv_schematype = lo_value->get_type( ).
                    " Skipping ls_row_4-value to avoid recursion
                    LOOP AT lo_value->get_required( ) into lo_row_5.
                      lo_row_6 = lo_row_5.
                      IF lo_row_6 IS NOT INITIAL.
                        lv_string = lo_row_6->get_value( ).
                      ENDIF.
                    ENDLOOP.
                    lo_schemadefinition_1 = lo_value->get_items( ).
                    IF lo_schemadefinition_1 IS NOT INITIAL.
                      lv_schematype = lo_schemadefinition_1->get_type( ).
                      " Skipping lo_value->get_items( ) to avoid recursion
                      LOOP AT lo_schemadefinition_1->get_required( ) into lo_row_5.
                        lo_row_6 = lo_row_5.
                        IF lo_row_6 IS NOT INITIAL.
                          lv_string = lo_row_6->get_value( ).
                        ENDIF.
                      ENDLOOP.
                      " Skipping lo_value->get_items( ) to avoid recursion
                      lv_string = lo_schemadefinition_1->get_description( ).
                    ENDIF.
                    lv_string = lo_value->get_description( ).
                  ENDIF.
                ENDLOOP.
                LOOP AT lo_schemadefinition->get_required( ) into lo_row_5.
                  lo_row_6 = lo_row_5.
                  IF lo_row_6 IS NOT INITIAL.
                    lv_string = lo_row_6->get_value( ).
                  ENDIF.
                ENDLOOP.
                lo_schemadefinition_1 = lo_schemadefinition->get_items( ).
                IF lo_schemadefinition_1 IS NOT INITIAL.
                  lv_schematype = lo_schemadefinition_1->get_type( ).
                  LOOP AT lo_schemadefinition_1->get_properties( ) into ls_row_4.
                    lv_key = ls_row_4-key.
                    lo_value = ls_row_4-value.
                    IF lo_value IS NOT INITIAL.
                      lv_schematype = lo_value->get_type( ).
                      " Skipping ls_row_4-value to avoid recursion
                      LOOP AT lo_value->get_required( ) into lo_row_5.
                        lo_row_6 = lo_row_5.
                        IF lo_row_6 IS NOT INITIAL.
                          lv_string = lo_row_6->get_value( ).
                        ENDIF.
                      ENDLOOP.
                      " Skipping ls_row_4-value to avoid recursion
                      lv_string = lo_value->get_description( ).
                    ENDIF.
                  ENDLOOP.
                  LOOP AT lo_schemadefinition_1->get_required( ) into lo_row_5.
                    lo_row_6 = lo_row_5.
                    IF lo_row_6 IS NOT INITIAL.
                      lv_string = lo_row_6->get_value( ).
                    ENDIF.
                  ENDLOOP.
                  " Skipping lo_schemadefinition->get_items( ) to avoid recursion
                  lv_string = lo_schemadefinition_1->get_description( ).
                ENDIF.
                lv_string = lo_schemadefinition->get_description( ).
              ENDIF.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.
  LOOP AT lo_result->get_credentialproviderconfs( ) into lo_row_7.
    lo_row_8 = lo_row_7.
    IF lo_row_8 IS NOT INITIAL.
      lv_credentialprovidertype = lo_row_8->get_credentialprovidertype( ).
      lo_credentialprovider = lo_row_8->get_credentialprovider( ).
      IF lo_credentialprovider IS NOT INITIAL.
        lo_oauthcredentialprovider = lo_credentialprovider->get_oauthcredentialprovider( ).
        IF lo_oauthcredentialprovider IS NOT INITIAL.
          lv_oauthcredentialprovider_1 = lo_oauthcredentialprovider->get_providerarn( ).
          LOOP AT lo_oauthcredentialprovider->get_scopes( ) into lo_row_9.
            lo_row_10 = lo_row_9.
            IF lo_row_10 IS NOT INITIAL.
              lv_oauthscope = lo_row_10->get_value( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_oauthcredentialprovider->get_customparameters( ) into ls_row_11.
            lv_key_1 = ls_row_11-key.
            lo_value_1 = ls_row_11-value.
            IF lo_value_1 IS NOT INITIAL.
              lv_oauthcustomparametersva = lo_value_1->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
        lo_gatewayapikeycredential = lo_credentialprovider->get_apikeycredentialprovider( ).
        IF lo_gatewayapikeycredential IS NOT INITIAL.
          lv_apikeycredentialprovide = lo_gatewayapikeycredential->get_providerarn( ).
          lv_apikeycredentialparamet = lo_gatewayapikeycredential->get_credentialparametername( ).
          lv_apikeycredentialprefix = lo_gatewayapikeycredential->get_credentialprefix( ).
          lv_apikeycredentiallocatio = lo_gatewayapikeycredential->get_credentiallocation( ).
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDIF.