vmware-archive / dispatch

Dispatch is a framework for deploying and managing serverless style applications.
http://dispatchframework.io
Apache License 2.0
532 stars 58 forks source link

Add a --context flag to dispatch #593

Open neosab opened 6 years ago

neosab commented 6 years ago

Feature Request

Add a --context flag to dispatch CLI.

Detailed Description

You can have multiple contexts in the dispatch config file (~/.dispatch/config.json). Each context stores the location of a dispatch endpoint. Currently, to switch context you need to do dispatch manage context --set <context_name>. This is helpful as long as you intend to work in that context for some time.

But it's not possible to temporarily switch to a context and run a single command e.g. I just need to see if the functions are getting invoked in my production dispatch but I don't want to switch context and accidentally delete the resources in it. Hence, it will be nice to add a --context global flag to the CLI and switch the context only for that CLI command.

e.g. dispatch get functions (retrieves functions from my default dispatch context) dispatch --context prod-dispatch get functions (retrieves functions from my prod dispatch context) dispatch delete function process-credit-payment (Phew! that was just my dev-cluster)

Context

Possible Implementation

Complexity

neosab commented 6 years ago

Zhiming can you take this?

pzmrzy commented 6 years ago

Ok I will try this.