I am doing continuous integration CI for API proxies and want to automate creating proxy bundle (openAPI2apigee/wsdl2apigee) and deployment (maven).
As second part of api proxy bundle deployment, I want to attach Message logging policy to api proxy. As i want to automate the process I need to attach the policy using some tool/commands.
Consumes your swagger to generate routes and flow conditions.
You could have used the volos module approach but it doesn’t support logging yet. Additionally, i don’t see it supporting shared flows which are really helpful.
So, you could write a wrapper utility which takes one of the two approaches :
Approach 1:
Clones a skeletal proxy bundle template with references to reusable policies/shared flows(instead of generating it from scratch). You would store this in your SCM.
Overlays the output of OpenAPI2Apigee and WSDL2Apigee onto your cloned template.
First, try running OpenAPI2Apigee/WSDL2Apigee on your spec and see the sections/files in which the proxy bundle is customized. That will help you figure out how complex the overlay routine is going to get.
Approach 2:
Run the bundle generation utilities as you originally planned
Write a script to append XML nodes, copy files to the proxy bundle generated in step 1.
While Approach 1 and 2 might look similar, they have a significant difference. In the first approach, your reusable snippets are an actual proxy bundle template. This makes it easy to author and update them. In the second approach, they are stored in code.
In the end, you are essentially merging XML’s (or reading selective paths of generated XML to merge into template xml) and copying files.