API Operators

Hi!

I hope everything goes well. We (my team and I) have a doubt about the use of the operators in API in endpoint api/management/v2/inventory/filters/search

When we set the equal ($eq) operator, everything works fine, like this example

curl -X POST -H "Authorization: Bearer $PERSONAL_ACCESS_TOKEN" -H 'Content-Type: application/json' -H 'Accept: application/json'  $MENDER_SERVER_URI/api/management/v2/inventory/filters/search -d @json

{
  "page": 1,
  "per_page": 200,
  "filters": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory",
      "type": "$eq",
      "value": "7c9a6515"
    }
  ],
  "sort": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory",
      "order": "asc"
    }
  ],
  "attributes": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory"
    }
  ]
}
[{"id":"03d47853-426a-4773-a3b7-7f7ded511d9e","attributes":[{"name":"rootfs-image.script.version","value":"7c9a6515","scope":"inventory"}],"updated_ts":"0001-01-01T00:00:00Z"}]

but when we tried another operator (different from $eq) we got an error, like this:

{
  "page": 1,
  "per_page": 200,
  "filters": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory",
      "type": "$ne",
      "value": "7c9a6515"
    }
  ],
  "sort": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory",
      "order": "asc"
    }
  ],
  "attributes": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory"
    }
  ]
}
{"error":"type: must be a valid value.","request_id":"58db008e-a880-43c9-bf3a-db7d855005f9"}

Are these operators (others than $eq) part of the subscription plan?

Hello @archibaldodlc,

Yes, the guess is actually correct, you’ve hit a shortcoming in the API documentation. The operators other than $eq are only available in the Hosted and Enterprise On-Premise offers. I’ll pass this to the team to improve the endpoint notes.

You can find the swagger spec here.

Greetz,
Josef

Ok, I understand. Thanks for the response @TheYoctoJester

Regards,
Archibaldo.