Comments (6)
Make the existing function actually use the expression/filter.
from xen-api.
For most classes, these functions are auto-generated. However, messages are implemented differently, as they are not stored in the usual xapi DB, but directly in the file system as XML files (due to the volume). So this one may be missing, but it should be possible to implement it. See ocaml/xapi/xapi_message.ml
.
from xen-api.
Oh okay, so maybe I got it wrong: I thought the where
clause was used to filter a property in the XAPI object (eg like the name
which can be "ALARM".
But it seems you are telling me it's used to filter on the XML content of the message ie the body
entry. Example:
# xe message-param-list uuid=5c128a5e-06c6-787f-4ab1-7f7f86ec74fa
uuid ( RO) : 5c128a5e-06c6-787f-4ab1-7f7f86ec74fa
name ( RO): ALARM
priority ( RO): 3
class ( RO): SR
obj-uuid ( RO): 6e6ee285-0efe-63d8-c354-d5f760e4d96c
timestamp ( RO): 20230328T14:46:01Z
body ( RO): value: 1.0
config:
<variable>
<name value="physical_utilisation"/>
<alarm_trigger_level value="0.8"/>
<alarm_trigger_period value ="60"/>
</variable>
My concern is not filtering the body but the name
directly, to only get the filtered results (I don't want to fetch 10,000 messages). So it might be another new method added in the message class then?
from xen-api.
No, the body may or may not contain XML, it depends on the message. But the messages themselves, including the name etc, are stored as XML files. Look in /var/xapi/blobs/messages
. Here's an example:
# xmllint --format /var/xapi/blobs/messages/VM/614f7739-e975-7447-e76f-b7099cffe2f0/1692885300.00000
<?xml version="1.0" encoding="UTF-8"?>
<message>
<generation>45076</generation>
<ref>OpaqueRef:5f4969f7-6417-1a14-b658-c531282cc5aa</ref>
<name>VM_SHUTDOWN</name>
<priority>5</priority>
<cls>VM</cls>
<obj_uuid>614f7739-e975-7447-e76f-b7099cffe2f0</obj_uuid>
<timestamp>20230824T13:55:00Z</timestamp>
<uuid>9b4f5e63-4b59-2365-fe4f-c3cd89fec9db</uuid>
<body>VM 'win10-x64' (uuid: 614f7739-e975-7447-e76f-b7099cffe2f0) shutdown</body>
</message>
So you could implement a filter on name
, priority
etc.
from xen-api.
Okay so what would the next recommended step:
- using the existing
get_all_records_where
to build that filter - create a new method in the message class
- something else?
from xen-api.
Okay we might get back to you with some questions on the "right way" to implement that. Thank you!
from xen-api.
Related Issues (20)
- [SMAPIv3] `VDI.copy` generates an error, then logs at debug level it is safe to ignore
- multiple dom0 attach failed with SMAPIv3 HOT 1
- [SMAPIv3] Error accessing device in `xe vbd-plug` leaves device "half plugged"
- [SMAPIv3] `xe vdi-create` leaves VDI half-created on error in `Volume.set` for `vdi-type=user`
- [SMAPIv3] `xe sr-create` does not report an error when `SR.attach` fails HOT 1
- [RFC] New API methods to let clients display accurate status about SecureBoot and UEFI certs HOT 2
- Allowing xe VM import URL via HTTPS
- "Emergency Network Reset" interferes with `network-init` when trying to fix VLAN specification
- Firstboot script failures not reported to the user
- Use host FQDN in VM console URLs HOT 1
- setting back `is-a-template=false` on a VM causes inconsistent state
- ISO SR is confused by unreadable files
- Reduce freeze time when suspending a VM HOT 2
- Support Chunk encoding
- Management-interface bridge created with wrong MAC on boot, can poison ARP caches
- CA-395874: interface-rename port to python3 is incomplete HOT 4
- Guest with 2 distinct VBD sharing the same `userdevice` - following race condition around `VM.revert`? HOT 1
- Inconsistent generation of stunnel certificates on upgrade HOT 8
- fingerprint_sha256 and fingerprint_sha1 empty after upgrade for user certs in /etc/stunnel/certs/ HOT 4
- Better error message on VM.start when topology is wrong
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xen-api.