Merge "Fix typo and add subscription docs"

This commit is contained in:
Zuul 2021-09-10 09:25:25 +00:00 committed by Gerrit Code Review
commit 651a05707c
3 changed files with 78 additions and 2 deletions
doc/source/admin/drivers
ironic
drivers/modules/redfish
tests/unit/drivers/modules/redfish

@ -502,6 +502,82 @@ settings. The following fields will be returned in the BIOS API
"``unique``", "The setting is specific to this node"
"``reset_required``", "After changing this setting a node reboot is required"
Node Vendor Passthru Methods
============================
.. csv-table::
:header: "Method", "Description"
:widths: 25, 120
"``create_subscription``", "Create a new subscription on the Node"
"``delete_subscription``", "Delete a subscription of a Node"
"``get_all_subscriptions``", "List all subscriptions of a Node"
"``get_subscription``", "Show a single subscription of a Node"
Create Subscription
~~~~~~~~~~~~~~~~~~~
.. csv-table:: Request
:header: "Name", "In", "Type", "Description"
:widths: 25, 15, 15, 90
"Destination", "body", "string", "The URI of the destination Event Service"
"EventTypes (optional)", "body", "array", "List of ypes of events that shall be sent to the destination"
"Context (optional)", "body", "string", "A client-supplied string that is stored with the event destination
subscription"
"Protocol (optional)", "body", "string", "The protocol type that the event will use for sending
the event to the destination"
Example JSON to use in ``create_subscription``::
{
"Destination": "https://someurl",
"EventTypes": ["Alert"],
"Context": "MyProtocol",
"args": "Redfish"
}
Delete Subscription
~~~~~~~~~~~~~~~~~~~
.. csv-table:: Request
:header: "Name", "In", "Type", "Description"
:widths: 21, 21, 21, 37
"id", "body", "string", "The Id of the subscription generated by the BMC "
Example JSON to use in ``delete_subscription``::
{
"id": "<id of the subscription generated by the BMC>"
}
Get Subscription
~~~~~~~~~~~~~~~~
.. csv-table:: Request
:header: "Name", "In", "Type", "Description"
:widths: 21, 21, 21, 37
"id", "body", "string", "The Id of the subscription generated by the BMC "
Example JSON to use in ``get_subscription``::
{
"id": "<id of the subscription generated by the BMC>"
}
Get All Subscriptions
~~~~~~~~~~~~~~~~~~~~~
The ``get_all_subscriptions`` doesn't require any parameters.
.. _Redfish: http://redfish.dmtf.org/
.. _Sushy: https://opendev.org/openstack/sushy
.. _TLS: https://en.wikipedia.org/wiki/Transport_Layer_Security

@ -161,7 +161,7 @@ class RedfishVendorPassthru(base.VendorInterface):
@base.passthru(['POST'], async_call=False,
description=_("Creates a subscription on a node. "
"Required argument: a dictionary of "
"{'destination': 'destination_url'}"))
"{'Destination': 'destination_url'}"))
def create_subscription(self, task, **kwargs):
"""Creates a subscription.

@ -254,7 +254,7 @@ class RedfishVendorPassthruTestCase(db_base.DbTestCase):
subscription = mock.MagicMock()
subscription.json.return_value = subscription_json
mock_event_service.subscriptions.create = subscription
kwargs = {'destination': 'https://someurl'}
kwargs = {'Destination': 'https://someurl'}
with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task: