FLOCX matching syntax

A Bid submitted to the FLOCX Marketplace service may specify a set of criteria that must be satisfied in order to match with an available Offer. This document describes the syntax used to specify these matching rules in the REST API.

Basic syntax

A match expression consists of a list of 3-tuples [expression, operator, value], where:

When there are multiple 3-tuples in a match expression, they are combined using a logical AND operation (i.e., they all must match).

Operators

Prefix an operator with ! to negate the comparison.

Null operator

If operator is null, the value of expression is interpreted in a boolean context (and value is ignored).

Numeric operators

String Operators

List operators

Examples

Match a specific host architecture:

[
  ["cpu_arch", "eq", "x86_64"]
]

Match a host with at least 48GB memory:

[
  ["memory_mb", ">=", 48000]
]

Match a host with at least 16 x86_64 CPUs:

[
  ["cpu_arch", "eq", "x86_64"],
  ["inventory.cpu.count", ">=", 16]
]

Match a host that supports hardware-accelerated virtualization:

[
  [ "inventory.cpu.flags", "contains", "vmx"]
]

Match a host that does not support hardware-accelerated virtualization:

[
  [ "inventory.cpu.flags", "!contains", "vmx"]
]

Match a host with a least two rotational hard disks:

[
  ["length(inventory.disks[?\"rotational\" == `true`])", ">=", 2]
]

Match a host with 1 or more rotational hard disks:

[
  ["inventory.disks[?\"rotational\"==`true`]", null, null]
]

Match a specific manufacturer and product:

[
  ["inventory.system_vendor.manufacturer", "matches", "Dell"],
  ["inventory.system_vendor.product_name", "matches", "PowerEdge M620"]
]