# HG changeset patch # User Rob Hoes # Date 1267012969 0 # Node ID 45afe5480cfca242e4b8cc403b65baa3dc9046ce # Parent 64d19cc82053e494ed647895994fc56f88c52b90 Add explicit functions for specific alerts. Signed-off-by: Rob Hoes diff -r 64d19cc82053 -r 45afe5480cfc ocaml/license/v6alert.ml --- a/ocaml/license/v6alert.ml Wed Feb 24 12:02:48 2010 +0000 +++ b/ocaml/license/v6alert.ml Wed Feb 24 12:02:49 2010 +0000 @@ -23,3 +23,11 @@ (fun () -> Client.Message.create xapirpc session msg 1L `Host host_uuid body) (fun () -> Client.Session.logout xapirpc session) +let send_v6_grace_license () = + ignore (send_alert Api_messages.v6_grace_license "The license server is unreachable. However, a grace license is given, as a similar license was successfully checked out recently.") + +let send_v6_rejected () = + ignore (send_alert Api_messages.v6_rejected "The requested license is not available at the license server.") + +let send_v6_comm_error () = + ignore (send_alert Api_messages.v6_comm_error "The license could not be checked out, because the license server could not be reached at the given address/port. Please check the connection details, and verify that the license server is running.") diff -r 64d19cc82053 -r 45afe5480cfc ocaml/license/v6alert.mli --- a/ocaml/license/v6alert.mli Wed Feb 24 12:02:48 2010 +0000 +++ b/ocaml/license/v6alert.mli Wed Feb 24 12:02:49 2010 +0000 @@ -13,6 +13,11 @@ *) (** Helper module to let the licensing daemon send alerts to xapi *) +(** Send a XenAPI message *) val send_alert : string -> string -> API.ref_message -(** Send a XenAPI message *) +val send_v6_grace_license : unit -> unit + +val send_v6_rejected : unit -> unit + +val send_v6_comm_error : unit -> unit