gatewayscript

Use the gatewayscript policy to execute a specified DataPower GatewayScript program.

Gateway support

Table 1. Table showing which gateways support this policy, and the corresponding policy version
Gateway Policy version
DataPower® Gateway (v5 compatible) 1.0.0
DataPower API Gateway 2.0.0

This topic describes how to configure the policy in your OpenAPI source; for details on how to configure the policy in the assembly user interface, see GatewayScript.

About

The gatewayscript policy has the following structure:
- gatewayscript:
   version: version
   title: Title
   desription: Description
   source: Script

Properties

The following table describes the policy properties:
Table 2. gatewayscript policy properties
Property Required Description Data type
version Yes The policy version number string
title No The title of the policy. string
description No A description of the policy. string
source Yes The GatewayScript source code to execute. string

Example

The following is an example of a simple gatewayscript policy:
- gatewayscript:
   version: 1.0.0
   title: Example_GatewayScript
   source: console.debug('Hello World!');
   description: A simple GatewayScript policy.

For more information about how to use a gatewayscript policy, see GatewayScript in the built-in policies section.

For more code examples, see GatewayScript code examples and, if you are using the DataPower API Gateway, Using context variables in GatewayScript and XSLT policies with the DataPower API Gateway.

For general information on using GatewayScript, see the following topics in the DataPower product documentation: