linux - How to convert blueprint json file to csv file? -


how convert blueprint json file csv file?

my target convert properties parameters csv file amabri cluster

example – how generate new fresh blueprint.json file ambari cluster

    curl  -u admin:admin -h "x-requested-by: ambari" -x http://10.23.4.122:8080/api/v1/clusters/hdp01?format=blueprint -o /tmp/hdp01_blueprint.json 

example of expected results: ( parameters json file config types should in csv file )

      autopurge.purgeinterval,512       datadir,/hadoop/zookeeper       autopurge.snapretaincount,10       clientport,2181       initlimit,11       ticktime,2000       synclimit,5 

you write own script doing conversion.

for example use php reading json , creating csv file way want it.

reading json

$filecontent = file_get_contents('/tmp/hdp01_blueprint.json'); $parsedcontent = json_decode($filecontent, true); 

after content stored in $parsedcontent variable associative array. array can write values want csv file.

you can let script fetch json string you.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -