Layer7 API Management

Expand all | Collapse all

Policies + Version Control

  • 1.  Policies + Version Control

    Posted 09-16-2015 09:45 AM



    Can someone point me to resources concerning version control practices?  I understand that policies are nothing more than XML files that they can be exported.  I'd like to know if others have a best practices or a process  around how they are storing and managing policies in version control (if at all). 


    I didn't see an option in Policy Manager, but I'll ask...  Are there any OOTB integrations with version control systems (SVN, git, etc..)?


    Any insight is appreciated.





    API Gateway/Policy Manager 8.2

  • 2.  Re: Policies + Version Control

    Posted 09-16-2015 09:52 AM



    We were using CVS for our version control. We were able to check-in the XMLs into CVS while migrating it from one environment to another using the Commandline Migration Tool (CMT).

  • 3.  Re: Policies + Version Control

    Posted 09-16-2015 10:05 AM

    Thanks for the reply.  More questions...


    From what I've seen, an export using tools like GMU/CMT export a "self-contained" (bringing all of its dependency definitions with it) artifact.  Do you just have a flat structure that contains exported artifacts?  Or do you have something different?  Do the types of artifacts you store in version control affect your structure in any way?





  • 4.  Re: Policies + Version Control

    Posted 09-16-2015 09:55 AM



    Yes there’s out of the box tools that can be scripted to help manage your policies into a Code repository.


    CMT was built for this.  This is a Soap based command line tool that allows you to export services from one gateway and move those services into the next environment.  This can be built so that it pulls on services from one environment and move it into the your code repository.





    Derek Orr


    CA Technologies |885 West Georgia Street Ste 500 | Vancouver, BC V6C 3G1

    Office: 1-778-328-5285 | Mobile: +1 778 980 0029 |





  • 5.  Re: Policies + Version Control

    Posted 09-16-2015 10:12 AM

    Thanks Derek.  I'm somewhat familiar with CMT and GMU.  I've played with them enough to understand how to export and move artifacts.  I can see how you can use this in combination with a version control system.  I guess I was looking for a more direct integration, but I understand what you mean.


    If you do use tools like CMT/GMU, do you have any structure around the exported artifacts?  From what I can tell, an export produces a stand-alone artifact that contains all of its dependencies.  Is this correct?  If so, I can visualize something like a folder per service where the service (containing policy fragments, etc..) and configuration properties would be held.


    I guess I'm after are ways that others have structured their source control repositories to house artifacts from the gateway.


    What I'm also getting from some replies is that an export from Policy Manager isn't enough.  It feels like you "could" export from PM, but it would be missing dependent parts.  Am I thinking of this the right way?





  • 6.  Re: Policies + Version Control

    Posted 09-18-2015 11:41 AM

    Your assumption is correct: Exporting a policy via the Policy Manager does not generally include all dependencies. Things such as Identity Providers, JDBC connections, or private keys referred to in policy are not migrated or saved as dependencies.

  • 7.  Re: Policies + Version Control

    Posted 09-18-2015 12:06 AM

    We use Git.


    And we have a preference for RESTMan. Fine granularity changes. So all the "resources" that are exportable from RESTMan are stored in Git. Any change to L7 is made in a development machine, saved down to Git and deployed to another environment. We have a bunch of Powershell scripts that automate the process. Let me know if you want those scripts - happy to share.


    The Policy Manager does not integrate with git.

  • 8.  Re: Policies + Version Control

    Posted 09-18-2015 08:13 AM

    Hi James,


    I would be very interested by your scripts. Could you share them ?


    Thank you

  • 9.  Re: Policies + Version Control

    Posted 03-09-2016 02:14 PM

    Hi James,


    Can you please the powershell scripts with me as well?




  • 10.  Re: Policies + Version Control

    Posted 03-18-2016 04:54 PM

    Hi Jamie - Can you please share the powershell scripts ?/ Thanks

  • 11.  Re: Policies + Version Control

    Posted 08-09-2016 10:12 PM

    Hi James,


    I am more interested to know functionally how you do it? Would you able to share more ?



  • 12.  Re: Policies + Version Control

    Posted 01-31-2018 10:54 AM

    Hi James, I'm starting to use the Gateway API, could you please share the scripts that mention


    Thank you

  • 13.  Re: Policies + Version Control

    Posted 09-18-2015 06:27 PM

    Hi Alejandro,


    Lots of good answers here already - so definitely not an unusual request. Adding some of my thoughts.


    CMT and GMU are the two common tools used to migrate content between a Gateway and the file system. They are syntactically very similar where the main difference is that CMT uses the older SOAP-based management service while GMU uses the new REST-based management service. Neither tool offers direct integration with source control but once policies and their dependencies are represented as files, maintaining those files in source control should be similar to how you would do for other code.


    If you're on Gateway 8.2, CMT is your only choice. GMU was added in 8.3 and later.


    CMT exports structure the Gateway contents as individual files organized in directories (which correspond to Gateway folders). Meaning that a policy is one XML file while a JDBC connection is another. Not a single bundle. On top of this, there's the notion of templatization, which intends to separate policy structure and hard values specifically to better accommodate exports in source control (e.g. SVN and Git).


    I'm with the Tactical development team and we have a document called the Policy Migration Guide which covers much of this with some examples. If interested, please reach out to Support and request it.




  • 14.  Re: Policies + Version Control

    Posted 09-24-2015 01:09 PM

    Thanks!  Is this the same support doc that covers  the GMU?  Fortunately, I

    am moving to 8.3 next week.





    On Sep 18, 2015 6:27 PM, "mogol01" <>

  • 15.  Re: Policies + Version Control

    Posted 09-24-2015 02:04 PM

    The Policy Migration Guide uses CMT in its examples. But CMT and GMU are syntactically very similar and shouldn't be too far apart with regards to this use case.


    FWIW, the differences between GMU and CMT are highlighted there:


    I'll also mention this page as it shows an example of using templatization with GMU:




  • 16.  Re: Policies + Version Control

    Posted 03-09-2016 01:50 PM

    Can you please provide me Policy Migration Guide used by CMT?

  • 17.  Re: Policies + Version Control

    Posted 08-10-2016 05:32 AM

    Hi Ola,


    I went throught policy migration guide for CA 9.1. The example is more on full migration. May i check with you on the templatization that you mentioned here? How do we model the folder structure in the source control (e.g. GIT)? What should be source control and how do we import from source control to the gateway?