justone / dockviz

Visualizing Docker data
Apache License 2.0
1.21k stars 107 forks source link

Add option for JSON output #26

Open relet opened 8 years ago

relet commented 8 years ago

The current code offers --dot format and --tree format output. I think a more machine readable output as a JSON dictionary tree could be useful for automatic processing.

justone commented 8 years ago

Interesting idea.

What did you have in mind for the JSON format? Should it be hierarchical like --tree or just express relationships between images? And how would this be different from the GET /images/json API?

Thanks.

relet commented 8 years ago

I have a relatively specific task in mind, which I did implement using some of the same steps dockviz takes. (Calculating the additional installation size of a container by comparing it to the layers that already are on the system)

I think, in general the hierarchy and relative layer sizes is what makes dockviz most interesting. What you don't get from /images/json are the layer sizes. When using the API directly you have to take the extra steps of calculating checksums to recreate the hierarchy if you want to use the layer history.