Importing a user-defined policy into a Catalog
Create a catalog-scoped, user-defined policy that can be used in API assemblies within the catalog where the policy is published.
About this task
Note: In API Connect, this
feature is available only with the advanced plan.
A published catalog-scoped policy can only be used with APIs in the same catalog. Complete the following tasks to define, package and publish the catalog-scoped policy.
Procedure
- Create a YAML file that describes the new catalog-scoped
policy.
- Create a new zip file called <policyname>.zip that contains the new YAML file.
- Publish the new policy that uses either the toolkit CLI or the API
Manager:
- API Connect
toolkit CLI:
Use the
apic policies:createcommand to publish the gateway extension (see toolkit CLI reference documentation). - API Manager:
Complete the following steps to publish the new policy:
- Log in to API Manager.
- Click and upload your new policy.zip file.
- API Connect
toolkit CLI:
- Verify that the new catalog-scoped policy is available in the API Assembler's Policy
palette.
- In API Manager, select the Catalog where you published the new catalog-scoped policy.
- Create an API.
- Click
(next to Save) and for the Target
Catalog, select the catalog where you published the new policy. - Save the API.
- Open the API Assembler page and view the Policy palette. Verify that your new catalog-scoped policy displays and can be added to the API.