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 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 */
113 /** Event: Firmware updated successfully */
115 /** Event: Firmware update failed */
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 */
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 */
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 */
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 */
179
180 /**
181 * Discard the currently uploaded firmware image, cancel the update.
182 */
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 management methods
Definition Firmware.idl:121
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:91
@ CROSS_OEM
Ignore version, product and OEM constraints.
Definition Firmware.idl:92
@ ALLOW_UNTRUSTED
Allow untrusted firmwares (ignored when secure boot is active)
Definition Firmware.idl:94
@ CROSS_HW
Ignore hardware constraints.
Definition Firmware.idl:93
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:40
@ UPLOADING
A firmware image is currently being uploaded.
Definition Firmware.idl:42
@ COMPLETE
A complete image has been successfully uploaded/downloaded.
Definition Firmware.idl:46
@ UPLOAD_FAILED
There was a problem uploading an image to the device.
Definition Firmware.idl:43
@ DOWNLOADING
The device is downloading a firmware image from a URL.
Definition Firmware.idl:44
@ DOWNLOAD_FAILED
There was a problem downloading the image from a URL.
Definition Firmware.idl:45
@ NONE
No firmware image has been uploaded/downloaded.
Definition Firmware.idl:41
Basic IDL definitions.
Definition Event.idl:10
Event: Firmware updated successfully.
Definition Firmware.idl:114
Event: Firmware update base event.
Definition Firmware.idl:106
string newVersion
Firmware version the device is being upgraded to.
Definition Firmware.idl:108
string oldVersion
Firmware version the device is being upgraded from.
Definition Firmware.idl:107
Event: Firmware update failed.
Definition Firmware.idl:116
Event: Firmware update started.
Definition Firmware.idl:112
Event: Firmware validation failed.
Definition Firmware.idl:103
Firmware image information
Definition Firmware.idl:63
boolean signature_present
true if the image is signed
Definition Firmware.idl:78
string hwid_blacklist
Hardware ID blacklist.
Definition Firmware.idl:74
string version
Firmware image version
Definition Firmware.idl:66
boolean model_list_present
true if the image includes a supported models list
Definition Firmware.idl:84
string min_downgrade_version
Minimum image version for running firmware.
Definition Firmware.idl:68
boolean signature_good
true if the signature is valid
Definition Firmware.idl:80
string oem
OEM name.
Definition Firmware.idl:72
string hwid_whitelist
Hardware ID whitelist.
Definition Firmware.idl:73
string signed_by
Signature issuer.
Definition Firmware.idl:79
boolean model_supported
true if the model is found on the support list
Definition Firmware.idl:85
boolean compatible
true if the image is compatible with this device
Definition Firmware.idl:76
string product
Product name.
Definition Firmware.idl:70
boolean certificate_good
true if the key certificate is valid
Definition Firmware.idl:82
string platform
Platform name.
Definition Firmware.idl:71
string certified_by
Key certificate issuer.
Definition Firmware.idl:81
boolean valid
The file is a valid firmware image.
Definition Firmware.idl:64
string min_required_version
Minimum running firmware version for image.
Definition Firmware.idl:67
Image upload/download status.
Definition Firmware.idl:52
int size_done
Progress of the running upload or download (if available)
Definition Firmware.idl:57
string error_message
Error message; empty if there was no error.
Definition Firmware.idl:54
ImageState state
Image upload/download state.
Definition Firmware.idl:53
time time_started
UNIX timestamp (UTC) of the last state change (if available)
Definition Firmware.idl:55
int size_total
Total size of the image (if available)
Definition Firmware.idl:56
Event: System shutdown started.
Definition Firmware.idl:100
Event: System startup finished.
Definition Firmware.idl:98
Firmware update history entry TODO: implement CR# 45668 on next interface change add comment field ba...
Definition Firmware.idl:29
string oldVersion
Previous firmware version.
Definition Firmware.idl:31
string imageMD5
MD5 hash of update image.
Definition Firmware.idl:33
string imageVersion
Firmware version of update image.
Definition Firmware.idl:32
UpdateHistoryStatus status
Update status.
Definition Firmware.idl:34
time timestamp
UNIX timestamp (UTC) when the update was started.
Definition Firmware.idl:30
Common base for all events.
Definition Event.idl:13