How to find who/what policies are using the policy fragments or policies
search cancel

How to find who/what policies are using the policy fragments or policies

book

Article ID: 257278

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

Is there a way to check what service policies are using certain policy fragments?

Environment

API Gateway 10.X

Resolution

To get this information, follow the steps below. I will use policy fragment 'oauth/v1/client' as an example: 

1. Run the following query to get the name of the policy fragment:

mysql> select name, guid from policy where name like '%<POLICY_NAME>%';

[EXAMPLE]
mysql> select name, guid from policy where name like '%oauth/v1%';
+-----------------------------------------------------------------------+--------------------------------------+
| name                                                                  | guid                                 |
+-----------------------------------------------------------------------+--------------------------------------+
| Policy for service #e001cfd0c1c1ffaa18e187b5e72fe1f1, oauth/v1/client | cb39a5c6-5195-414d-9182-91f769707cd9 |
+-----------------------------------------------------------------------+--------------------------------------+
1 row in set (0.01 sec)

2. Use the guid (or part of the guid) to find what service policies are using the particular fragments:

mysql> select name from policy where xml like '%<GUID>%';

[EXAMPLE]
mysql> select name from policy where xml like '%cb39a5c6%';
Empty set (0.13 sec)

If Step #2 doesn't bring back any results, that means there are no service policies using that particular policy fragment.