How to add APIs and policies to a group¶
In this tutorial, you’ll learn how to add or remove APIs from a group as well as different policies. An API group allows you to effectively apply subscription, and attach security and monitoring policies to multiple APIs at once. To learn more about groups in the API Manager, visit API Groups.
To add APIs to a group, follow the below steps.
Note
Before you proceed with the steps, ensure you’re a user with the platform-admin or api-product-manager role. Also, there are groups created, if not, first create an API group and then follow the below instructions.
Steps to add APIs¶
- Access Manage API → select API Groups.
- Then, click for the group in which you need to add APIs.
- The APIs window will open. Here:
- You can find the APIs using the search bar and tags
- Switch Organizations to view APIs under a specific organization
- To add APIs into the group:
- Go to the Add to group section
- Select the APIs you need to add
- Then, click Update
This will add the APIs to the group.
Attach policies¶
You can also attach gateway and monitor policies to the groups that you’ve created. Furthermore, the API Groups functionality enables you to create new policies and attach them to the APIs. To do that, follow the instructions in the below section:
Attach gateway policy¶
- Open API Groups.
- Click for the API group you need to attach policies.
- In the window open, select Gateway Policies.
By default, the gateway policies section displays all the policies of different types. However, you can filter them out:
- Go to Policy Type and select the type as throttling | whitelist | blacklist_ip.
- Once you’ve selected the type, the policies will be filtered out.
- Now, to attach the policies:
- Go to the Attach to group section
- Select the policies you need to attach
- Once you’re done selecting the policies, click Update.
If you need to create a new policy and attach it to the group:
- Click the Create New Policy.
- In the popup shown:
- Select the Policy Type
- Enter details of the policy
- Once done adding the details, click Create.
Tip
For detailed instructions on creating gateway policies, visit Gateway Policies.
This will create the policy, simply select it and update the group to attach it to the APIs present in the group.
Attach monitor policy¶
- Open API Groups.
- Click for the API group you need to attach policies.
- In the window open, select Monitor Policies.
By default, the monitor policies section displays all the policies of different types. However, you can filter them out:
- Go to Policy Type and select the type as Request limit (IP blocking) | Request limit | ip-blocking | Error Code Notification | request limit.
- Once you’ve selected the type, the policies will be filtered out.
- Now, to attach the policies:
- Go to the Attach to group section
- Select the policies you need to attach
- Once you’re done selecting the policies, click Update.
If you need to create a new policy and attach it to the group:
- Click the Create New Policy.
- In the popup shown:
- Select the Policy Type
- Enter details of the policy
- Once done adding the details, click Create.
Tip
For detailed instructions on creating monitor policies, visit Monitor Policies.
This will create the policy, simply select it and update the group to attach it to the APIs present in the group.