diff --git a/doc/source/admin/drivers/redfish.rst b/doc/source/admin/drivers/redfish.rst index 24f0f11a18..fec4296083 100644 --- a/doc/source/admin/drivers/redfish.rst +++ b/doc/source/admin/drivers/redfish.rst @@ -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 diff --git a/ironic/drivers/modules/redfish/vendor.py b/ironic/drivers/modules/redfish/vendor.py index 056dbe90ad..fa94b0797d 100644 --- a/ironic/drivers/modules/redfish/vendor.py +++ b/ironic/drivers/modules/redfish/vendor.py @@ -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. diff --git a/ironic/tests/unit/drivers/modules/redfish/test_vendor.py b/ironic/tests/unit/drivers/modules/redfish/test_vendor.py index 089464c36a..c32bd2a602 100644 --- a/ironic/tests/unit/drivers/modules/redfish/test_vendor.py +++ b/ironic/tests/unit/drivers/modules/redfish/test_vendor.py @@ -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: