Adding a GatewayScript assembly action to run a GatewayScript file
A GatewayScript assembly action runs a GatewayScript file in a DataPower® directory.
About this task
This action is not supported in IBM Cloud. Any assembly that includes this action fails.
You can specify the location of the GatewayScript file with a URL or by referencing a variable in
the API context.
- When you specify a URL, the URL must start with local:,
store:, or temporary:. For example,
local:///test.js. - When you reference a variable, use the
$(variable)format. For example,$(request.headers.URL).
The GatewayScript assembly action can use all objects and modules that are supported by the traditional DataPower GatewayScript processing action except for the policy-utility module.
You can enable the GatewayScript debugger to troubleshoot the GatewayScript file.
Procedure
- In the search field, enter gatewayscript.
- From the search results, click GatewayScript assembly action.
- Click Add.
- Define the basic properties: Name, administrative state, descriptive summary,
title, and correlation path. The correlation path indicates the part of the API definition that correlates with the assembly action. This path is included in the debug data for use by debugging tools. For example, when an API configuration is specified in an OpenAPI document with gateway extensions, this path is the JSON path to the policy in the IBM extensions section of the document. The path can be expressed in any form that the debugging tool can correlate to the API definition.
- Specify whether to enable the GatewayScript debugger. Select Enable GatewayScript debug from the actions list.
- Specify the name and location of the GatewayScript file.
- Click Apply to save changes to the running configuration.
- Click Save to save changes to the persisted configuration.