Query against MySQL DB to Get Policy Fragment Dependencies
search cancel

Query against MySQL DB to Get Policy Fragment Dependencies

book

Article ID: 216362

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

We have a developer that needs to obtain a list of all the Services that use a specific policy fragment called API_JWT_V2.

What is the query we can run against the MySQL database to obtain this information? 

Environment

All supported versions of the CA API Gateway

Resolution

1. From Policy Manager, select from your policy the fragment you want to query (ie. API_JWT_V2)

2. click on the line where the fragment is located into the policy and Copy the fragment into a notepad and search the “ApiId stringValue” pattern

Example :

<L7p:ApiId stringValue="123456c9-13c5-49b7-865b-f28752e8f3a1"/>

3. With the ApiId stringValue, create the following  query :

With this format

select name from policy where xml like '%L7pvalue_here%'

example :

select name from policy where xml like '%L7p:ApiId stringValue="123456c9-13c5-49b7-865b-f28752e8f3a1%'

4. mysql> select name from policy where xml like '%L7p:ApiId stringValue="123456c9-13c5-49b7-865b-f28752e8f3a1%'

    -> ;

+------------------+

| name             |

+------------------+

| callApi-fragment |

+------------------+

 

This will show all the policies which use the fragment called API_JWT_V2.