Layer7 API Management

 View Only
Expand all | Collapse all

How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

  • 1.  How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Posted Mar 23, 2016 10:56 AM

    How can user call delete on entire structure during migration?

    I have DEVBUS where I have exported via GMU, the policies,fragments,cluster properties,services,resources etc.

    Now I have folder structure, I have to to migration from DEV to INTEGRATION environment.

    How can I delete if any existing Policies, Fragments, Services etc in INTEGRATION BUS so that I can call rest man create to create the fresh one by calling rest man POST service for each policy, fragments,clusters etc.



  • 2.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Posted Mar 23, 2016 07:35 PM

    We have taken two approaches depending upon the circumstance:

    1. DELETE the resource using RESTman - there are dependencies and you may need to order the DELETES. For Polices etc you may try DELETEing the containing FOLDER resource (not tried myself)

    2. Overwrite the resource using a POST (or PUT for some resources!!!!). For this you will need to have the same resource reference (usually a GUID) across environments. Unfortunately the Gateway make it quite hard for users by having a unique GUID per environment for a resource and not reference by name.



  • 3.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Posted Mar 24, 2016 08:27 AM

    Hi James,

    Thanks for reply.

    When you say GUID. I see guid for policies and services are different when I delete everything and trying to load freshly by calling POST services. Do I need update these GUID as well? If that is the case it will be hard to go through each and every policy and fragments and services xml and replace the GUID's which is like building everything from scratch.

    Do we build our own bundle.xml and do an migrateIn and migrateOut? Does CA support that ?



  • 4.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Posted Mar 24, 2016 09:15 AM

    Hi James,

    I would like to know more on how to do this.

     

    2. Overwrite the resource using a POST (or PUT for some resources!!!!). For this you will need to have the same resource reference (usually a GUID) across environments. Unfortunately the Gateway make it quite hard for users by having a unique GUID per environment for a resource and not reference by name.

     

    Can we have a call on this? I would like have conference call where some of my managers can join the call? Can you please schedule the call?

    Thanks

    Anand

    443-714-9774



  • 5.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Broadcom Employee
    Posted Sep 07, 2016 12:21 AM

    Anand,

     

    I've checked with our internal teams and we have a feature request to restore the gateway to factory state through the restman directly which is being tracked for a n unidentified future release. In the interim I have attached a sample script that will do a similar behavior. This scripts has not been formally tested through different use cases and is not supported through CA Support but will give you an idea of some things that can be done.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support



  • 6.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Posted Oct 03, 2016 03:17 PM

    Hi Stephen_Hughes,

     

    Will the GatewayBackup and restore  with only the maindb work in this case? Can he run the backup in DEV and run the restore in integration?  I wonder if that can give the same result as restman.

     

    /opt/SecureSpan/Gateway/config/backup/ssgrestore.sh -image GatewayBackup.zip  -maindb -dbu root -dbp password

     

    Thanks,

    Anand



  • 7.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Broadcom Employee
    Posted Oct 03, 2016 03:34 PM

    Anand,

     

    The restore is will have more data and may cause issues as it will restore everything from the private keys to other unique settings in the cluster properties. There is a ssgmigration script that is more designed for this functionality of restoring only key pieces. The problem with either script it will require that the gateway be shutdown for it to pick up the changes whereas the restman does not require this.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support



  • 8.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Posted Oct 04, 2016 10:26 AM

    Thanks Stephen. 



  • 9.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Posted Sep 23, 2016 05:27 PM

    We have the same issue of a need to be able to delete objects as part of deployment from dev to test to prod.  And have run into the same problem.  Evidence indicated that ordering the deletes was important.

     

    Stephen Hughes' script shows the way.


    I had to modify it a bit for Mac OS/X, and Ignored all cluster_properties.

    I used manageMappings to explicitly set action=Delete for SERVICE, POLICY, ENCAPSULATED_ASSERTION and FOLDER.
    The migration was successful, and testing so far indicates it did what I wanted.

     

    Further, the script shows how to order the objects for deletion.  That itself was helpful.

     

    I will explore RESTman more.  That will require, I think, a recursive approach to find all of the dependencies, which will be multiple calls. Then multiple calls to delete the objects.  Worth exploring, but the overhead compared to the GMU may be too much.



  • 10.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Posted Jun 19, 2017 05:56 AM

    Will it work for Delete root folder through GMU restman as well? Can you please provide an example for this?



  • 11.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Posted Jun 19, 2017 07:28 AM

    I intentionally did not delete the root folder.  I do not know if it is possible.  My intent was to delete policies, etc leaving the root folder, and then install the new policies in that root folder.



  • 12.  Re: How can we clear all policy,fragements,cluster properties etc from higher environments in order to migrate via restman from lower environments

    Posted Jun 20, 2017 12:07 AM

    Can you please provide a test script that you used for executing the task? It will be good to know the approach being used.