Skip to content

Commit 2632a59

Browse files
committed
[component]: Introduce new firmware management API.
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
1 parent 116eeec commit 2632a59

1 file changed

Lines changed: 56 additions & 1 deletion

File tree

sonic_platform_base/component_base.py

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,37 @@ def get_firmware_version(self):
3939
"""
4040
raise NotImplementedError
4141

42+
def get_available_firmware_version(self, image_path):
43+
"""
44+
Retrieves the available firmware version of the component
45+
46+
Args:
47+
image_path: A string, path to firmware image
48+
49+
Returns:
50+
A string containing the available firmware version of the component
51+
"""
52+
raise NotImplementedError
53+
54+
def get_update_notification(self, image_path):
55+
"""
56+
Retrieves a notification on what should be done in order to complete
57+
the component firmware update
58+
59+
Args:
60+
image_path: A string, path to firmware image
61+
62+
Returns:
63+
A string containing the component firmware update notification if required.
64+
By default 'None' value will be used, which indicates that no actions are required
65+
"""
66+
return None
67+
4268
def install_firmware(self, image_path):
4369
"""
44-
Installs firmware to the component
70+
Installs firmware to the component.
71+
It's user's responsibility to complete firmware update
72+
in case some extra steps are required (e.g., reboot, power cycle, etc.)
4573
4674
Args:
4775
image_path: A string, path to firmware image
@@ -50,3 +78,30 @@ def install_firmware(self, image_path):
5078
A boolean, True if install was successful, False if not
5179
"""
5280
raise NotImplementedError
81+
82+
def update_firmware(self, image_path):
83+
"""
84+
Updates firmware of the component.
85+
It's API's responsibility to complete firmware update
86+
in case some extra steps are required (e.g., reboot, power cycle, etc.)
87+
88+
Args:
89+
image_path: A string, path to firmware image
90+
91+
Raises:
92+
RuntimeError: update failed
93+
"""
94+
raise NotImplementedError
95+
96+
def is_delayed_firmware_update_supported(self, image_path):
97+
"""
98+
Retrieves a value indicating whether immediate actions are required
99+
to complete the component firmware update (e.g., reboot, power cycle, etc.)
100+
101+
Args:
102+
image_path: A string, path to firmware image
103+
104+
Returns:
105+
A boolean, True if delayed firmware update supported, False if not
106+
"""
107+
raise NotImplementedError

0 commit comments

Comments
 (0)