API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  policy that is not configured on the gateway service

    Posted Tue December 13, 2022 08:19 AM
    Hi,

    I try to add simple gatewayscript to my REST proxy in API Connect Free 30 - day trail:

    swagger: '2.0'
    info:
      version: 1.0.0
      title: my great farm stall proxy
      x-ibm-name: my-great-farm-stall-proxy
    basePath: /xxx
    x-ibm-configuration:
      properties:
        target-url:
          value: https://farmstall.designapis.com/v1/reviews
          description: URL of the proxy policy
          encoded: false
      cors:
        enabled: true
      gateway: datapower-api-gateway
      type: rest
      phase: realized
      enforced: true
      testable: true
      assembly:
        execute:
          - gatewayscript:
              title: add headers
              version: 1.0.0
              source: >
                // fetch header from recent request

    I get error:

    The OpenAPI definition (...) requires the policy 'gatewayscript:1.0.0' that is not configured on the gateway service 'apic-gw-v6-t-001 (DataPower API Gateway Trial 001)'.

    Is it possible to configure this policy in trail api gateway
    Can I download its definition from somewhere an upload to gateway policies?

    Thanks,
    Grzegorz

    ------------------------------
    Grzegorz Wilanowski
    ------------------------------


  • 2.  RE: policy that is not configured on the gateway service

    Posted Wed December 14, 2022 08:25 AM
    I am assuming you are using IBM API Connect v10 since v5 is end of life.  The API Connect v10 GatewayScript policy version is 2.0.0.

    GatewayScript - IBM Documentation

    Make this change:
    execute:
    - gatewayscript:
    title: add headers
    version: 2.0.0
    source: >


    ------------------------------
    Steve Ruscik
    ------------------------------



  • 3.  RE: policy that is not configured on the gateway service

    Posted Wed December 14, 2022 08:35 AM
    Thanks Steve for the replay.
    I've changed for
          - gatewayscript:
              version: 2.0.0
              title: Example_GatewayScript
              source: console.debug('Hello World!');
              description: A simple GatewayScript policy.  

    But now I have error:

     The OpenAPI definition 'mock1:1.0.0 (mock1)' requires the policy 'gatewayscript:2.0.0' that is not configured on the gateway service 'apic-gw-v6-t-001 (DataPower API Gateway Trial 001)'.

    Grzegorz


    ------------------------------
    Grzegorz Wilanowski
    ------------------------------



  • 4.  RE: policy that is not configured on the gateway service

    Posted Thu December 15, 2022 05:40 AM
    Are you using the API Manager interface to create the OpenAPI Specification and the Gateway Polices?  This should provide the correct GatewayScript policy version for you automatically.  I assume you are using the AWS SaaS version.  The policy version could be different on the SaaS version.

    a. Choose Develop APIs and Products


    b. Use the Gateway Policy Editor to create the Gateway script.


    ------------------------------
    Steve Ruscik
    ------------------------------



  • 5.  RE: policy that is not configured on the gateway service
    Best Answer

    Posted Thu December 15, 2022 03:46 PM

    Hi,

    if you are using AWS API Connect Saas version gatewayscript policy is not supported.
    see also https://www.ibm.com/docs/en/api-connect/saas?topic=overview-known-limitations

    cheers,
    Jeroen



    ------------------------------
    jeroen willems
    ------------------------------