Lua Script

Executes custom Lua code during API processing.

Use the Lua Script policy to run lightweight custom Lua code that performs data manipulation, validation, or other logic at run time.

The Lua Script policy provides extension functions and preset global variables for manipulating assembly context, messages, and variables. For detailed information about available extension functions, see Lua Script extension functions.

For more information on the policy parameter descriptions, see DataPower Nano Gateway documentation.

Example of a Lua Script policy in code view for an MCP server.

kind: LuaScript
apiVersion: api.ibm.com/v1
metadata:
  name: LuaScript-geUsL
  namespace: e47e8275-2ec5-4c06-baaf-136dd64079e0
  version: '1.0'
  tags: []
  labels:
    gatewayTypes:
      - nano
spec: {}