Add subscriptions management to redfish cheatsheet

The cheatsheet has commands users can use to perform certain operations
using Redfish.  It does not have anything about subscriptions, and it
would be good to have this section to teach users of how to do a basic
subscriptions management.

Change-Id: I0e6dca2628eb5b7814d575d040a85b991afb4448
Signed-off-by: Igor Kanyuka <ifelmail@gmail.com>
diff --git a/REDFISH-cheatsheet.md b/REDFISH-cheatsheet.md
index 1e71a1a..9c8c4a6 100644
--- a/REDFISH-cheatsheet.md
+++ b/REDFISH-cheatsheet.md
@@ -213,4 +213,62 @@
 curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol -d '{"IPMI":{"ProtocolEnabled": false}}'
 ```
 
+## Manage subscriptions
+
+List configured subscriptions:
+
+```
+curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" https://${bmc}/redfish/v1/EventService/Subscriptions/
+```
+
+Setup subscription
+
+```
+curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X POST https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Context": "My context", "DeliveryRetryPolicy": "RetryForever", "Destination": "http://yy.yy.yy.yy:8888/events", "EventFormatType": "Event", "Protocol": "Redfish", "SubscriptionType": "RedfishEvent"}"
+```
+
+Store the ID of the first subscription in an environment variable:
+
+```
+export subscription_id=$(curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" https://${bmc}/redfish/v1/EventService/Subscriptions/ |jq '.Members[0]."@odata.id"' | cut -d '/' -f 6| cut -d '"' -f 1)
+```
+
+Display information for the subscription associated with the stored ID:
+
+```
+curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" https://${bmc}/redfish/v1/EventService/Subscriptions/${subscription_id}
+```
+
+Update the subscription corresponding to the stored ID:
+
+```
+curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" https://${bmc}/redfish/v1/EventService/Subscriptions/${subscription_id} -X PATCH -d '{"VerifyCertificate": false}'
+```
+
+Remove the subscription identified by the stored ID:
+
+```
+curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" https://${bmc}/redfish/v1/EventService/Subscriptions/${subscription_id} -X DELETE
+```
+
+### Test subscriptions
+
+Send a test event using embedded into Redfish Event Service facility:
+
+```
+curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" https://${bmc}/redfish/v1/EventService/Actions/EventService.SubmitTestEvent -X POST -d '{"EventTimestamp":"2023-02-13T14:49:20Z","Severity":"Warning","Message":"This is a test event message 2","MessageId":"iLOResourceEvents.1.3.DrvArrLogDrvErasing","MessageArgs":["1","slot 3"],"OriginOfCondition":"/redfish/v1/Systems/1/Storage"}'
+```
+
+Send a test DBus event, it should be picked up by the bmcweb and send event to
+the subscriber (the command should be executed on the BMC):
+
+```
+busctl call xyz.openbmc_project.Logging \
+/xyz/openbmc_project/logging \
+xyz.openbmc_project.Logging.Create \
+Create 'ssa{ss}' \
+OpenBMC.0.1.PowerButtonPressed \
+xyz.openbmc_project.Logging.Entry.Level.Error 0
+```
+
 [1]: https://www.dmtf.org/standards/redfish