5.5. Using Extended Searches

You can find search parameters that you can use to build your search queries in the web UI. For more information, see Building Search Queries in Administering Red Hat Satellite.

For example, to search for hosts, complete the following steps:

  1. In the Satellite web UI, navigate to Hosts > All Hosts and click the Search field to display a list of search parameters.
  2. Locate the search parameters that you want to use. For this example, locate os_title and model.
  3. Combine the search parameters in your API query as follows:

    Example request:

    $ 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

    Example response:

      {
        ...
        "results": [
            {
                "model_id": 1,
                "model_name": "PowerEdge R330",
                "name": "satellite.example.com",
                "operatingsystem_id": 1,
                "operatingsystem_name": "RedHat 7.7",
                ...
            }
        ],
        "search": "os_title=\"RedHat 7.7\",model=\"PowerEdge R330\"",
        "subtotal": 1,
        "total": 11
    }