Legrand / Raritan / Server Technology Xerus™ JSON-RPC API

Loading...
Searching...
No Matches
Firmware.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2009 Raritan Inc. All rights reserved.
4 */
5
6#include <UserEvent.idl>
7#include <Event.idl>
8
9/**
10 * %Firmware Management
11 */
12module firmware {
13
14 /**
15 * %Firmware update history status
16 */
17 enumeration UpdateHistoryStatus {
18 SUCCESSFUL, ///< The update was successfully completed
19 FAILED, ///< The update failed
20 INCOMPLETE ///< The update was not completed
21 };
22
23 /**
24 * %Firmware update history entry
25 * TODO: implement CR# 45668 on next interface change
26 * add comment field based on firmware tag "char tag[64];"
27 * to improve firmware update history entries without rootfs images
28 */
29 structure UpdateHistoryEntry {
30 time timestamp; ///< UNIX timestamp (UTC) when the update was started
31 string oldVersion; ///< Previous firmware version
32 string imageVersion; ///< Firmware version of update image
33 string imageMD5; ///< MD5 hash of update image
34 UpdateHistoryStatus status; ///< Update status
35 };
36
37 /**
38 * Image upload/download state
39 */
40 enumeration ImageState {
41 NONE, ///< No firmware image has been uploaded/downloaded
42 UPLOADING, ///< A firmware image is currently being uploaded
43 UPLOAD_FAILED, ///< There was a problem uploading an image to the device
44 DOWNLOADING, ///< The device is downloading a firmware image from a URL
45 DOWNLOAD_FAILED, ///< There was a problem downloading the image from a URL
46 COMPLETE ///< A complete image has been successfully uploaded/downloaded
47 };
48
49 /**
50 * Image upload/download status
51 */
52 structure ImageStatus {
53 ImageState state; ///< Image upload/download state
54 string error_message; ///< Error message; empty if there was no error
55 time time_started; ///< UNIX timestamp (UTC) of the last state change (if available)
56 int size_total; ///< Total size of the image (if available)
57 int size_done; ///< Progress of the running upload or download (if available)
58 };
59
60 /**
61 * %Firmware image information
62 */
63 structure ImageInfo {
64 boolean valid; ///< The file is a valid firmware image
65
66 string version; ///< %Firmware image version
67 string min_required_version; ///< Minimum running firmware version for image
68 string min_downgrade_version; ///< Minimum image version for running firmware
69
70 string product; ///< Product name
71 string platform; ///< Platform name
72 string oem; ///< OEM name
73 string hwid_whitelist; ///< Hardware ID whitelist
74 string hwid_blacklist; ///< Hardware ID blacklist
75
76 boolean compatible; ///< \c true if the image is compatible with this device
77
78 boolean signature_present; ///< \c true if the image is signed
79 string signed_by; ///< Signature issuer
80 boolean signature_good; ///< \c true if the signature is valid
81 string certified_by; ///< Key certificate issuer
82 boolean certificate_good; ///< \c true if the key certificate is valid
83
84 boolean model_list_present; ///< \c true if the image includes a supported models list
85 boolean model_supported; ///< \c true if the model is found on the support list
86 };
87
88 /**
89 * Flags for startUpdate() method
90 */
91 enumeration UpdateFlags {
92 CROSS_OEM, ///< Ignore version, product and OEM constraints
93 CROSS_HW, ///< Ignore hardware constraints
94 ALLOW_UNTRUSTED ///< Allow untrusted firmwares (ignored when secure boot is active)
95 };
96
97 /** Event: System startup finished */
98 valueobject SystemStartupEvent extends idl.Event {};
99 /** Event: System shutdown started */
100 valueobject SystemShutdownEvent extends event.UserEvent {};
101
102 /** Event: Firmware validation failed */
103 valueobject FirmwareValidationFailedEvent extends event.UserEvent {};
104
105 /** Event: Firmware update base event */
106 valueobject FirmwareUpdateEvent extends event.UserEvent {
107 string oldVersion; ///< Firmware version the device is being upgraded from
108 string newVersion; ///< Firmware version the device is being upgraded to
109 };
110
111 /** Event: Firmware update started */
112 valueobject FirmwareUpdateStartedEvent extends FirmwareUpdateEvent {};
113 /** Event: Firmware updated successfully */
114 valueobject FirmwareUpdateCompletedEvent extends FirmwareUpdateEvent {};
115 /** Event: Firmware update failed */
116 valueobject FirmwareUpdateFailedEvent extends FirmwareUpdateEvent {};
117
118 /**
119 * %Firmware management methods
120 */
121 interface Firmware {
122
123 /**
124 * Reboot the device.
125 *
126 * This function will fail if a firmware update is in progress.
127 */
128 void reboot();
129
130 /**
131 * Reset the device configuration to factory defaults.
132 */
133 void factoryReset();
134
135 /**
136 * Reset all device data to factory defaults. This includes energy
137 * counters, firmware update history and reliability data.
138 *
139 * @note This command is only available during manufacturing!
140 *
141 * @return 0 if OK
142 * @return 1 if not in production mode
143 */
144 int hardFactoryReset();
145
146 /**
147 * Semi-hard factory reset for manufacturing.
148 *
149 * This command clears both the user and system configuration layer,
150 * but keeps the ETO cache and subcontroller security association.
151 *
152 * @note This command is only available during manufacturing!
153 *
154 * @return 0 if OK
155 * @return 1 if not in production mode
156 */
157 int manufacturingReset();
158
159 /**
160 * Returns the currently installed firmware version.
161 *
162 * @return %Firmware version
163 */
164 string getVersion();
165
166 /**
167 * Fetch the firmware update history.
168 *
169 * @return Vector of firmware update history entries
170 */
171 vector<UpdateHistoryEntry> getUpdateHistory();
172
173 /**
174 * Get the current firmware image upload/download status.
175 *
176 * @return Image status structure.
177 */
178 ImageStatus getImageStatus();
179
180 /**
181 * Discard the currently uploaded firmware image, cancel the update.
182 */
183 void discardImage();
184
185 /**
186 * Return information about a currently uploaded firmware image.
187 *
188 * @param info %Firmware image information
189 *
190 * @return \c true if a firmware image is uploaded, \c false otherwise.
191 */
192 boolean getImageInfo(out ImageInfo info);
193
194 /**
195 * Launch the firmware update process. The device will stop handling
196 * RPC requests shortly after this method has been successfully called.
197 * The client should poll the fwupdate_progress.cgi page to monitor the
198 * update progress.
199 *
200 * @param flags List of firmware update flags; may be empty
201 */
202 void startUpdate(in vector<UpdateFlags> flags);
203
204 };
205
206}
firmware::Firmware
Firmware management methods
Definition Firmware.idl:121
firmware::Firmware::getVersion
string getVersion()
Returns the currently installed firmware version.
firmware::Firmware::getImageStatus
ImageStatus getImageStatus()
Get the current firmware image upload/download status.
firmware::Firmware::factoryReset
void factoryReset()
Reset the device configuration to factory defaults.
firmware::Firmware::startUpdate
void startUpdate(in vector< UpdateFlags > flags)
Launch the firmware update process.
firmware::Firmware::manufacturingReset
int manufacturingReset()
Semi-hard factory reset for manufacturing.
firmware::Firmware::discardImage
void discardImage()
Discard the currently uploaded firmware image, cancel the update.
firmware::Firmware::hardFactoryReset
int hardFactoryReset()
Reset all device data to factory defaults.
firmware::Firmware::reboot
void reboot()
Reboot the device.
firmware::Firmware::getUpdateHistory
vector< UpdateHistoryEntry > getUpdateHistory()
Fetch the firmware update history.
firmware::Firmware::getImageInfo
boolean getImageInfo(out ImageInfo info)
Return information about a currently uploaded firmware image.
firmware
Firmware Management
Definition Firmware.idl:12
firmware::UpdateFlags
UpdateFlags
Flags for startUpdate() method.
Definition Firmware.idl:91
firmware::CROSS_OEM
@ CROSS_OEM
Ignore version, product and OEM constraints.
Definition Firmware.idl:92
firmware::ALLOW_UNTRUSTED
@ ALLOW_UNTRUSTED
Allow untrusted firmwares (ignored when secure boot is active)
Definition Firmware.idl:94
firmware::CROSS_HW
@ CROSS_HW
Ignore hardware constraints.
Definition Firmware.idl:93
firmware::UpdateHistoryStatus
UpdateHistoryStatus
Firmware update history status
Definition Firmware.idl:17
firmware::FAILED
@ FAILED
The update failed.
Definition Firmware.idl:19
firmware::INCOMPLETE
@ INCOMPLETE
The update was not completed.
Definition Firmware.idl:20
firmware::SUCCESSFUL
@ SUCCESSFUL
The update was successfully completed.
Definition Firmware.idl:18
firmware::ImageState
ImageState
Image upload/download state.
Definition Firmware.idl:40
firmware::UPLOADING
@ UPLOADING
A firmware image is currently being uploaded.
Definition Firmware.idl:42
firmware::COMPLETE
@ COMPLETE
A complete image has been successfully uploaded/downloaded.
Definition Firmware.idl:46
firmware::UPLOAD_FAILED
@ UPLOAD_FAILED
There was a problem uploading an image to the device.
Definition Firmware.idl:43
firmware::DOWNLOADING
@ DOWNLOADING
The device is downloading a firmware image from a URL.
Definition Firmware.idl:44
firmware::DOWNLOAD_FAILED
@ DOWNLOAD_FAILED
There was a problem downloading the image from a URL.
Definition Firmware.idl:45
firmware::NONE
@ NONE
No firmware image has been uploaded/downloaded.
Definition Firmware.idl:41
idl
Basic IDL definitions.
Definition Event.idl:10
firmware::FirmwareUpdateCompletedEvent
Event: Firmware updated successfully.
Definition Firmware.idl:114
firmware::FirmwareUpdateEvent
Event: Firmware update base event.
Definition Firmware.idl:106
firmware::FirmwareUpdateEvent::newVersion
string newVersion
Firmware version the device is being upgraded to.
Definition Firmware.idl:108
firmware::FirmwareUpdateEvent::oldVersion
string oldVersion
Firmware version the device is being upgraded from.
Definition Firmware.idl:107
firmware::FirmwareUpdateFailedEvent
Event: Firmware update failed.
Definition Firmware.idl:116
firmware::FirmwareUpdateStartedEvent
Event: Firmware update started.
Definition Firmware.idl:112
firmware::FirmwareValidationFailedEvent
Event: Firmware validation failed.
Definition Firmware.idl:103
firmware::ImageInfo
Firmware image information
Definition Firmware.idl:63
firmware::ImageInfo::signature_present
boolean signature_present
true if the image is signed
Definition Firmware.idl:78
firmware::ImageInfo::hwid_blacklist
string hwid_blacklist
Hardware ID blacklist.
Definition Firmware.idl:74
firmware::ImageInfo::version
string version
Firmware image version
Definition Firmware.idl:66
firmware::ImageInfo::model_list_present
boolean model_list_present
true if the image includes a supported models list
Definition Firmware.idl:84
firmware::ImageInfo::min_downgrade_version
string min_downgrade_version
Minimum image version for running firmware.
Definition Firmware.idl:68
firmware::ImageInfo::signature_good
boolean signature_good
true if the signature is valid
Definition Firmware.idl:80
firmware::ImageInfo::oem
string oem
OEM name.
Definition Firmware.idl:72
firmware::ImageInfo::hwid_whitelist
string hwid_whitelist
Hardware ID whitelist.
Definition Firmware.idl:73
firmware::ImageInfo::signed_by
string signed_by
Signature issuer.
Definition Firmware.idl:79
firmware::ImageInfo::model_supported
boolean model_supported
true if the model is found on the support list
Definition Firmware.idl:85
firmware::ImageInfo::compatible
boolean compatible
true if the image is compatible with this device
Definition Firmware.idl:76
firmware::ImageInfo::product
string product
Product name.
Definition Firmware.idl:70
firmware::ImageInfo::certificate_good
boolean certificate_good
true if the key certificate is valid
Definition Firmware.idl:82
firmware::ImageInfo::platform
string platform
Platform name.
Definition Firmware.idl:71
firmware::ImageInfo::certified_by
string certified_by
Key certificate issuer.
Definition Firmware.idl:81
firmware::ImageInfo::valid
boolean valid
The file is a valid firmware image.
Definition Firmware.idl:64
firmware::ImageInfo::min_required_version
string min_required_version
Minimum running firmware version for image.
Definition Firmware.idl:67
firmware::ImageStatus
Image upload/download status.
Definition Firmware.idl:52
firmware::ImageStatus::size_done
int size_done
Progress of the running upload or download (if available)
Definition Firmware.idl:57
firmware::ImageStatus::error_message
string error_message
Error message; empty if there was no error.
Definition Firmware.idl:54
firmware::ImageStatus::state
ImageState state
Image upload/download state.
Definition Firmware.idl:53
firmware::ImageStatus::time_started
time time_started
UNIX timestamp (UTC) of the last state change (if available)
Definition Firmware.idl:55
firmware::ImageStatus::size_total
int size_total
Total size of the image (if available)
Definition Firmware.idl:56
firmware::SystemShutdownEvent
Event: System shutdown started.
Definition Firmware.idl:100
firmware::SystemStartupEvent
Event: System startup finished.
Definition Firmware.idl:98
firmware::UpdateHistoryEntry
Firmware update history entry TODO: implement CR# 45668 on next interface change add comment field ba...
Definition Firmware.idl:29
firmware::UpdateHistoryEntry::oldVersion
string oldVersion
Previous firmware version.
Definition Firmware.idl:31
firmware::UpdateHistoryEntry::imageMD5
string imageMD5
MD5 hash of update image.
Definition Firmware.idl:33
firmware::UpdateHistoryEntry::imageVersion
string imageVersion
Firmware version of update image.
Definition Firmware.idl:32
firmware::UpdateHistoryEntry::status
UpdateHistoryStatus status
Update status.
Definition Firmware.idl:34
firmware::UpdateHistoryEntry::timestamp
time timestamp
UNIX timestamp (UTC) when the update was started.
Definition Firmware.idl:30
idl::Event
Common base for all events.
Definition Event.idl:13