graphman implode example
search cancel

graphman implode example

book

Article ID: 411774

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction


Usually we run the export using "all" option


graphman export --using all --output sourceGW1100-bundle.json

Which produce this activities :
[info] exporting from default gateway
[info] sanitizing services to services
[info] sanitizing auditConfigurations to auditConfigurations
[info] sanitizing clusterProperties to clusterProperties
[info] sanitizing dtds to dtds
[info] sanitizing internalIdps to internalIdps
[info] sanitizing internalUsers to internalUsers
[info] sanitizing keys to keys
[info] sanitizing listenPorts to listenPorts
[info] sanitizing logSinks to logSinks
[info] sanitizing schemas to schemas
[info] writing to file sourceGW1100-bundle.json

 from the output above, there are some stuff we do not need/want to migrate to the target Gateway , like :
       auditConfigurations, clusterProperties (CWP), keys, listenPorts, schemas, logSinks

 

The example below allows to filter a resultant bundle (.json file) after exported from source to be imported on target gateway.

Environment

CA API Gateway 10.x , 11.x

graphman client v1.3.14 ,   schema v11.1.2
supported schema(s) [v11.1.2, v11.1.1, v11.1.00, v11.0.00-CR03]

Resolution

 We can reduce/discard manually those unnecessary elements from the bundle exported before  to import into target a gateway using "implode" command  :

The complete sequence of steps are the following

  1. Do an "export" from Source Gateway:

   graphman export --using all --output sourceGW1100-bundle.json 
 

 2. Run "explode" command using as input the json file  from export (sourceGW1100-bundle.json)

     graphman explode  --input sourceGW1100-bundle.json --output exploded-GW1100-bundle.json  

3.  Using an IDE application , open the json file produced (exploded-GW1100-bundle.json ) , we can reduce manually (delete the elements/folders) 
       from the bundle what you do not need to import
       like (auditsConfigurations, keys, clusterProperties, listenPorts, schemas,logSinks,etc)
    

4. once cleaned up and leaving only the neccessary objects/folder from the json file , run the implode , using a new output json file name as example :

       graphman implode  --input ~/dev/aigw/local/sourceGW1100-bundle.json --output ~/dev/aigw/flatSourceGW1100-bundle.json

    - the resultant file after implode (flatSourceGW1100-bundle.json) contains the part of the bundle we will import on new/target gateway.
       
3. Finally run the import command using as input the reduced file (flatSourceGW1100-bundle.json) : 


   graphman import --gateway targetGW  --input flatSourceGW1100-bundle.json --output importedIntoTargetGw-bundle.json

Additional Information

 note : Common IDEs include Microsoft Visual Studio, Eclipse, and JetBrains IDEs like IntelliJ IDEA and PyCharm.