User-defined policies
Make a user-defined policy available to a Catalog, and apply that policy to a REST or SOAP API.
A policy is a piece of configuration that controls a specific aspect of processing in the Gateway server during the handling of an API invocation at run time. IBM® API Connect provides built-in policies for many capabilities, including logging, redaction, proxy, and transformations, but you can also create user-defined policies to provide more processing control.
The following information outlines how to create and manage user-defined policies:
- Creating a user-defined policy
- A user-defined
policy is
created outside of API Connect by using a
standard development tool, but the policy must conform to a particular schema. For information about
how to create a policy, see Authoring policies.Note: If you are running your policies on a DataPower® Gateway, you must ensure that the DataPower processing to be controlled by the user-defined policy, is supported by the level of IBM DataPower Gateway that the policy will be run on. When using the GatewayScript actions, the minimum DataPower firmware that should be used is version 7.2.0.
- Importing a user-defined policy into API Connect
- To make a user-defined
policy
available to an API, the policy must be imported into one or more Catalogs in the API
Manager. If you also want to
be able to apply the policy to your policy assembly in API
Designer, you will have to
import that policy into the developer toolkit environment.
Make your policy accessible to API Designer by using the developer toolkit. For detailed instructions, see Packaging and importing your policies into IBM API Connect.
Make your policy available by using the API Manager UI. For detailed instructions, see:- Importing a user-defined policy into a Catalog. If you want to create a new Catalog and import a user-defined policy as part of the configuration, follow the instructions in Creating and configuring Catalogs.
- Packaging and importing your policies into IBM API Connect.
Note: You must import a user-defined policy into every Catalog in API Manager that you require the policy to run in. - Applying a user-defined policy to an API
- Apply a user-defined policy to an API definition by using the assemble view in API Designer or API Manager, to add the component to your assembly and configure its properties. For detailed instructions, see Including elements in your OpenAPI 2.0 API assembly, Including elements in your OpenAPI 2.0 API assembly.
- Deleting a user-defined policy
- Delete a user-defined policy from a Catalog, by clicking the Delete icon next to the policy in the associated Catalog in API Manager.