mantl / consul-cli

Command line interface to Consul HTTP API
Apache License 2.0
251 stars 67 forks source link

acl create and update should accept HCL and JSON #30

Closed ghost closed 7 years ago

ghost commented 8 years ago

The ACL create and update should be able to accept ACLs in HCL and JSON as specified here: https://www.consul.io/docs/internals/acl.html.

Preferably this would be via file or '-' for stdin.

Work around: curl -X PUT -d "{\"Name\":\"agent\",\"Rules\":\"$(cat __ | tr -d '\n\t' | sed s/\"/\\"/g)\"}" http://localhost:8500/v1/acl/create

ChrisAubuchon commented 8 years ago

I suppose that could be added. One my goals with acl create and acl update was to avoid having to write a json or hcl policy files.

ghost commented 8 years ago

We'd like to keep the same syntax as the official doc. Whether in a policy file or pipe in a script. It'll keep our code base cleaner.

stevebestest commented 7 years ago

This sure would be a nice feature to have. :-D