-
Notifications
You must be signed in to change notification settings - Fork 297
CA-420987: xapi_message: Add message-destroy-all API #6806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
930ef54 to
4e1c6da
Compare
|
Could we have an alternative approach where messages are deleted depending on a filter? In particular by age and by priority are interesting here. |
|
If you would like to over-engineer this:
exception Failure of string
type expression
type value = Bool of bool | Float of float
type env
val empty : unit -> env
val add : env -> string -> float -> unit
val add' : env -> string list -> float -> unit
val env : (string * float) list -> env
val compile : string -> expression
val string : env -> string -> value
val expr : env -> expression -> value
val simple : string -> valueYou can provide an environment that binds names to values and an expression which then can be evaluated: $ make utop
utop # Expr.Eval.simple "3+4*5 == 23";;
- : Expr.Eval.value = Expr.Eval.Bool true
utop # let env = Expr.Eval.env ["pi", Float.pi] in
Expr.Eval.string env "pi * pi";;
- : Expr.Eval.value = Expr.Eval.Float 9.86960440108935799If you want to do this, would suggest to just copy the |
4e1c6da to
4cbe39f
Compare
|
@psafont I've added parameters to select messages to delete by priority, before a timestamp, and after a timestamp. Is this what you were hoping for? |
|
@lindig I'll keep it simple for now, I don't see a need for advanced filtering though it would be a fun thing to do. If the frontend people need it I can always add it with an extra filter= parameter. |
psafont
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current PR only modifies the CLI interface (xe is its only user), and doesn't modify the API for Xencenter, is this intended?
To modify the API, the functions are in ocaml/idl and, maybe https://github.com/xapi-project/xen-api/blob/master/ocaml/xapi/xapi_message.ml as well
4cbe39f to
dfaec8f
Compare
|
Thanks for that, I've added the new message to idl and moved the implementation over to xapi_message |
make_param_funs was building up a list by applying List.map and List.filter several times. This commit combines and streamlines these. Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
aa8b729 to
627b221
Compare
We've seen issues where a client will try to dismiss all their alerts and fail due to the message-destroy call hitting the maximum XAPI request size at ~5000 messages. A new message-destroy-all API avoids this issue while saving the bandwidth required to send a ref for each message. Users of the new API call can choose to dismiss messages that arrived before or after a certain date, or only those with a given priority. Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
627b221 to
fb618b2
Compare
|
Just tested it and the command works as expected. |
We've seen issues where a client will try to dismiss all their alerts and fail due to the message-destroy call hitting the maximum XAPI request size at ~5000 messages.
A new message-destroy-all API avoids this issue while saving the bandwidth required to send a ref for each message.