Project

General

Profile

Actions

Feature #19680

open

Search fact_values for hosts with fact1 AND fact2

Added by Matteo Castellarin over 7 years ago. Updated over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Search
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

It is possible to fetch selected facts from Foreman for all the machines with the command below:

  • curl -k -i -u '' "https://foreman.company.com/api/v2/fact_values?search=name%3Dvmware%3A%3Atemplate%20or%20project%3A%3Aname&per_page=10000"
Such command filters the two following facts:
  • vmware::template
    
  • project::name
    

Where the "encoded URL" provided is:

name=vmware::template or name=project::name

Question is...
The "or" clause (that we are using) works as expected, while the "and" clause surprisingly does not. Is this a known limitation? How can one query an "and" clause?

Actions

Also available in: Atom PDF