<commit_before>(*
 * Copyright (C) 2006-2009 Citrix Systems Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; version 2.1 only. with the special
 * exception on linking described in file LICENSE.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *)
(** Interface to the Inventory file *)
 
exception Missing_inventory_key of string

val read_inventory: unit -> unit
val reread_inventory: unit -> unit

val lookup: string -> string
val remove: string -> unit
val update: string -> string -> unit

val parse_inventory_entry: string -> (string * string) option

(* Keys defined in Geneva *)
val _product_brand : string
val _product_name : string
val _product_version : string
val _build_number : string
val _kernel_version : string
val _xen_version : string
val _installation_date : string
val _default_sr : string
val _primary_disk : string
val _backup_partition : string
val _installation_uuid : string
val _default_sr_physdevs : string
val _dom0_mem : string


(* Keys defined in Rio *)
val _control_domain_uuid : string
val _management_interface : string

(* Keys defined in Miami *)
val _oem_manufacturer : string
val _oem_model : string
val _oem_build_number : string
val _machine_serial_number : string
val _machine_serial_name : string

(* Keys defined in Orlando *)
val _current_interfaces : string<commit_msg>[ocamldoc] Docs for the module handling the inventory file<commit_after>(*
 * Copyright (C) 2006-2009 Citrix Systems Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; version 2.1 only. with the special
 * exception on linking described in file LICENSE.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *)
(** Interface to the Inventory file *)

(** The inventory file is a file containing key-value pair of information
 *  related to the host. It is stored at /etc/xensource-inventory. *)

(** Thrown when trying to retrieve a non-existing key. *)
exception Missing_inventory_key of string

(** Reads the inventory file from disk. *)
val read_inventory: unit -> unit

(** Clears the copy of the inventory file in memory and reads the file from disk. *)
val reread_inventory: unit -> unit

(** Return the value of key [key] in the inventory file. Throws {!Missing_inventory_key}
 *  if the key does not exist. *)
val lookup: string -> string

(** Remove the key with the given name from the inventory file, if it exists. *)
val remove: string -> unit

(** Change the contents of key [key] in the inventory file to [value]. The key
 *  is added if it does not yet exist. *)
val update: string -> string -> unit

(** Parses a line [line] from the inventory file, and returns a key-value pair if successful. *)
val parse_inventory_entry: string -> (string * string) option

(* Keys defined in Geneva *)
(** Brand name, such as "XenServer" *)
val _product_brand : string

(** Product name, such as "xenenterprise" *)
val _product_name : string

(** Product version *)
val _product_version : string

(** Build number *)
val _build_number : string

(** Dom0 kernel version *)
val _kernel_version : string

(** Xen version *)
val _xen_version : string

(** Date on which the host was installed *)
val _installation_date : string

(** UUID of the default SR (?) *)
val _default_sr : string

(** Device path of primary disk *)
val _primary_disk : string

(** Device path of backup partition *)
val _backup_partition : string

(** UUID of the Host object in the xapi database *)
val _installation_uuid : string

(** Device path of the default SR used for local storage *)
val _default_sr_physdevs : string

(** Memory size of dom0 (?) *)
val _dom0_mem : string


(* Keys defined in Rio *)
(** UUID of the control domain (dom0) *)
val _control_domain_uuid : string

(** UUID of the management PIF *)
val _management_interface : string

(* Keys defined in Miami *)
(** OEM manufacturer name *)
val _oem_manufacturer : string

(** OEM model name *)
val _oem_model : string

(** OEM edition build number *)
val _oem_build_number : string

(** Machine serial number *)
val _machine_serial_number : string

(** Machine serial name *)
val _machine_serial_name : string

(* Keys defined in Orlando, redefined in MNR *)
(** List of bridges that are automatically brought up when the host starts up *)
val _current_interfaces : string
{'fraction_non_alphanumeric': 0.0789366883116883, 'fraction_numerical': 0.005073051948051948, 'mean_word_length': 4.345986984815618, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2949108', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1320, 'n_words': 638}