Skip to content

Commit

Permalink
Merge pull request sonic-net#82 from nazariig/master-component-firmwa…
Browse files Browse the repository at this point in the history
…re-api

[component]: Introduce new firmware management API
  • Loading branch information
liat-grozovik authored Apr 30, 2020
2 parents f1f00ec + d96344e commit 28c39c5
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions sonic_platform_base/component_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,72 @@ def get_firmware_version(self):
"""
Retrieves the firmware version of the component
Note: the firmware version will be read from HW
Returns:
A string containing the firmware version of the component
"""
raise NotImplementedError

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

def get_firmware_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
This API performs firmware installation only: this may/may not be the same as firmware update.
In case platform component requires some extra steps (apart from calling Low Level Utility)
to load the installed firmware (e.g, reboot, power cycle, etc.) - this must be done manually by user
Note: in case immediate actions are required to complete the component firmware update
(e.g., reboot, power cycle, etc.) - will be done automatically by API and no return value provided
Args:
image_path: A string, path to firmware image
Returns:
A boolean, True if install was successful, False if not
"""
raise NotImplementedError

def update_firmware(self, image_path):
"""
Updates firmware of the component
This API performs firmware update: it assumes firmware installation and loading in a single call.
In case platform component requires some extra steps (apart from calling Low Level Utility)
to load the installed firmware (e.g, reboot, power cycle, etc.) - this will be done automatically by API
Args:
image_path: A string, path to firmware image
Raises:
RuntimeError: update failed
"""
raise NotImplementedError

0 comments on commit 28c39c5

Please sign in to comment.