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