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 configuration element that controls a specific aspect of processing in the Gateway server during 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 run your policies on a DataPower® Gateway, ensure that the user-defined policy controls processing supported by the version ofIBM DataPower Gateway on which the policy runs. When using the GatewayScript actions, the minimum DataPower firmware version 7.2.0 or late.
- 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 must 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: 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.