summaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2022-12-13black: re-formatPatrick Williams2-20/+12
black and isort are enabled in the openbmc-build-scripts on Python files to have a consistent formatting. Re-run the formatter on the whole repository. Change-Id: I00a6615fdb2b47ffee38e4bf649dd644eb636844 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
2022-12-12Fix python packaging problemEd Tanous1-34/+33
Python packaging seems to have changed to be much more stringent about what version strings is accepts. It's not clear why this was done, but we need a fix to unbreak CI. This commit adds more parsing code into the script to parse out version numbers from the form of LogEntry.v1_2_3 to split them up into a custom class, and sort manually. Despite dropping the dependency, this ends up dropping a net 7 lines of code compared to using the library, so it seems worth it, especially given the breaking API change. One seemingly unrelated change was that we were adding schema folders to the sort lists, which don't sort well because they have no version numbers or extensions. This fixes to only add individual files to the list of things to sort. Tested: Code no longer crashes. Running update_schemas.py generates the same result (with one minor same-prefix sort order change). Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I1a792ffb4ad7bc71637ab1aa0648a245949aeeee
2022-12-08Generate Redfish enums from schemasEd Tanous2-0/+166
OpenBMC tends to have a significant problem in doing the appropriate lookups from the schema files, and many bugs have been injected by users picking a bad enum, or mistyping the casing of an enum value. At the same time, nlohmann::json has recently added first class support for enums, https://json.nlohmann.me/features/enum_conversion/ This commit attempts to build a set of redfish includes file with all the available Redfish enums in an easy to use enum class. This makes it very clear which enums are supported by the schemas we produce, and adds very little to no extra boilerplate on the human-written code we produced previously. Note, in the generated enum class, because of our use of the clang-tidy check for macros, the clang-tidy check needs an exception for these macros that don't technically follow the coding standard. This seems like a reasonable compromise, and in this case, given that nlohmann doesn't support a non-macro version of this. One question that arises is what this does to the binary size.... Under the current compiler optimizations, and with the current best practices, it leads to an overall increase in binary size of ~1200 bytes for the enum machinery, then approximately 200 bytes for every call site we switch over. We should decide if this nominal increase is reasonable. Tested: Redfish protocol validator runs with same number of failures as previously. Redfish Service Validator passes (one unrelated qemu-specific exception) Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7c7ee4db0823f7c57ecaa59620b280b53a46e2c1
2022-12-07format: reformat with latest openbmc-build-scriptsPatrick Williams4-138/+163
Reformat the repository using the latest from openbmc-build-scripts. Add the `static/redfish` directory to be ignored by prettier since these files come from elsewhere and having the ability to do a direct diff is handy. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I74464d6f97047b4888a591e0d8a4f5ca970ac69e
2022-12-05python: fix flake8 warningsPatrick Williams2-9/+7
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6bcc6c72e1855c7de7c8b1e88cbab01e92b4070d
2022-11-08Add ThermalMetrics schemaGeorge Liu1-0/+1
Based on DSP8010_2022.2 and adds the ThermalMetrics schema. ThermalMetrics is child of the ThermalSubsystem schema. It is part of the new Power/Thermal Schemas. ThermalMetrics contains temperature readings and the corresponding link to that sensor in the sensor collection. Temperatures such as Ambient, Exhaust, Intake, and Internal can be found in the schema. Tested: built bmcweb successfully and validator passes. Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I16ad2f922acc963a0434f3d9ab5583d2242b0013
2022-10-18Add EnvironmentMetrics schemaGeorge Liu1-0/+1
Based on DSP8010_2022.2 and adds the EnvironmentMetrics schema. Tested: built bmcweb successfully and validator passes Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I994b48c544edc22a6bf99187b536f3e51e10b052
2022-10-05Add PowerSubsystem PowerSupply and PowerSupplyCollection schemaChicago Duan1-0/+3
Add schemas for PowerSubsystem PowerSupply and PowerSupplyCollection. Tested: built bmcweb successfully and validator passes. Signed-off-by: Chicago Duan <duanzhijia01@inspur.com> Change-Id: I913d690108e30c841d5dec5fa37c7b9cee43f7c1
2022-09-30Make the schemas.hpp generated file #include arrayEd Tanous1-0/+1
The script missed a #include. Add it. Tested: Code compiles. Header change only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib38a46d8e97e4aadb596b4ff68795cea06e62fde
2022-09-30Add Fan and FanCollection schemaGeorge Liu1-0/+2
Based on DSP8010_2022.2 and adds the schema of Fan and FanCollection. Tested: built bmcweb successfully and validator passes Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Id1867a6f19d47d0fb1d686d650f7d936c33b5284
2022-09-28Move to 2022.2Asmitha Karunanithi1-1/+1
Run the script update_schemas.py by pointing it to 2022.2 An overview of 2022.2 release can be found at: [1] https://www.dmtf.org/sites/default/files/Redfish_Release_2022.2_Overview.pdf Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic729af6848badd1c81121e61a22a7115e553358a
2022-09-28Update Redfish schema pack to 2022.1Ed Tanous1-1/+1
Update to an intermediate schema pack. This is not the newest, but is an incremental commit to allow us to differentiate different versions of the schema packs evolution. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4e5905a3ed40ca41b095c39b4d29c074b6eaeb67
2022-09-28Sort schema list alphabeticallyEd Tanous1-83/+110
New versions of the DMTF schema pack seem to make this list parse in less-than-ideal order. Previously, the schema pack zip file had an order that was at least semi-alphabetical, but 2022.2 seems to cause that to change. This commit makes the update_schemas.py script explicitly alphabetize the list. This changes the order of two keys that have common prefixes, but leaves the rest of the order the same. Both are arguably correct. This commit also exposes that this script seemed to have lots of problems in its version number detection logic. To make all this work properly, a fairly invasive change is required. Tested: Running the script on 2021.4 produces the same result as previously. See later commits for 2022.2 where result is now correct. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia2365daee1d91de142652161bf752600f3109115
2022-09-28parse_registry: make the script more flexibleNan Zhou1-81/+104
Now it supports updating individual registry. Run parse_registries.py to see all the options. This speeds up development of the script itself: e.g., when developing privilege related generator, we don't want to regenerate other headers every time during development. ``` usage: parse_registries.py [-h] [--registries REGISTRIES] options: -h, --help show this help message and exit --registries REGISTRIES Comma delimited list of registries to update ``` ``` [hi on] nanzhou@nanzhou:~/Desktop/bmcweb$ time scripts/parse_registries.py real 0m1.493s user 0m0.401s sys 0m0.046s [hi on] nanzhou@nanzhou:~/Desktop/bmcweb$ time scripts/parse_registries.py --registries privilege real 0m0.667s user 0m0.213s sys 0m0.030s ``` This saves 50% of the time. Though the absolute time to generate a full list if small. By default, it generates all the registries. Tested: tested the script, it can update headers correctly. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: If13748a605a462f5dc7d83bad52360942b7dc6b7
2022-09-26Run black formatter on scripts/update_schemas.pyEd Tanous1-174/+195
https://black.readthedocs.io/en/stable/ Is a formatter that takes a more opinionated stance on pep8 compliance than others, and as such gives us more consistent python code, even if that's not currently enforced by ci. In addition, it allows patches to automate their pep8 compliance similar to how we've done clang-format for c++. We've done this transform other places throughout the codebase and gotten a decent result, so duplicate it in bmcweb.. Run the black tool on update_schemas.py. Tested: Reran update_schemas.py, and generated output is identical Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I83f47025ac61d0afd5df87ddb33f84269160191c
2022-09-21registries: iwyuNan Zhou1-2/+6
Made the auto-generated headers and the openbmc registry include what they use. Also alligned the include style. Tested: code compiles. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I6577d5e12bc02da3bd7bf5780f89a4860b314e19
2022-09-21privilege registry: simplify writing headersNan Zhou1-14/+15
This patch reused similar patterns in |REGISTRY_HEADER| so that the python code is more readable. It also moved the clang-format off macro and warning a bit in so they are all consistent with each other. Tested: code compiles. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: If18de0d9f89088f9b5732613ecf59520650bb11a
2022-08-09scripts: registry: remove unuesd importsNan Zhou1-11/+2
Suggested by https://peps.python.org/pep-0008/#imports. Tested: parse_registries runs without issues. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I380f8d64caf963ac799ba255b55e36101fb7a8e4
2022-08-01Include Collections for JsonSchema resourcesEd Tanous1-2/+9
Redfish collection Json schema files are not versioned, and only have a single version file. In the script, we assumed that all files were versioned, and the script ignored files that didn't parse as versioned. This commit fixes the script, and checks in the relevant Collection resources. Tested: Redfish service validator passes on JsonSchemas resources and collection. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I579dac3fdfecf485f7d414842effa9ae0ee517e8
2022-07-07Add TermalSubsystem schemaXiaochao Ma1-0/+1
Adds the ThermalSubsystem schema to the list of the supported schemas. Tested: Code compiles. Script generated change. Signed-off-by: Xiaochao Ma <maxiaochao@inspur.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4540fcaa57455ec95d4c8fff71429309c2eebce3
2022-06-26registry: Base: Upgrade 1.11.0 -> 1.13.0Jiaqing Zhao1-1/+1
Tested: Build pass. Change-Id: Ic985b7fc15214a1e8cfa855ce2fb9a6557201c4e Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2022-06-22Update Privilege Registry from 1.2.0 to 1.3.0Sui Chen1-1/+1
This change updates the privilege registry .json file from version 1.2.0 to 1.3.0. The change in privilege_registry is generated by executing the parse_registries.py script. Tested: The build completes. Signed-off-by: Sui Chen <suichen@google.com> Change-Id: Id36fa21df1b8fbd38a3b9aaad952773b0a1a0208
2022-06-17Move the JsonSchemas to be generated at runtimeEd Tanous1-43/+36
Generating all of these index files at compile time is kind of wasteful, considering that it's really not that much code to generate them. This commit modifies the update_schemas script to generate a C++ version of the schemas that can then be used to generate a route. This allows deleting a LOT of fixed files, for a very small incremental binary size increase. This change will cause two impacts that a user could possibly notice. Expand will now work properly on JsonSchemas tree. Keys on the JsonSchema schemas will now be sorted alphabetically, as we do elsewhere. All other things should remain the same. Tested: Redfish service validator passes. curl --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/JsonSchemas/Triggers Returns the same object as before with changes above. This adds 2512 bytes to the bmcweb binary size, and interestingly, adds 3764 bytes to the overall rootfs size, despite the level of file deletion seen in the patch. While this is debatably "worse" than what we had before in this regard, making JsonSchemas work similar to how the rest of the Redfish tree operates, is worth the minor increase in code size. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic0d568112a3784821aa6867f7bcf50705dc586db
2022-06-13Add PCIeSlots schemas to the BMCEd Tanous1-0/+1
We plan on using these schemas, add them to the allow list. Tested: Code generated. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4d2cc4d580115bbaf2445469577940984e3045f0
2022-04-08registries: remove hardcoded size of MessageEntry arraysJason M. Bills1-3/+2
The latest C++ no longer requires the size of the array to be hardcoded. This removes the hardcoded size to simplify changes to the message arrays. Tested: Confirmed that event Messages are still correctly generated. Signed-off-by: Jason M. Bills <jason.m.bills@intel.com> Change-Id: I29e6a4a02c247865c275cf4ff71587bc188d5957
2022-03-28script: specify the interpreter to envNan Zhou3-3/+3
Env is generally more portable than hardcoding path. This change also keeps all scripts consistent. Tested: all can run directly. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ia2636420e54fae24a5a339377de65957ed40cc7e
2022-03-08Drop message severityEd Tanous1-1/+0
In the way we store the message registry, we store both Severity and MessageSeverity. Severity as a field is deprecated, and in every case in every registry both fields have the same value. We shouldn't duplicate data in that way. This commit changes the parse_registries.py script to stop producing the Severity field into the struct. The few uses we have left are moved over to use MessageRegistry. Tested: Redfish service validator shows no errors on the /redfish/v1/Registries tree. Other errors present that were there previously and are unchanged. This saves a trivial amount: about 1kB on our compressed binary size. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ibbaf533dc59eb08365d6ed309aba16b54bc40ca1
2022-03-08Change message_registries namespace to registriesEd Tanous1-2/+2
The message_registries namespace is overly wordy, and results in very long defines. Doing this one minor change reduces the code by 50 lines. This seems worthwhile. Tested: Unit tests pass. Namespace change only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib1401580b3fa47596eb56cdc86e60eeeb1c2f952
2022-03-07Simplify parse_registries.pyEd Tanous1-54/+72
When formatting blocks of code, there's a lot of redundant registry.write calls that obfuscate a lot of the intent. When handling whitespace, this also makes the code a level harder to read. This commit tries to avoid large blocks of registry.write entries, to make the code easier to read. Tested: ran parse_registries.py, and verified via git that it generates the same files as it did previously. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I77a885fe3eb0738e4bfb53cf321b20f691572f5b
2022-03-07Make generated warning more prominent and helpfulEd Tanous1-7/+12
A number of reviews have been submitted that ignore this warning. While we now have 01caf624211197a993dbbd186149293f7053f9d8 which will catch these violations at CI time, that is arguably already too late, and developers will have wasted their time. This commit changes the warning to be multiple lines, with a caps header, such that it's less likely to be ignored. It also adds suggestions on how to proceed. As a note, this also standardizes privilege registry to use the same warning as the other files, which it didn't previously. Tested: Comment changes only, no functional changes. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I3224130dbf581dc962187b2fde4dc98ae26de082
2022-03-07Make parse_registries do whitespace properlyEd Tanous1-46/+49
Previously, parse_registries was not very careful about generating readable files, and relied on clang-format to "fix" them after the fact. Given they're generated, this is unforunate, and leads to some inconsistencies in reading the generated code. This commit changes the script to no longer rely on clang-format, and wrap the whole file in a clang-format off bracket. This means that our message registry generation will be consistent. As an added bonus, different versions of clang-format like to format these structures differently, so this removes one possible barrier to people updating these. This was initiated by the next patch in the series, which made a seemingly minor change to a comment, which caused a significant change in this file because of clang-format versioning. Tested: ran parse_registries.py and saw build passing. Whitespace changes only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id48bb43dd9d8ecc83de1840f2f1045a87e2ff796
2022-03-02Add ManagerDiagnosticData schemaSui Chen1-0/+1
This change adds the ManagerDiagnosticData schema files. Tested: ran Redfish Service Validator: + Manager Diagnostic 2021.4 Data metadataNamespaces: 2388 2390 pass: 3249 3274 passAction: 8 8 passGet: 121 123 passRedfishUri: 115 117 skipNoSchema: 3 3 skipOptional: 2184 2198 warnDeprecated: 315 315 warningPresent: 11 11 Validation has: succeeded succeeded curl -k https://$bmc/redfish/v1/JsonSchema/ManagerDiagnosticData/\ ManagerDiagnosticData.json ... "title": "#ManagerDiagnosticData.v1_0_0.ManagerDiagnosticData" } Signed-off-by: Sui Chen <suichen@google.com> Change-Id: I0d86b45350475771acdd492a98018156f8c819dd
2022-02-28Generate indexes for message registriesEd Tanous1-2/+14
Being able to index into the message registry constexpr arrays will be useful in the future, so update the parse_registries script to generate an Index enum class, that allows directly indexing into the constexpr table when necessary. These indexes are used in the patchset here: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/50950 to avoid a binary search lookup for each entry. Tested: No-op change, code inspection only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I345cc26a2b17b5bcd8cfb0055642f4ae443caad4
2022-02-25scripts: websocket: make ssl optionalNan Zhou1-1/+8
Tested: The following command worked. ``` python scripts/websocket_test.py --host localhost:18080 --no-ssl ``` Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ib14bd8ecdb5f0cad4a8e0478d69abcdc3e46c3ec
2022-02-15Regenerate generated code as part of the buildEd Tanous1-1/+1
There are a number of cases where people don't realize that the schemas are owned by Redfish, and that some of the generated files (registries, indexes) are in fact generated, and shouldn't be modified by hand. This commit forces a regeneration of all those files within Jenkins, each time we do a local build, then does a git diff to compare if the upstream schema files and generated files are different than what is checked in, it will print the diff immediately in the Jenkins build. This should hopefully give much faster feedback to users that their change needs to modify the right files. As part of this commit, we also need to take the version string out of clang-format. CI/the system should own the clang-format version. Related commit: https://gerrit.openbmc-project.xyz/c/openbmc/openbmc-build-scripts/+/51041] Tested: Ran script, build passed. Removed the schema fixes from patch series, saw build failed. Did the same with running the openbmc-build-scripts unit test script. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I17eb0e106be267e8dbba7053b0b07ec617893c86
2022-02-10Update schema pack to 2021.4Sui Chen1-1/+1
Update the script to point to 2021.4. Tested: built for evb-ast2500, ran Redfish Service Validator: BASE 2021.4 metadataNamespaces: 2330 2388 pass: 3239 3249 passAction: 8 8 passGet: 120 121 passRedfishUri: 114 115 skipNoSchema: 3 3 skipOptional: 2180 2184 unverifiedAdditional.complex: 2 0 warnDeprecated: 315 315 warningPresent: 12 11 Validation has: succeeded succeeded Saw new schemas: curl -k https://$bmc/redfish/v1/JsonSchemas/Manager/Manager.json ... "title": "#Manager.v1_14_0.Manager" } Signed-off-by: Sui Chen <suichen@google.com> Change-Id: I6560ec010362df28e264d80452059b534b3f89ba
2022-01-26Implement Cable schemaShantappa Teekappanavar1-0/+2
This commit implements Cable and Cable collection schema on bmcweb. Testing: Validator: @odata.id /redfish/v1/Cables odata Exists PASS @odata.type #CableCollection.CableCollection odata Exists PASS Members@odata.count 2 odata Exists PASS Members Array (size: 2) links: Cable Yes ... Members[0] Link: /redfish/v1/Cables/dp0_cable0 link: Cable Yes PASS Members[1] Link: /redfish/v1/Cables/dp0_cable1 link: Cable Yes PASS Description Collection of Cable Entries none Yes PASS Name Cable Collection none Yes PASS Oem - Resource.Oem No Optional Property Name Value Type Exists Result @odata.id /redfish/v1/Cables/dp0_cable0 odata Exists PASS @odata.type #Cable.v1_0_0.Cable odata Exists PASS CableType string Yes PASS LengthMeters - number No Optional Id dp0_cable0 none Yes PASS Name Cable none Yes PASS Property Name Value Type Exists Result @odata.id /redfish/v1/Cables/dp0_cable1 odata Exists PASS @odata.type #Cable.v1_0_0.Cable odata Exists PASS CableType string Yes PASS LengthMeters - number No Optional Id dp0_cable1 none Yes PASS Name Cable none Yes PASS Note: Removed some of the fields that are optional to reduce commit msg Tesing with Curl commands: $ curl -k -X GET https://{$bmc}/redfish/v1/Cables { "@odata.id": "/redfish/v1/Cables", "@odata.type": "#CableCollection.CableCollection", "Description": "Collection of Cable Entries", "Members": [ { "@odata.id": "/redfish/v1/Cables/dp0_cable0" }, { "@odata.id": "/redfish/v1/Cables/dp0_cable1" } ], "Members@odata.count": 2, "Name": "Cable Collection" } $ curl -k -X GET https://{$bmc}/redfish/v1/Cables/dp0_cable0 { "@odata.id": "/redfish/v1/Cables/dp0_cable0", "@odata.type": "#Cable.v1_0_0.Cable", "CableType": "", "Id": "dp0_cable0", "Name": "Cable" } $ curl -k -X GET https://{$bmc}/redfish/v1/Cables/dp0_cable1 { "@odata.id": "/redfish/v1/Cables/dp0_cable1", "@odata.type": "#Cable.v1_0_0.Cable", "CableType": "", "Id": "dp0_cable1", "Name": "Cable" } Set Length property to 1.5 meters using busctl, and check the properties busctl set-property xyz.openbmc_project.Inventory.Manager \ /xyz/openbmc_project/inventory/cables/dp0_cable0 \ xyz.openbmc_project.Inventory.Item.Cable Length d 1.5 $ curl -k -X GET https://{$bmc}/redfish/v1/Cables/dp0_cable0 { "@odata.id": "/redfish/v1/Cables/dp0_cable0", "@odata.type": "#Cable.v1_0_0.Cable", "CableType": "", "Id": "dp0_cable0", "LengthMeters": 1.5, "Name": "Cable" } Signed-off-by: Shantappa Teekappanavar <sbteeks@yahoo.com> Change-Id: I832ff1c1053f4d8100d04a42cc8046a61e8c1613
2022-01-26[Fix]: Property PhysicalContext is invalid "none"sunitakx1-0/+1
Issue: Redfish validator is throwing error "PhysicalContext: This type is invalid none" for multiple temperature sensors Endpoint : /redfish/v1/Chassis/<Baseboard>/Thermal#/Temperatures/ Root Cause : PhysicalContext Schema was missing from redfish schema metadata Tested: Redfish validator script passed. *** /redfish/v1/Chassis/<baseboard>/Thermal#/Temperatures/0 Type (#Thermal.v1_3_0.Temperature), GET SUCCESS (time: 0) PASS Signed-off-by: sunitakx <sunitax.kumari@intel.com> Change-Id: Ifbfe7d96e99030c0c5ba67a1aba5080cd049e57b
2022-01-10Bump up privilege_registry to Redfish_1.2.0Shantappa Teekappanavar1-1/+1
Testing: - The privilege_registry.hpp was generated successfully after running the parse_registries script - bmcweb was built with newly generated privilege registry file Signed-off-by: Shantappa Teekappanavar <sbteeks@yahoo.com> Change-Id: I84b5f3eccbbb2c4f12b326b99fb41192b12d245a
2021-12-17Add GET method for TriggersLukasz Kazmierczak1-0/+1
Added GET method for retrieving details of individual Trigger searched by given Trigger name, details are extracted from Telemetry service Tested: - Added single Trigger and requested result from bmcweb via /redfish/v1/TelemetryService/Triggers/<triggername> - Added multiple Triggers numeric and discrete with various parameters (empty, non-empty), and requested results from bmcweb via /redfish/v1/TelemetryService/Triggers/<triggername> - Verified uris /redfish/v1/TelemetryService/Triggers/<triggername> by using Redfish-Service-Validator (all passed) Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com> Change-Id: I1c966b2f792324cc6f6a8784ad18a683e5ce7bd9
2021-12-17Add GET method for TriggerCollectionLukasz Kazmierczak1-0/+1
Added GET method for retrieving list of Triggers from Telemetry service Tested: - Added single Trigger and requested result from bmcweb via /redfish/v1/TelemetryService/Triggers - Added multiple Triggers numeric and discrete, and requested results from bmcweb via /redfish/v1/TelemetryService/Triggers - Verified uri /redfish/v1/TelemetryService/Triggers by using Redfish-Service-Validator with no Triggers/empty Collection (passed) Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com> Change-Id: Ide00eb44901ea1b97b80fc5c5ddfd97e393d4a04
2021-12-14hostlogger_test.py: reformat with blackPatrick Williams1-12/+16
pycodestyle was throwing errors in CI. Run 'black' to reformat the script. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I5138493c1e0641f0e927d0cc463ff6023f54454a
2021-12-10Redfish: Script to Expose Host Log EntriesSpencerKu1-0/+88
Simple script to expose host serial console logs, Search and get the log via redfish in every 5 seconds option: --host : Host to connect to --cert : File path to cert --username : Username to connect with --password : Password to use Signed-off-by: SpencerKu <Spencer.Ku@quantatw.com> Change-Id: Ia95735e2f03a4361ee876774b5906df18ab013b8
2021-12-01Move to 2021.3Gunnar Mills1-5/+5
Update the script to point at 2021.3, change the path of the files since they moved again, and run the script. Since we have an exclude list, this only brings in new versions of schemas bmcweb already uses. Overview of 2021.3: https://www.dmtf.org/sites/default/files/Redfish_Release_2021.3_Overview.pdf Overall, the release wasn't huge. IBM plans to use: PCIeSlot to Processor FabricAdapter to PCIeDevice Tested: See new schemas. No new validator errors. curl -k https://$bmc/redfish/v1/JsonSchemas/Certificate/Certificate.json { "$id": "http://redfish.dmtf.org/schemas/v1/Certificate.v1_5_0.json", Change-Id: Idf28cb164d220b059dace91e352fee732bf0c842 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2021-10-04Move to 2021.2Gunnar Mills1-5/+5
Update the script to point at 2021.2, change the path of the files since they moved yet again, and run the script. The directory structure moved back to the way they had it pre-2020.1: https://github.com/openbmc/bmcweb/commit/a778c0261282b95e14ea3f4406959638b5edb040 Since we have an exclude list, this only brings in new versions of schemas bmcweb already uses. Overview of 2021.2: https://www.dmtf.org/sites/default/files/Redfish_Release_2021.2_Overview.pdf IBM plans to use Control (for PowerCapping) and IdlePowerSaver immediately. Tested: Validator passed after DMTF/Redfish-Service-Validator/pull/423 merged. CI uses the latest Redfish-Service-Validator so not a problem for CI. For manual users only a small window where an older validator would fail. After the schemapack changes but before PR423. See the new schemas. Change-Id: I2fe539087167cf6d962c14bf31fa23861302646f Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2021-09-23Bump up base_message_registry to version Base.1.11.0Sunitha Harish1-1/+1
Tested by: Code compiles Signed-off-by: Sunitha Harish <sunharis@in.ibm.com> Change-Id: I229e5662eb20889e6da5575de31dc3c27c63ecd2
2021-08-17Fix update_schemas scriptSzymon Dompke1-6/+7
Script update_schemas.py was incorrectly generating schemas since change f395daac96c8122623700c2b124d905266ea8223. This was caused by treating 'edm' as 'edmx' during parse process. Additionally, glob pattern was incorrectly skipping all files starting with letter 'O', instead of 'Oem' phrase. This lead to python exceptions during generation, as the script was trying to recreate existing directories like 'OperatingConfig'. Unused imports were removed. Tested: - running update_schemas.py no longer generates malformed data and no exception were thrown. - all files generated by update_schemas.py are generated identically as before regression. Signed-off-by: Szymon Dompke <szymon.dompke@intel.com> Change-Id: I5e2025ec8b264a38cbf5bb944142c83c0486ce50
2021-08-04Enable pycodestyleEd Tanous4-47/+84
This commit allows our python code to be run through the CI format-code scripts. The exact content is copied from sdbusplus. Tested, ran pycodeformat on each script, observed it passing. Ran each script individually. check_base_registry seems broken previous to this commit, although it provides the same output. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7eacfa355b794f49308b900c2988809d2aa122c3
2021-07-13Make code compile with clang-13Ed Tanous1-2/+2
Clang-13 rightfully warns that the hasWebuiRoute variable isn't declared as static. This commit resolves that, and adds the static keyword so it can be used in multiple compile units. It also adds the static keyword to the privilege registry, and the inline keyword to many methods that now need it. clang-format is also updated to version 12 in parse_registies.py, as that's what CI uses, and what most people have installed. Tested: Followed clang-tidy instructions in README.md "bitbake bmcweb" step now succeeds. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id43b13606754cb37a404799fce155599ac3a3240
2021-07-08Generated files should not be copyrightEd Tanous1-15/+1
Because these files are generated, there is no copyright that makes sense, as these are "derivative works". sdbusplus does not include these in its generated files, bmcweb should do the same. Tested: Code compiles. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I3c729f8c03176770b31b4f54ebdbdab92daae163