Layer7 API Management

Expand all | Collapse all

clear history

Jump to Best Answer
  • 1.  clear history

    Posted 08-20-2018 10:17 PM

    Hi There,

    In one of policy, we have around over 500 revision history, I want to clear all, keeping the latest one.pls advice how could I perform cleanup of it.



  • 2.  Re: clear history

    Posted 08-21-2018 01:19 AM

    Hello,

     

    I looked into the product documents and the REST Management API document but I couldn't find any features to manipulate the revision history. It seems we have no such feature to clean up the long list of revision history unfortunately.


    How about re-creating the policy as a new one?

     

    1. Export the policy to a file
    2. Rename it as backup
    3. Import the exported file as a new policy
    4. Remove the backup (It is irreversible!)


    These steps will be a little complicated when the policy is in a Published service because the properties of the service aren't exported with the policy itself. We need to configure the new service manually same as the old one.

     

    Regards,
    Seiji



  • 3.  Re: clear history
    Best Answer

    Posted 08-21-2018 03:56 AM

    Hi,

     

    The number of policy revisions is controlled by 2 parameters: the max revisions setting (default 20, set in the policyVersioning.maxRevisions cluster property) or by adding a comment to a revision which excludes it from the max revision count. So either you have set your max revisions very high or you have comments added to your revisions causing it to keep all revisions forever. If it is the max revisions settings, be aware that this is a global setting so it will affect the number of revisions on all policies. If you don't want to change the global setting and it's not caused by comments, I think the process Seji described is your only option.

     

    Hope that helps.

     

    Regards,

    Michiel



  • 4.  Re: clear history

    Posted 08-23-2018 10:54 PM

    Thanks all for the various suggestions.