Show Table of Contents
第 5 章 CLI 查询
5.1. 查询语法
CLI 的
list 命令使用 --query 参数来执行服务器端的查询,这个查询的语法规则和 Red Hat Virtualization Manager 搜索查询语言的语法相同:
表 5.1. 搜索查询示例
| 集合 | 搜索条件 | 结果 |
|---|---|---|
hosts | vms.status=up | 显示所有正在运行虚拟机的主机列表,这些虚拟机的状态需要为 up。 |
vms | domain=qa.company.com | 显示在指定域中运行的所有虚拟机列表。 |
vms | users.name=mary | 显示属于用户 mary 的所有虚拟机列表。 |
events | severity>normal sortby time | 显示所有 severity 的值高于 normal 的事件,并以时间顺序排序。 |
events | severity>normal sortby time desc | 显示所有 severity 的值高于 normal 的事件,并以时间进行倒序排序。 |

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.