Creating a Plug-in

APIG provides flexible extension capabilities for APIs through plug-ins.

Plug-in parameters will be stored as plaintext. To prevent information leakage, do not contain sensitive information in these parameters.

Guidelines for Using Plug-ins

Creating a Plug-in

  1. Log in to the management console.
  2. In the navigation pane, choose Dedicated Gateways. Then click Access Console in the upper right corner of a dedicated gateway.
  3. In the navigation pane, choose API Publishing > Plug-ins.
  4. Click Create Plug-in.

    In the Create Plug-in dialog box, configure the plug-in information.

    Table 1 Plug-in configuration

    Parameter

    Description

    Plug-in Name

    Name of the plug-in you want to create. It is recommended that you enter a name based on certain naming rules to facilitate identification and search.

    Plug-in Type

    Type of the plug-in, which determines the extension capabilities of the plug-in.

    • CORS: Specifies preflight request headers and response headers and automatically creates preflight request APIs for cross-origin API access.
    • HTTP Response Headers: Enables you to customize HTTP response headers that will be displayed in an API response.
    • Request throttling: Limits the number of times that an API can be called within a specific time period. Parameter-based, basic, and excluded throttling is supported.

    Plug-in Content

    Content of the plug-in, which can be configured in a form or using a script.

    The plug-in content varies depending on the plug-in type:

    Description

    Description of the plug-in.

  5. Click OK.

    After creating the plug-in, bind it to the API for which the plug-in will take effect.

Binding a Plug-in to an API

  1. In the navigation pane, choose API Publishing > APIs.
  2. Click the name of the target API to go to the API details page.
  3. On the Plug-ins tab page, click Bind.
  4. In the Bind Plug-in dialog box, select an environment and plug-in type, and select the plug-in to bind.
  5. Click OK.