summaryrefslogtreecommitdiff
path: root/redfish-core/lib/event_service.hpp
AgeCommit message (Collapse)AuthorFilesLines
2021-10-17Improve HttpHeaders in EventServiceEd Tanous1-2/+36
This commit moves the internal data structures to use boost::beast::http::fields as its internal data structure. fields is a hyper-optimized map implementation for http headers, and has a lot of nice escaping properties. It is what boost::beast::http::request uses under the covers, so this has some niceties in reducing the amount of code, and means we can completely remove the headers structure, and simply rely on req. When this conversion was done, now the type safety of the incoming data needs to have better checking, as loading into the keys has new requirements (like values must be strings), so that type conversion code for to and from json was added, and the POST and PATCH handler updated to put into the new structure. Tested: curl -vvvv --insecure -u root:0penBmc "https://192.168.7.2:443/redfish/v1/EventService/Subscriptions" -X POST -d "{\"Destination\":\"http://192.168.7.2:443/\",\"Context\":\"Public\",\"Protocol\":\"Redfish\",\"HttpHeaders\":[{\"Foo\":\"Bar\"}]}" returned 200. Tested various "bad" headers, and observed the correct type errors. Issued: systemctl restart bmcweb. Subscription restored properly verified with. GET https://localhost:8001/redfish/v1/EventService/Subscriptions/183211400 Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I331f65e1a3960f1812c9baac27dbdcb1d54f112c
2021-09-17Nullify HttpHeaders per the specificationEd Tanous1-1/+2
Per the definition of HttpHeaders in the schema "This object shall be null or an empty array in responses." This commit does as the specification commands. In theory, this could break clients that were checking the HttpHeaders after posting it, but it's not being put behind an option flag in this patchset for a couple reasons: 1. This has the potential to leak security secrets, as the normal use case for this is to put in Authorization headers. 2. Given that the most likely client that would "break" is the one doing the POST to this API, and it already has the data, it seems unlikely that there's any implementation that would explicitly check that the returned object is identical to the sent one, especially if error codes are handled properly. Tested: curl -vvvv --insecure -u root:0penBmc "https://192.168.7.2:443/redfish/v1/EventService/Subscriptions" -X POST -d "{\"Destination\":\"http://192.168.7.2/foo\",\"Context\":\"Public\",\"Protocol\":\"Redfish\",\"HttpHeaders\": [{\"Foo\": \"Bar\"}]}" Succeeded with 200 curl -vvvv --insecure -u root:0penBmc "https://192.168.7.2/redfish/v1/EventService/Subscriptions/405645225" Returned "HttpHeaders": [], As part of its object Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I32181044d0af6b4395daea3f6ca4480022fc7553
2021-08-06Fix event_service privilegesAbhishek Patel1-7/+3
Post method: 1) redfish/v1/EventService/Subscriptions/ ConfigureManager -> [ConfigureManager or ConfigureComponents] This change allows Admin and Operator both users to subscribe to the particular event, where only admin user has the ability before this change. Tested: manually tested on Witherspoon system. Only ConfigureManager or ConfigureComponents privilege users can subscribe to an event. TestURL: curl -k -H "X-Auth-Token: $bmc_token" -X POST -d '{"Context": "9.3.147.232", "DeliveryRetryPolicy": "TerminateAfterRetries", "Destination": "https://9.3.147.232:17443/redfish/events", "EventFormatType": "Event", "MessageIds": [], "MetricReportDefinitions": [], "Protocol": "Redfish", "RegistryPrefixes": [], "ResourceTypes": [], "SubscriptionType": "RedfishEvent"}' https://${BMC_IP}/redfish/v1/EventService/Subscriptions Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com> Change-Id: I4d3bcfaab7f5a00ada99a30fdb8f17d85531a2a8
2021-07-26EventService: Move subscription persistent dataJunLin Chen1-12/+16
This commit resolves https://github.com/openbmc/bmcweb/issues/168 Current store mechanism makes it very difficult to keep in sync with the existing files, and has caused several bugs because the path it uses different than the existing bmcweb_persistent_data.json, and it's missing several error checks. If there has old config in /var/lib/bmcweb/eventservice_config.json. Restart bmcweb will move old config to bmcweb_presistent_data.json and delete the old config. Tested: - Create new Subscription via POST https://${bmc}/redfish/v1/EventService/Subscriptions/ The subscription is successfully created and GET succussfully. Restart bmcweb or reboot. The subscription will restore. - Delete the Subscription via DELETE https://${bmc}/redfish/v1/EventService/Subscriptions/${subscription_id} The subscription is successfully delete. bmcweb_persistent_data.json will delete subscription content. - Modify EventService config via PATCH https://{{bmc}}/redfish/v1/EventService GET https://{{bmc}}/redfish/v1/EventService and the changes applied. bmcweb_persistent_data.json will apply modification after PATCH. Restart bmcweb or reboot The config maintains the changed. Signed-off-by: JunLin Chen <Jun-Lin.Chen@quantatw.com> Change-Id: Ic29385ea8231ba976bbf415af2803df2d30cb10a
2021-07-23Fix EventService Subscriptions URIRavi Teja1-3/+3
GET on subscriptions URI returns NotFound error this commit fixes URI issues Tested by: GET https://${bmc}/redfish/v1/EventService/Subscriptions/3800595217 Signed-off-by: Ravi Teja <raviteja28031990@gmail.com> Change-Id: I2952694e4786dc78248335559c8aec795bfabd6e
2021-07-08Automate PrivilegeRegistry to codeEd Tanous1-8/+20
This commit attempts to automate the creation of our privileges structures from the redfish privilege registry. It accomplishes this by updating parse_registries.py to also pull down the privilege registry from DMTF. The script then generates privilege_registry.hpp, which include const defines for all the privilege registry entries in the same format that the Privileges struct accepts. This allows new clients to simply reference the variable to these privilege structures, instead of having to manually (ie error pronely) put the privileges in themselves. This commit updates all the routes. For the moment, override and OEM schemas are not considered. Today we don't have any OEM-specific Redfish routes, so the existing ones inherit their parents schema. Overrides have other issues, and are already incorrect as Redfish defines them. Binary size remains unchanged after this patchset. Tested: Ran redfish service validator Ran test case from f9a6708c4c6490257e2eb6a8c04458f500902476 to ensure that the new privileges constructor didn't cause us to regress the brace construction initializer. Checked binary size with: gzip -c $BBPATH/tmp/work/s7106-openbmc-linux-gnueabi/obmc-phosphor-image/1.0-r0/rootfs/usr/bin/bmcweb | wc -c 1244048 (tested on previous patchset) Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ideede3d5b39d50bffe7fe78a0848bdbc22ac387f
2021-06-16Remove ambiguous privileges constructorEd Tanous1-8/+8
There are a number of endpoints that assume that a given routes privileges are governed by a single set of privileges, instead of multiple sets ORed together. To handle this, there were two overloads of the privileges() method, one that took a vector of Privileges, and one that took an initializer_list of const char*. Unfortunately, this leads some code in AccountService to pick the wrong overload when it's called like this .privileges( {{"ConfigureUsers"}, {"ConfigureManager"}, {"ConfigureSelf"}}) This is supposed to be "User must have ConfigureUsers, or ConfigureManager, or ConfigureSelf". Currently, because it selects the wrong overload, it computes to "User must have ConfigureUsers AND ConfigureManager AND ConfigureSelf. The double braces are supposed to cause this to form a vector of Privileges, but it appears that the initializer list gets consumed, and the single invocation of initializer list is called. Interestingly, trying to put in a privileges overload of intializer_list<initializer_list<const char*>> causes the compilation to fail with an ambiguous call error, which is what I would've expected to see previously in this case, but alas, I'm only a novice when it comes to how the C++ standard works in these edge cases. This is likely due in part to the fact that they were templates of an unused template param (seemingly copied from the previous method) and SFINAE rules around templates. This commit functionally removes one of the privileges overloads, and adds a second set of braces to every privileges call that previously had a single set of braces. Previous code will not compile now, which is IMO a good thing. This likely popped up in the Node class removal, because the Node class explicitly constructs a vector of Privilege objects, ensuing it can hit the right overload Tested: Ran Redfish service validator Tested the specific use case outlined on discord with: Creating a new user with operator privilege: ``` redfishtool -S Always -u root -p 0penBmc -vvvvvvvvv -r 192.168.7.2 AccountService adduser foo mysuperPass1 Operator ``` Then attempting to list accounts: ``` curl -vvvv --insecure --user foo:mysuperPass1 https://192.168.7.2/redfish/v1/AccountService/Accounts/foo ``` Which succeeded and returned the account in question. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I83e62b70e97f56dc57d43b9081f333a02fe85495
2021-06-11Redfish: Fix issue of EventDestinationChicago Duan1-3/+3
Fix the bug that can't get/patch/delete EventDestination Tested: It works good and validation has succeeded. Signed-off-by: Chicago Duan <duanzhijia01@inspur.com> Change-Id: Ideb743f9f2a7900a444bc912bfedbb75dfe7c8e7
2021-06-03Remove Redfish Node classJohn Edward Broadbent1-572/+533
Reduces the total number of lines and will allow for easier testing of the redfish responses. A main purpose of the node class was to set app.routeDynamic(). However now app.routeDynamic can handle the complexity that was once in critical to node. The macro app.routeDynamic() provides a shorter cleaner interface to the unerlying app.routeDyanic call. The old pattern set permissions for 6 interfaces (get, head, patch, put, delete_, and post) even if only one interface is created. That pattern creates unneeded code that can be safely removed with no effect. Unit test for the responses would have to mock the node the class in order to fully test responses. see https://github.com/openbmc/bmcweb/issues/181 The following files still need node to be extracted. virtual_media.hpp account_service.hpp redfish_sessions.hpp ethernet.hpp The files above use a pattern that is not trivial to address. Often their responses call an async lambda capturing the inherited class. ie (https://github.com/openbmc/bmcweb/blob/ffed87b5ad1797ca966d030e7f979770 28d258fa/redfish-core/lib/account_service.hpp#L1393) At a later point I plan to remove node from the files above. Tested: I ran the docker unit test with the following command. WORKSPACE=$(pwd) UNIT_TEST_PKG=bmcweb ./openbmc-build-scripts/run-unit-test-docker.sh I ran the validator and this change did not create any issues. python3 RedfishServiceValidator.py -c config.ini Signed-off-by: John Edward Broadbent <jebr@google.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I147a0289c52cb4198345b1ad9bfe6fdddf57f3df
2021-04-10Added Validation on MessageId and RegistryPrefixP Dheeraj Srujan Kumar1-3/+49
Message ID's and Registry prefixes used to subscribe to an event will be checked against allowed values. Corrected "Task" registry prefix to "TaskEvent". Tested: - Validated POST action with different combinations of Message id's and Registry Prefix. - Redfish validator passed. Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> Change-Id: I921cafeca8b2a1813f4aa4c41ecd01c831e3465b
2021-04-08Using AsyncResp everywherezhanghch051-34/+32
Get the core using AsyncResp everywhere, and not have each individual handler creating its own object.We can call app.handle() without fear of the response getting ended after the first tree is done populating. Don't use res.end() anymore. Tested: 1. Validator passed. Signed-off-by: zhanghaicheng <zhanghch05@inspur.com> Change-Id: I867367ce4a0caf8c4b3f4e07e06c11feed0782e8
2021-02-19Fix nlohmann::json::dump callsEd Tanous1-1/+3
The nlohmann::json::dump call needs to be called with specific arguments to avoid throwing in failure cases. http connection already does this properly, but a bunch of code has snuck in (mostly in redfish) that ignores this, and calls it incorrectly. This can potentially lead to a crash if the wrong thing throws on invalid UTF8 characters. This audits the whole codebase, and replaces every dump() call with the correct dump(2, ' ', true, nlohmann::json::error_handler_t::replace) call. For correct output, the callers should expect no change, and in practice, this would require injecting non-utf8 characters into the BMC. Tested: Ran several of the endpoints/error conditions in question, including some of the error cases. Observed correct responses. I don't know of a security issue that would allow injecting invalid utf8 into the BMC, but in theory if it were possible, this would prevent a crash. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4a15b8e260e3db129bc20484ade4ed5449f75ad0
2020-09-09Add MutualExclusiveProperties registryAppaRao Puli1-0/+10
Add MutualExclusiveProperties message registry entry and error message. As per redfish specification, "RegistryPrefixes" and "MessageIds" are mutually exclusive. So add check for same in EventService and return MutualExclusiveProperties error message. Tested: - Create subscription failed with error(bad request) when the request body contain both "RegistryPrefixes" and "MessageIds". Change-Id: I4c14f946977bce2ced8a7f96eb85855117fde9a8 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-09-03Revert http::Request::socket() callbackEd Tanous1-107/+0
Details on why this revert is needed are here. https://lists.ozlabs.org/pipermail/openbmc/2020-August/022478.html Appu and Ravi still have not commented. It should be noted, this also causes a memory leak in http connection, where connections refuse to be freed, because of a bad usage of shared_from_this. This code wasn't very well thought through, and needs rearchitected to not break the unit testability of bmcweb, nor cause memory leaks. https://github.com/openbmc/bmcweb/blob/218bd4746130aac22366968c8c9a34a929e45a3d/http/http_connection.h#L351 Is the memory leak in question. Specifically, this reverts: The /attachment download in LogServices. This needs reimplemented properly, but is an OEM property, so it shouldn't be a big deal to revert, and shouldn't break our redfish compliance. The IpAddress property in SessionService. I have no idea why this was injected, and it's functionally incorrect. IpAddresses are not related to a session, and IP addresses can change over the course of a session, so this property is already broken as written. I suspect the author really wanted RedfishEvent type logging, but that was too complex, so they half implemented this. Redfish SSE properties. This needs to be reimplemented similar to the patchset here: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/13948 Where the ownership of the HTTP connection does not leave the http framework. As written, the SSE implementation causes ownership issues, as there's no clear delineation of the ownership between HttpConnection and the SSE framework. Tested: On current master, running this command: wget -O- --no-http-keep-alive --no-check-certificate https://{bmc hostname}:18080/redfish/v1 Which should download the service root, then immediately close and destroy the connection, prints: (2020-08-28 16:55:24) [DEBUG "routing.h":1258] Matched rule '/redfish/v1/' 2 / 4 (2020-08-28 16:55:24) [DEBUG "http_response.h":130] calling completion handler (2020-08-28 16:55:24) [DEBUG "http_response.h":133] completion handler was valid (2020-08-28 16:55:24) [INFO "http_connection.h":429] Response: 0x1e1ee28 /redfish/v1 200 keepalive=0 (2020-08-28 16:55:24) [DEBUG "timer_queue.h":48] timer add inside: 0x1d3d1a8 7 (2020-08-28 16:55:24) [DEBUG "http_connection.h":751] 0x1e1ee28 timer added: 0x1d3d1a8 7 (2020-08-28 16:55:24) [DEBUG "http_connection.h":655] 0x1e1ee28 doWrite (2020-08-28 16:55:24) [DEBUG "http_connection.h":663] 0x1e1ee28 async_write 1555 bytes (2020-08-28 16:55:24) [DEBUG "http_connection.h":697] 0x1e1ee28 timer cancelled: 0x1d3d1a8 7 (2020-08-28 16:55:24) [DEBUG "http_connection.h":676] 0x1e1ee28 from write(1) Then stops. Note, that the connection was not destroyed, and has leaked. Once this patchset is added, the connection closes and destroys properly, and doesn't leak, so it prints the above, but also prints. (2020-08-28 16:27:10) [DEBUG "http_connection.h":305] 0x1d15c90 Connection closed, total 1 Ran Redfish service validator. Saw one unrelated failure due to UUID, all other things pass. Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I18686037bf58f20389d31facc0d77020274d38a1
2020-08-17Enable unused variable warnings and resolveEd Tanous1-11/+11
This commit enables the "unused variables" warning in clang. Throughout this, it did point out several issues that would've been functional bugs, so I think it was worthwhile. It also cleaned up several unused variable from old constructs that no longer exist. Tested: Built with clang. Code no longer emits warnings. Downloaded bmcweb to system and pulled up the webui, observed webui loads and logs in properly. Change-Id: I51505f4222cc147d6f2b87b14d7e2ac4a74cafa8 Signed-off-by: Ed Tanous <ed@tanous.net>
2020-08-17Enable clang warningsEd Tanous1-8/+8
This commit enables clang warnings, and fixes all warnings that were found. Most of these fall into a couple categories: Variable shadow issues were fixed by renaming variables unused parameter warnings were resolved by either checking error codes that had been ignored, or removing the name of the variable from the scope. Other various warnings were fixed in the best way I was able to come up with. Note, the redfish Node class is especially insidious, as it causes all imlementers to have variables for parameters, regardless of whether or not they are used. Deprecating the Node class is on my list of things to do, as it adds extra overhead, and in general isn't a useful abstraction. For now, I have simply fixed all the handlers. Tested: Added the current meta-clang meta layer into bblayers.conf, and added TOOLCHAIN_pn-bmcweb = "clang" to my local.conf Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: Ia75b94010359170159c703e535d1c1af182fe700
2020-08-17Remove middlewaresEd Tanous1-5/+5
Middlewares, while kinda cool from an academic standpoint, make our build times even worse than they already are. Given that we only really use 1 real middleware today (token auth) and it needs to move into the parser mode anyway (for security limiting buffer sizes), we might as well use this as an opportunity to delete some code. Some other things that happen: 1. Persistent data now moves out of the crow namespace 2. App is no longer a template 3. All request_routes implementations no longer become templates. This should be a decent (unmeasured) win on compile times. This commit was part of a commit previously called "various cleanups". This separates ONLY the middleware deletion part of that. Note, this also deletes about 400 lines of hard to understand code. Change-Id: I4c19e25491a153a2aa2e4ef46fc797bcb5b3581a Signed-off-by: Ed Tanous <ed@tanous.net>
2020-08-06Fix: MetricReportDefinitions filter not workingAppaRao Puli1-6/+26
The metric reports are not sending when user configures the MetricReportDefinitions filter. This is of odata json object type. Corrected code to properly handle odata type object and store it as string array to make filters faster. Tested: - Created metric report EventService subscription type with MetricReportDefinitions and events properly sent to Event listener. Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Change-Id: If96564219da7d38a2ee5e415b89824ba25cd686d
2020-08-04Remove QueryStringJames Feist1-2/+5
QueryString is an error-prone library that was leftover from crow. Replace it with boost::url, a header only library based and written by the one of the authors of boost beast. Tested: Verified logging paging still worked as expected Change-Id: I47c225089aa7d0f7d2299142f91806294f879381 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-07-31EventService: Add the parameter ResourceTypes to subscriptionSunitha Harish1-1/+29
This commit supports sending the ResourceTypes list while subscribing to the events. The "Task" resource is added as a supported type to receive the task life cycle events. For IBM's management console along with the Task resource, the support is provided to subscribe to the "IBMConfigFile" ResourceType to receive events while creating/updating the ConfigFiles. Tested by: 1. GET https://${bmc}/redfish/v1/EventService 2. Create subscription : POST https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination" : <>, "Protocol":"Redfish", "ResourceTypes": ["Task"]}' 3. GET https://${bmc}/redfish/v1/EventService/Subscriptions/<id> 3. Redfish validator was run successfully Signed-off-by: Sunitha Harish <sunharis@in.ibm.com> Change-Id: Ibaf3f4f5f005a1beedf0a1cd049ae11d93a3af36
2020-07-10Codespell redfish-core spelling fixesGunnar Mills1-1/+1
These spelling errors were found using https://github.com/codespell-project/codespell Tested: Top commit (along with this) was built and ran against validator. Change-Id: Ic9dce27b1de8567eedf7753164ef564d3aedf8ca Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-07-02Support the $filter query params for SSE streamAyushi Smriti1-4/+54
This commit adds the support for $filter query paramater in the URI for SSE stream. Method: GET URI: /redfish/v1/EventService/Subscriptions/SSE? $filter=(MessageIds%20eq%20DCPowerOn) or (MessageIds%20eq%20DCPowerOn) Tested: - From browser sent request using SSE URI along with filter query param - query params were read and parsed successfully. - used SubmitTestEvent and could see test events coming to BMC. - Ran redfish validator successfully. - Performed GET on Subscription collections and Subscription/<id> URI and checked for valid data. Change-Id: Ie18546749495175ede918ab933ff8dd1d65b775f Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-07-02EventService: Support for Server Sent Events(SSE)AppaRao Puli1-0/+60
Add support for Server Sent Events(SSE) Filters support is not part of this commit. Tested: - GET on URI /redfish/v1/EventService/Subscriptions/SSE/ from chrome browser, can see all BMC Events on browser. - Redfish validator is successful. Change-Id: Icd10cdad20c4529f64c97b67d46f2e4a7e0c329c Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-07-02EventService: Add retry configuration supportAyushi Smriti1-0/+1
This commit is to pass configuration parameters: retry attempts, retry interval secs and retry policy to http client and take required delivery retry policy action. Also, perform async wait for retryTimeoutInterval before each retry attempts. Tested: - Set and verified config properties by sending PATCH req on EventService and EventDestination uri. - Verified the appropriate delivery retry policy action block reached. - Verified the async_wait logic by triggering retry case depending failed state of connection. - could see a wait for timeout interval before next retry. Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Change-Id: Id1366fca59dc9e6543c553bfe5df95a59f468bc7 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-05-21EventService: Add enable/disable supportAppaRao Puli1-12/+16
Add EventService enable/disable support. When EventService is enabled - Check for no of event log subscribers and then only process events async sending. - Check for no of metric report subscribers and register for metric report signal. When EventService is disabled - Discard the inotify event for redfish logs. - Unregister the metric report signal. Tested: - Modified ServieEnabled, DeliveryRetryAttempts, DeliveryRetryInterval values using patch and it reflects on subsequent gets. - Above mentioned functionality tested with Service enabled & disabled modifications. - Ran redfish validator successfully. Change-Id: Id049860a89d3040d859ac8907e7bad5b4209b73d Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-05-14EventService: Add MetricReport supportAppaRao Puli1-3/+12
Add Telemetry metric report support to EventService. - Adding MetricReport support to schema implemenation. - Dynamically register and unregister the metric report signal. - Reads Telemtry data using D-Bus calls. - Filter the metric reports depending on user configured MetricReportDefinition. - Format the Telemetry readings as per MetricReport schema. - Send the formatted data to the client. Tested: - HTTP client successfully received asynchronous metric reports data. - valdiated the register and unregister by adding and deleting subscriptions. - Ran Redfish validator successfully. Change-Id: I7b59ac3ecad169a7959a800730dbc2fe85baf068 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-05-07EventService: SubmitTestEvent initial supportAppaRao Puli1-0/+30
This commit adds SubmitTestEvent initial support to send out test events to subscribers. URI: /redfish/v1/EventService/Actions/EventService.SubmitTestEvent Tested: - Client subscribed to event listener via destination uri. After sending POST request on SubmitTestEvent uri, could see generated test event. - Successfully ran the redfish validator. Counter({'metadataNamespaces': 1739, 'pass': 26, 'skipOptional': 22, 'serviceNamespaces': 3, 'passGet': 3, 'passAction': 1}) Validation has succeeded. Change-Id: I16e02c1977e99af39317070567196767ac7c7400 Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com>
2020-04-24EventService: Manager and subscriptions supportAppaRao Puli1-124/+100
Add EventService Manager which will manage all the EventService configuration and subscriptions. This includes API for add or update or delete subscriptions along with other supported API support. Also includes http connection open and send event code using "push style eventing". Added BMCWEB_INSECURE_HTTP_PUSH_STYLE_EVENTING build flag to enable/disable http push style eventing which is not a secure channel. Tested: - Tested along with other patches such as http client and Event log support, SubmitTestEvent and its works. - Ran Redfish validation successfully. Change-Id: Ie4687e4cbfabd525b7a8ad4e615510f034edc6e9 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-04-15Redfish EventService schema implementationAppaRao Puli1-0/+517
Add Redfish EventService schema support for EventService - GET and PATCH methods. EventDestinationCollections - GET and POST methods. EventDestination - GET, PATCH and DELETE methods. URI's: /redfish/v1/EventService /redfish/v1/EventService/Subscriptions /redfish/v1/EventService/Subscriptions/<id> Tested: - Validated all default event config data using GET. - Validated supported/unsupported properties change. - Validated range parameters for retry and timeout. - Added new subscription using POST and validated using GET. - Modified subscription using PATCH and validated. - Validated delete subscription. - Validated negative case for eventTypes, RegistryPrefixes, mandate properties for POST etc. - Successfully ran the redfish validator tool. Counter({'metadataNamespaces': 1739, 'pass': 24, 'skipOptional': 23, 'passGet': 3, 'serviceNamespaces': 3}) Validation has succeeded. Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Change-Id: I220de2cb85e73124753d95b7ee311f1c30e2cce4