Creating a Plug-in
API Gateway provides flexible extension capabilities for APIs through plug-ins.
Guidelines for Using Plug-ins
- An API can be bound with only one plug-in of the same type.
- Plug-ins are independent of APIs. A plug-in takes effect for an API only after they are bound to each other. When binding a plug-in to an API, you must specify an environment where the API has been published. The plug-in takes effect for the API only in the specified environment.
- After you bind a plug-in to an API, unbind the plug-in from the API, or update the plug-in, you do not need to publish the API again.
- Taking an API offline does not affect the plug-ins bound to it. The plug-ins are still bound to the API if the API is published again.
- Plug-ins that have been bound to APIs cannot be deleted.
Creating a Plug-in
- Log in to the management console.
- Click in the upper left corner and choose API Gateway.
- In the navigation pane, choose Dedicated Gateways. Then click Access Console in the upper right corner of a dedicated gateway.
- In the navigation pane, choose API Publishing > Plug-ins.
- 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.
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.
- Click OK.
After creating the plug-in, bind it to the API for which the plug-in will take effect.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.