yarpc / yab

Call and benchmark YARPC services from the command line.
MIT License
85 stars 33 forks source link

Support arguments to yaml templates #153

Open prashantv opened 7 years ago

prashantv commented 7 years ago

We often have common queries (either for testing, or administration) that have some parameters.

It would be nice if we could use a YAML template and parameterize parts of it (e.g., the service name, or some part of the request body).

E.g., if --health didn't exist, we might have a yaml template like:

#!/usr/bin/yab -y

service: $service
thrift: ./idl/meta.health
procedure: Meta::health
body:
  user: ${user:prashant}

And we could do ./health.yaml --arg service:foo --arg user:foo

minglecm commented 7 years ago

I saw that we now have support for YAML templates (so awesome!), but did argument support come with that?

prashantv commented 7 years ago

Not yet! We have a bit of work to do before we can do argument support:

It will probably take a couple of weeks but is definitely on our roadmap (especially pre 1.0)

kriskowal commented 7 years ago

Recommending -A for short, to sit with -H and -B.

Config is environment driven. Should we use environment for template arguments?

prashantv commented 7 years ago

Hmm, falling back to environment variables does seem nice, although they tend to be uppercase.

What if we supported ${user:USER:prashant} to specify preferences, or is that getting too complicated?