blob: 458c80714578034747ae2dc71732e1e09c636a7e [file]
edition = "2023";
package milotic_tlbmc;
import "power_control.proto";
enum LedState {
LED_STATE_UNSPECIFIED = 0;
LED_STATE_OFF = 1;
LED_STATE_BLINK = 2;
LED_STATE_ON = 3;
}
message BlinkConfig {
uint32 duty_on_ms = 1 [default = 500];
uint32 duty_off_ms = 2 [default = 500];
}
message LedBehavior {
LedState state = 1 [default = LED_STATE_OFF];
// Configuration applied ONLY if state == LED_STATE_BLINK.
BlinkConfig blink_config = 2;
}
message LedOutput {
oneof target {
// Name of the sysfs LED (e.g., "blue:identify").
string sysfs_name = 1;
// Name of the GPIO LED line (e.g., "power_led" or "<chip_id>:<gpio_num>").
// TODO: b/541951164 - impl GPIO LEDs.
// string gpio_name = 2;
}
}
message LedConfig {
// Unique name identifying the LED (e.g., "fault_led", "identify_led").
string name = 1;
// Hardware output interface (sysfs or GPIO).
LedOutput output = 2;
// Default behavior applied on start / no rules matched
// set to LED_STATE_UNSPECIFIED to persist the previous state
LedBehavior default_behavior = 3;
}
message LedPresetMember {
string name = 1;
LedBehavior behavior = 2;
}
message LedPreset {
// Name of the preset (e.g., "system_fault", "chassis_identify", "power_on").
string name = 1;
// List of LEDs and their associated state controls.
repeated LedPresetMember members = 2;
}
message LedConditionVariable {
string name = 1;
// Deprecated string path replaced by structured variable sources.
reserved 2;
reserved source_path;
// Configuration to dynamically resolve a condition variable from a host's
// power control service.
message PowerControl {
// Property exposed by the power control service.
enum Property {
PROPERTY_UNSPECIFIED = 0;
PROPERTY_POWER_STATE = 1;
PROPERTY_OS_STATE = 2;
}
// Identifier of the host to query (e.g., "system").
string host_id = 1;
// Property to evaluate for this condition variable.
Property property = 2;
}
oneof value {
PowerState power_state = 3;
OSState os_state = 4;
// Dynamic variable resolved from the host's power control service.
PowerControl power_control = 5;
}
}
message LedCondition {
string expression = 1;
}
message LedTrigger {
// Name of the event that activates this policy (e.g., "indicator:on").
string event = 1;
}
message LedPolicy {
string name = 1;
string preset_name = 2;
oneof event {
LedCondition condition = 3;
LedTrigger trigger = 4;
}
}
// Configuration mapping Redfish indicator LED states to trigger events.
message LedIndicator {
// System ID of the LED (e.g., "system", "chassis").
// If not set, the LED is applied to unmatched systems as a fallback.
string system_id = 1;
// Name of the LED to control, matching a defined LedConfig.name.
string led_name = 2;
// Event name emitted when the indicator is set to ON.
string event_on = 3 [default = "indicator:on"];
// Event name emitted when the indicator is set to OFF.
string event_off = 4 [default = "indicator:off"];
// Event name emitted when the indicator is set to BLINK.
string event_blink = 5 [default = "indicator:blink"];
}
message LedConfigs {
repeated LedConfig leds = 1;
repeated LedPreset presets = 2;
repeated LedConditionVariable variables = 3;
repeated LedPolicy policies = 4;
// Indicator configurations mapping system IDs to LED trigger events.
repeated LedIndicator indicators = 5;
}