Amalgam8命令行界面

a8ctl的Python项目详细描述


Amalgam8的命令行工具(http://www.amalgam8.io/)。

安装

要安装Amalgam8 CLI,请执行以下操作:

sudo pip install git+https://github.com/amalgam8/a8ctl #install from github repo. Preferred.

sudo pip install a8ctl # from pypi
sudo pip install a8ctl==<version> # for specific version, e.g., pip install a8ctl==0.1.8

有关用法信息,请运行以下命令:

a8ctl -h

命令

a8ctl service-list

a8ctl route-list
a8ctl route-set <service> [--default <tags>][--selector <tags> "("(weight "=" <weight> | user "=" <name> | header "=" <name> ":" <pattern>)")"]*
a8ctl route-delete <service>

a8ctl action-list
a8ctl action-add [--source <service>[":" <tags>]][--destination <service>][--header <name> ":" <pattern>]* [--cookie <key> "=" <value>]* [--action <tags> "(" <probability> "->"(delay "=" <seconds> | abort "=" <return_code>)")"]* [--priority <number>]
a8ctl rule-delete <rule-id>

a8ctl traffic-start <service> <tags> [--amount <percent>]
a8ctl traffic-step <service> [--amount <percent>]
a8ctl traffic-abort <service>

示例

$ a8ctl service-list
+-------------+---------------------+
| Service     | Instances           |
+-------------+---------------------+
| reviews     | v1(1), v2(1), v3(1) |
| productpage | v1(1)               |
| ratings     | v1(1)               |
| helloworld  | v1(2), v2(2)        |
| details     | v1(1)               |
+-------------+---------------------+

$ a8ctl route-set productpage --default v1
Set routing rules for productpage productpage

$ a8ctl route-set helloworld --default v1 --selector 'v2(weight=0.25)'
Set routing rules for microservice helloworld

$ a8ctl route-set reviews --default v1 --selector 'v2(user="frankb")' --selector 'v3(user="shriram")'
Set routing rules for microservice reviews

$ a8ctl route-list
+-------------+-----------------+---------------------------------------+
| Service     | Default Version | Version Selectors                     |
+-------------+-----------------+---------------------------------------+
| productpage | v1              |                                       |
| reviews     | v1              | v2(user="frankb"), v3(user="shriram") |
| ratings     |                 |                                       |
| details     |                 |                                       |
| helloworld  | v1              | v2(weight=0.25)                       |
+-------------+-----------------+---------------------------------------+

$ a8ctl action-add --source reviews:v2 --destination ratings --cookie user=jason --action 'v1(1->delay=7)'
Set action rule for destination ratings

$ a8ctl action-add --source productpage:v1 --destination reviews --cookie user=jason --header Foo:bar --action 'v2(0.5->delay=5)' --action 'v2(1->abort=400)' --priority 15
Set action rule for destination reviews

$ a8ctl action-list
+-------------+----------------+-------------------------------+----------+----------------------------------------+--------------------------------------+
| Destination | Source         | Headers                       | Priority | Actions                                | Rule Id                              |
+-------------+----------------+-------------------------------+----------+----------------------------------------+--------------------------------------+
| reviews     | productpage:v1 | Foo:bar, Cookie:.*?user=jason | 15       | v2(0.5->delay=5.0), v2(1.0->abort=400) | 4ccad0c9-277f-49ae-89be-d900cf66a24d |
| ratings     | reviews:v2     | Cookie:.*?user=jason          | 10       | v1(1.0->delay=7.0)                     | e76d79e6-8b3e-45a7-87e7-674480a92d7c |
+-------------+----------------+-------------------------------+----------+----------------------------------------+--------------------------------------+

$ a8ctl rule-delete e76d79e6-8b3e-45a7-87e7-674480a92d7c
Deleted rule with id: e76d79e6-8b3e-45a7-87e7-674480a92d7c

$ a8ctl traffic-start reviews v2
Transfer starting for reviews: diverting 10% of traffic from v1 to v2
$ a8ctl traffic-step reviews
Transfer step for reviews: diverting 20% of traffic from v1 to v2
$ a8ctl traffic-step reviews --amount 40
Transfer step for reviews: diverting 40% of traffic from v1 to v2
...
$ a8ctl traffic-step reviews
Transfer step for reviews: diverting 90% of traffic from v1 to v2
$ a8ctl traffic-step reviews
Transfer complete for reviews: sending 100% of traffic to v2

$ a8ctl traffic-start reviews v2
Transfer starting for reviews: diverting 10% of traffic from v1 to v2
$ a8ctl traffic-abort reviews
Transfer aborted for reviews: all traffic reverted to v1

贡献

将考虑提议和请求。 有关详细信息,请参阅https://github.com/amalgam8/amalgam8.github.io/blob/master/CONTRIBUTING.md文件。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
安卓中通过TCP发送时java文件损坏   Java测试预期=异常失败,断言错误   java ssh4 LazyInitializationException   java是否可以在集合中添加重复项?   java是一个免费的开源数据库管理工具   java是否可以在导出的html中嵌入图像   编译器构造解释一些东西,并用Java运行生成的字节码?   java KeyPairGenerator未生成随机密钥   java使用正则表达式生成字符串而不是匹配字符串   java中的多线程线程间通信   具有复合密钥的java Hibernate合并问题   java不能在MainActivity类之外使用SharedReferences变量   正在获取切割/零件异常消息。使用java Spring ControllerAdvice   java tomcat漏洞讨论   javascript在Java中实现“system”命令   java如何在JUnit5*中加载*Spring测试上下文之前获取回调?   java bluej关于缺少返回语句   JavaSpringBoot@ModelAttribute包含使用字符串键的其他模型   从可选中抛出异常。ifPresent()Java 8