REST API - search for hosts which might not be monitored

Prior to our last upgrade from 2.4.0psomething to 2.5.0p2, I could call ‘/objects/host_config/${CMKHOST}?effective_attributes=true’ using an incomplete hostname, and get all the matching hosts returned (e.g. ‘web’ would return ‘web0, web1…’) but now this only requires an exact match in the name.

The /domain-types/host/collections/all endpoint allows me to specify a query using a regular expression - but that only returns monitored hosts and I need to see ones which are set to “do not monitor” as well.

Is there an endpoint I can query using a regex or prefix which will return hosts regardless of criticality?

As a really ugly workaround, I can scrape the names from the wato (setup) search html…

WATO="https://$CMKHOST/$SITE/watp.py"

RES=$( curl -s -i -w "\n%{http_code}" -G "${WATO}" \
  --data-urlencode "attr_display_bake_agent_package=0" \
  --data-urlencode "attr_display_inventory_failed=0" \
  --data-urlencode "attr_display_locked_attributes=0" \
  --data-urlencode "attr_display_meta_data=0" \
  --data-urlencode "attr_display_waiting_for_discovery=0" \
  --data-urlencode "filled_in=edit_host" \
  --data-urlencode "folder=" \
  --data-urlencode "host_search=1" \
  --data-urlencode "host_search_host=${CMKQUERY}" \
  --data-urlencode "mode=folder" \
  -H "$AUTHHDR" 2>/dev/null)

MATCHED="$( echo "$RES" | \
   grep -o -P '(?:host=)([a-z0-9_-.]+)(?:&mode=edit_host)' \
   | cut -d'=' -f2 | cut -d'&' -f1 | sort -u )"