Class HostInfoProvider
Defined in File host_info_provider.hpp
Class Documentation
-
class HostInfoProvider
Reads local host system info and produces a default Component entity.
Used in runtime_only discovery mode to create a single host-level Component instead of synthetic per-namespace Components.
Public Functions
-
HostInfoProvider()
-
inline const Component &get_default_component() const
Get the default Component representing the local host system.
The Component has:
id = sanitized hostname (alphanumeric + underscore + hyphen, lowercase)
name = raw hostname
source = “runtime”
description = “OS on arch”
x-medkit.host metadata with hostname, os, arch
- Returns:
Component entity for the local host
-
inline const std::string &hostname() const
Get raw hostname.
-
inline const std::string &os() const
Get OS description (from /etc/os-release PRETTY_NAME)
-
inline const std::string &arch() const
Get CPU architecture (from uname)
Public Static Functions
-
static std::string sanitize_entity_id(const std::string &input)
Sanitize a string to a valid SOVD entity ID.
Converts dots and spaces to underscores, strips other invalid characters, converts to lowercase, and truncates to 256 characters.
- Parameters:
input – Raw string (e.g., hostname)
- Returns:
Sanitized entity ID (alphanumeric + underscore + hyphen only)
-
HostInfoProvider()