5.5. 使用扩展搜索
您可以在 Web UI 中找到可用于构建搜索查询的搜索参数。如需更多信息,请参阅管理 Red Hat Satellite 中的 构建搜索查询。
例如,要搜索主机,请完成以下步骤:
- 在 Satellite Web UI 中,进入到 Hosts > All Hosts,点 Search 字段显示搜索参数列表。
- 找到您要使用的搜索参数。在本例中,找到 os_title 和 model。
组合 API 查询中的搜索参数,如下所示:
请求示例:
curl --insecure --user sat_username:sat_password \ https://satellite.example.com/api/v2/hosts?search=os_title=\"RedHat+7.7\",model=\"PowerEdge+R330\" \ | python -m json.tool
$ curl --insecure --user sat_username:sat_password \ https://satellite.example.com/api/v2/hosts?search=os_title=\"RedHat+7.7\",model=\"PowerEdge+R330\" \ | python -m json.tool
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 响应示例:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow