commit | 400fd1fb4020028ad58b1cfd965f26d21f63b8c8 | [log] [tgz] |
---|---|---|
author | Adriana Kobylak <anoo@us.ibm.com> | Fri Jan 29 09:01:30 2021 -0600 |
committer | Ed Tanous <ed@tanous.net> | Fri Apr 02 18:15:08 2021 +0000 |
tree | 5ae7d7ab14cd02d6246bd0c14785a9c1370f1818 | |
parent | f86bb901bf02b65ed25bc4545aaebe0f4dc891b3 [diff] |
log_services: Add download of log entries Add a GET function for endpoint /redfish/v1/Systems/system/LogServices/EventLog/attachment/<str> which would read the File Path property of the specified entry, encode it as base64, and send it off. This allows the user to offload error logs for analysis and further parsing if needed. An http header of "Accept: application/octet-stream" or the default "*/*" is expected. Tested: - Ran Redfish validator. - Verified the contents of the offloaded file were the same as the file in the BMC, after decoding it with a base64 decoder. curl -k -H "X-Auth-Token: $token" \ https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/attachment/2 - Verified the supported Accept header values, ex: "Accept: application/octet-stream;q=1" "Accept: text/plain;q=0,application/octet-stream;q=1,multipart/form-data;q=2" - Verified an unsupported Accept header returned "Bad Request", ex: curl -k -H "X-Auth-Token: $token" -H "Accept: application/*" curl -k -H "X-Auth-Token: $token" -H "Accept: foo, not/supported" - Verified 404 was returned for a not found endpoint: $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/attachment/foo { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type EventLogAttachment named foo was not found.", "MessageArgs": [ "EventLogAttachment", "foo" ], "MessageId": "Base.1.8.1.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.8.1.ResourceNotFound", "message": "The requested resource of type EventLogAttachment named foo was not found." } } Change-Id: Id9e2308ebedc70852a2ed62def107648f7e6fb7a Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D
flags that correspond to options in bmcweb/meson_options.txt
and then compiling. For example, meson <builddir> -Dkvm=disabled ...
followed by ninja
in build directory. The option names become C++ preprocessor symbols that control which code is compiled into the program.
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C buildir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in bmcweb/subprojects
.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja coverage -C builddir test
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the secp384r1
algorithm. The certificate
C=US, O=OpenBMC, CN=testhost
,SHA-256
algorithm.