diff --git a/sonic_platform_base/chassis_base.py b/sonic_platform_base/chassis_base.py index 3cbeeac7a..864d6541b 100644 --- a/sonic_platform_base/chassis_base.py +++ b/sonic_platform_base/chassis_base.py @@ -144,6 +144,17 @@ def get_my_slot(self): """ return NotImplementedError + def is_modular_chassis(self): + """ + Retrieves whether the sonic instance is part of modular chassis + + Returns: + A bool value, should return False by default or for fixed-platforms. + Should return True for supervisor-cards, line-cards etc running as part + of modular-chassis. + """ + return False + ############################################## # Component methods ############################################## diff --git a/sonic_platform_base/device_base.py b/sonic_platform_base/device_base.py index 3116f2471..909449d2c 100644 --- a/sonic_platform_base/device_base.py +++ b/sonic_platform_base/device_base.py @@ -11,6 +11,12 @@ class DeviceBase(object): peripheral device """ + # Possible status LED colors + STATUS_LED_COLOR_GREEN = "green" + STATUS_LED_COLOR_AMBER = "amber" + STATUS_LED_COLOR_RED = "red" + STATUS_LED_COLOR_OFF = "off" + def get_name(self): """ Retrieves the name of the device diff --git a/sonic_platform_base/fan_drawer_base.py b/sonic_platform_base/fan_drawer_base.py index ed3fc18c8..ed9e72ea9 100644 --- a/sonic_platform_base/fan_drawer_base.py +++ b/sonic_platform_base/fan_drawer_base.py @@ -81,3 +81,13 @@ def get_status_led(self, color): A string, one of the predefined STATUS_LED_COLOR_* strings above """ raise NotImplementedError + + def get_maximum_consumed_power(self): + """ + Retrives the maximum power drawn by Fan Drawer + + Returns: + A float, with value of the maximum consumable power of the + component. + """ + raise NotImplementedError diff --git a/sonic_platform_base/module_base.py b/sonic_platform_base/module_base.py index 2c187c7cd..88011dc07 100644 --- a/sonic_platform_base/module_base.py +++ b/sonic_platform_base/module_base.py @@ -186,6 +186,16 @@ def set_admin_state(self, up): """ raise NotImplementedError + def get_maximum_consumed_power(self): + """ + Retrives the maximum power drawn by this module + + Returns: + A float, with value of the maximum consumable power of the + module. + """ + raise NotImplementedError + ############################################## # Component methods ############################################## diff --git a/sonic_platform_base/psu_base.py b/sonic_platform_base/psu_base.py index 69a5fd214..04aacd4c4 100644 --- a/sonic_platform_base/psu_base.py +++ b/sonic_platform_base/psu_base.py @@ -15,12 +15,6 @@ class PsuBase(device_base.DeviceBase): # Device type definition. Note, this is a constant. DEVICE_TYPE = "psu" - # Possible fan status LED colors - STATUS_LED_COLOR_GREEN = "green" - STATUS_LED_COLOR_AMBER = "amber" - STATUS_LED_COLOR_RED = "red" - STATUS_LED_COLOR_OFF = "off" - # List of FanBase-derived objects representing all fans # available on the PSU _fan_list = None @@ -32,6 +26,9 @@ class PsuBase(device_base.DeviceBase): # PSU class _thermal_list = [] + # Status of Master LED + psu_master_led_color = device_base.DeviceBase.STATUS_LED_COLOR_OFF + def __init__(self): self._fan_list = [] @@ -219,3 +216,35 @@ def get_voltage_low_threshold(self): e.g. 12.1 """ raise NotImplementedError + + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU + + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + raise NotImplementedError + + @classmethod + def get_status_master_led(cls): + """ + Gets the state of the Master status LED for a given device-type + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings. + """ + return cls.psu_master_led_color + + @classmethod + def set_status_master_led(cls, color): + """ + Gets the state of the Master status LED for a given device-type + + Returns: + bool: True if status LED state is set successfully, False if + not + """ + cls.psu_master_led_color = color + return True