You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xapi_message: Implement proper expression handling in get_all_records_where (xapi-project#6411)
Messages are not stored in the database, so their handling is done
through Custom_actions. The custom implementation of
get_all_records_where, in particular, used to ignore the query
expression altogether (as if expr = true).
Expand the existing handler to evaluate the query and match against the
messages retrieved and parsed from disk.
An alternative approach would have instead special cased filtering code
in the database itself, but in my attempts this was awkward and
duplicated quite a lot of code.
With this it is possible to filter messages properly now:
```
>>> session.xenapi.message.get_all_records_where('field "name" = "VM_STARTED"')
<list of messages with name = VM_STARTED>
>>> session.xenapi.message.get_all_records_where('field "name" = "VM_STARTED" and field "obj_uuid" = "3c61111f-1d67-7db4-95a5-f0287aff57bf"')
<list of messages with name = VM_STARTED and obj_uuid with such value>
```
Also update the documentation to match new behaviour.
Closesxapi-project#6340
0 commit comments