Skip to content

Commit

Permalink
[component]: Introduce new firmware management API.
Browse files Browse the repository at this point in the history
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
  • Loading branch information
nazariig committed Apr 13, 2020
1 parent 116eeec commit 2632a59
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion sonic_platform_base/component_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,37 @@ def get_firmware_version(self):
"""
raise NotImplementedError

def get_available_firmware_version(self, image_path):
"""
Retrieves the available firmware version of the component
Args:
image_path: A string, path to firmware image
Returns:
A string containing the available firmware version of the component
"""
raise NotImplementedError

def get_update_notification(self, image_path):
"""
Retrieves a notification on what should be done in order to complete
the component firmware update
Args:
image_path: A string, path to firmware image
Returns:
A string containing the component firmware update notification if required.
By default 'None' value will be used, which indicates that no actions are required
"""
return None

def install_firmware(self, image_path):
"""
Installs firmware to the component
Installs firmware to the component.
It's user's responsibility to complete firmware update
in case some extra steps are required (e.g., reboot, power cycle, etc.)
Args:
image_path: A string, path to firmware image
Expand All @@ -50,3 +78,30 @@ def install_firmware(self, image_path):
A boolean, True if install was successful, False if not
"""
raise NotImplementedError

def update_firmware(self, image_path):
"""
Updates firmware of the component.
It's API's responsibility to complete firmware update
in case some extra steps are required (e.g., reboot, power cycle, etc.)
Args:
image_path: A string, path to firmware image
Raises:
RuntimeError: update failed
"""
raise NotImplementedError

def is_delayed_firmware_update_supported(self, image_path):
"""
Retrieves a value indicating whether immediate actions are required
to complete the component firmware update (e.g., reboot, power cycle, etc.)
Args:
image_path: A string, path to firmware image
Returns:
A boolean, True if delayed firmware update supported, False if not
"""
raise NotImplementedError

0 comments on commit 2632a59

Please sign in to comment.