Perspective Shell: 匹配实例的完整主机名

Perspective Shell: match instances full hostname

我云中的所有虚拟机都具有以下主机名模式:<vm_name>.example.com,其中 vm_name 是虚拟机名称,example.com 是某个固定域名。有什么方法不仅可以匹配 VM 名称,还可以考虑完整的主机名,例如:

perspective> show instances --name vm-one,vm-two
perspective> show instances --name vm-one.example.com,vm-two.example.com # I would like this!

您应该在 ~/.perspective/rc 文件中指定所有可用域区域(所谓的 "instance suffixes"),如下所示:

set instance_suffixes = .example.com,.test.net

然后像往常一样搜索实例:

perspective> show instances --name vm-one.example.com,vm-two.test.net