Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion sonic_platform_base/chassis_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class ChassisBase(device_base.DeviceBase):
# available on the chassis
_sfp_list = []

# List of component names that are available on the chassis
_component_name_list = []

# Object derived from WatchdogBase for interacting with hardware watchdog
_watchdog = None

Expand Down Expand Up @@ -95,16 +98,39 @@ def get_reboot_cause(self):
"""
raise NotImplementedError

def get_component_versions(self):
def get_component_name_list(self):
"""
Retrieves a list of the names of components available on the chassis (e.g., BIOS, CPLD, FPGA, etc.)

Returns:
A list containing the names of components available on the chassis
"""
return self._component_name_list

def get_firmware_version(self, component_name):
"""
Retrieves platform-specific hardware/firmware versions for chassis
componenets such as BIOS, CPLD, FPGA, etc.
Args:
component_name: A string, the component name.

Returns:
A string containing platform-specific component versions
"""
raise NotImplementedError

def install_component_firmware(self, component_name, image_path):
"""
Install firmware to component
Args:
component_name: A string, the component name.
image_path: A string, path to firmware image.

Returns:
A boolean, True if install was successful, False if not
"""
raise NotImplementedError

##############################################
# Module methods
##############################################
Expand Down
36 changes: 36 additions & 0 deletions sonic_platform_base/module_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class ModuleBase(device_base.DeviceBase):
# available on the module
_sfp_list = []

# List of component names that available on the chassis
_component_name_list = []

def get_base_mac(self):
"""
Retrieves the base MAC address for the module
Expand Down Expand Up @@ -66,6 +69,39 @@ def get_system_eeprom_info(self):
"""
raise NotImplementedError

def get_component_name_list(self):
"""
Retrieves a list of the names of components available on the module (e.g., BIOS, CPLD, FPGA, etc.)

Returns:
A list containing the names of components available on the module.
"""
return self._component_name_list

def get_firmware_version(self, component_name):
"""
Retrieves platform-specific hardware/firmware versions for chassis
componenets such as BIOS, CPLD, FPGA, etc.
Args:
component_name: A string, the component name.

Returns:
A string containing platform-specific component versions
"""
raise NotImplementedError

def install_component_firmware(self, component_name, image_path):
"""
Install firmware to component
Args:
component_name: A string, the component name.
image_path: A string, path to firmware image.

Returns:
A boolean, True if install was successful, False if not
"""
raise NotImplementedError

##############################################
# Fan module methods
##############################################
Expand Down