| edition = "2023"; |
| |
| package milotic_tlbmc; |
| |
| import "gpio_config.proto"; |
| 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>"). |
| 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. |
| LedBehavior default_behavior = 3; |
| // If true, persists the previous state when no rules match. |
| bool persist_previous_state = 4 [default = false]; |
| } |
| |
| 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; |
| // Name of the sensor in shared memory (e.g., "sharedmem_test_sensor"). |
| string shared_memory = 6; |
| } |
| } |
| |
| message LedCondition { |
| string expression = 1; |
| } |
| |
| // Configuration for triggering an LED policy based on a GPIO interrupt event. |
| message LedGpioTrigger { |
| // Name of the monitored GPIO line (matching a defined GpioConfig.name). |
| string gpio_name = 1; |
| // Edge event type to trigger on (e.g. GPIO_EVENT_RISING, GPIO_EVENT_FALLING, |
| // or GPIO_EVENT_BOTH). Must be specified and cannot be GPIO_EVENT_UNKNOWN. |
| GpioEventType event_type = 2; |
| } |
| |
| message LedTrigger { |
| oneof trigger { |
| // Name of the event (e.g., "indicator:on"). |
| string event = 1; |
| // GPIO event trigger configuration. |
| LedGpioTrigger gpio_trigger = 2; |
| } |
| } |
| |
| 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; |
| } |