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