Skip to content
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

xapi-idl: Add xcp-rrdd methods for Protocol V3 #5163

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions ocaml/xapi-idl/rrd/rrd_interface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,36 @@ module RPC_API (R : RPC) = struct
(uid_p @-> returning float_p rrd_err)
end

module Metrics = struct
let register =
let version_p =
Param.mk ~name:"version" ~description:["OpenMetrics version"] Types.string
in
declare "Plugin.Metrics.register"
[
"[Plugin.Metrics.register uid version] registers a plugin"
; "as a source of metrics using protocol V3. [uid] is a unique"
; "identifier for the plugin, often the name of the plugin."
; "[version] specifies the OpenMetrics version to use in protocol V3."
]
(uid_p @-> version_p @-> returning string_p rrd_err)

let deregister =
declare "Plugin.Metrics.deregister"
["Deregisters a plugin by uid"]
(uid_p @-> returning unit_p rrd_err)

let get_versions =
let versions_p =
Param.mk ~name:"versions" ~description:["Supported OpenMetrics versions"] string list
in
declare "Plugin.Metrics.get_versions"
[
"Get the list of OpenMetrics versions that are supported."
]
(unit_p @-> returning versions_p rrd_err)
end

let register =
let freq_p =
Param.mk ~name:"frequency"
Expand Down