vultr icon indicating copy to clipboard operation
vultr copied to clipboard

Add CLI flag for JSON output

Open NathanUrwin opened this issue 6 years ago • 5 comments

NathanUrwin avatar Mar 19 '18 00:03 NathanUrwin

I very much support this. I'm currently writing python scripts to automate setting up a machine to use with some other scripts I already wrote, and having JSON output would make this a lot easier.

rehtlaw avatar Jul 10 '18 14:07 rehtlaw

I don't quite understand what for. 🤔 After all, the Vultr API is already responding with JSON. If you're writing python scripts to automate stuff, why not simply calling the API directly and parsing it's JSON output? The API is quite simple actually: https://www.vultr.com/api/ You'll have much more fine-grained control that way 😄 👍

JamesClonk avatar Jul 13 '18 20:07 JamesClonk

I'll have a look at the API directly, but I still feel like it would be nice to get direct json output from the executable (like doctl).

rehtlaw avatar Jul 13 '18 20:07 rehtlaw

Hey @JamesClonk 👋

For the simple reason that it would be used (probably a lot)! I would also argue that if an upstream API returns JSON then the downstream API (in this case your CLI) should have an option for returning JSON too. Just for debugging reasons at the very least.

Thanks in advance for your time and consideration! 👍

NathanUrwin avatar Aug 04 '18 01:08 NathanUrwin

@JamesClonk I would also like json output. This allows users to pipe the output to jq (https://github.com/stedolan/jq) and filter things.

Yes we can just use the API directly using curl however the CLI makes it way easier to interact with the API.

rmb938 avatar Nov 10 '18 18:11 rmb938