From 24006badee14ba4bc45df6cd70d059a49b82a4a7 Mon Sep 17 00:00:00 2001 From: Ruby Loo Date: Wed, 17 May 2017 15:03:39 -0400 Subject: [PATCH] Remove remaining vendor passthru lookup/heartbeat Vendor-passthru lookup and heartbeat was mostly removed (in 5eb4ba26ddbde97758511c9b61046e5a879ab66c). This removes the remaining code and references to them. Change-Id: I6b214503999ce1892f10f4507a6063b6e8d604bc Related-Bug: #1640533 --- api-ref/regenerate-samples.sh | 3 -- .../baremetal-api-v1-driver-passthru.inc | 29 ++++++++----------- .../driver-passthru-methods-response.json | 10 ------- .../node-vendor-passthru-response.json | 9 ------ ironic/api/controllers/v1/driver.py | 5 +--- 5 files changed, 13 insertions(+), 43 deletions(-) delete mode 100644 api-ref/source/samples/driver-passthru-methods-response.json diff --git a/api-ref/regenerate-samples.sh b/api-ref/regenerate-samples.sh index 768af4780c..7f1328216b 100755 --- a/api-ref/regenerate-samples.sh +++ b/api-ref/regenerate-samples.sh @@ -97,9 +97,6 @@ GET v1/drivers/ipmi > driver-get-response.json GET v1/drivers/agent_ipmitool/properties > driver-property-response.json GET v1/drivers/agent_ipmitool/raid/logical_disk_properties > driver-logical-disk-properties-response.json -GET v1/drivers/agent_ipmitool/vendor_passthru/methods > driver-passthru-methods-response.json - - ######### # CHASSIS diff --git a/api-ref/source/baremetal-api-v1-driver-passthru.inc b/api-ref/source/baremetal-api-v1-driver-passthru.inc index 760d19f645..a43c9527b3 100644 --- a/api-ref/source/baremetal-api-v1-driver-passthru.inc +++ b/api-ref/source/baremetal-api-v1-driver-passthru.inc @@ -8,9 +8,10 @@ Each driver MAY support vendor-specific extensions, called "passthru" methods. Internally, Ironic's driver API supports flexibly exposing functions via the common HTTP methods GET, PUT, POST, and DELETE. To call a passthru method, -the query string must contain the name of the method, eg. -``/vendor_passthru?method=lookup``. The contents of the HTTP request are -forwarded to the driver and validated there. +the query string must contain the name of the method. For example, if the +method name was ``my_passthru_method``, the request would look like +``/vendor_passthru?method=my_passthru_method``. The contents of the HTTP +request are forwarded to the driver and validated there. Ironic's REST API provides a means to discover these methods, but does not provide support, testing, or documentation for these endpoints. The Ironic @@ -42,8 +43,12 @@ Request - driver_name: driver_ident -Response Parameters -------------------- +Response +-------- + +The response BODY is a dictionary whose keys are the method names. The value +of each item is itself a dictionary describing how to interact with that +method. .. rest_parameters:: parameters.yaml @@ -52,16 +57,6 @@ Response Parameters - description: passthru_description - http_methods: passthru_http_methods -Response Example ----------------- - -The response BODY is a dictionary whose keys are a ``method_name``. The value -of each item is itself a dictionary describing how to interact with that -method. - -.. literalinclude:: samples/driver-passthru-methods-response.json - :language: javascript - Call a Method ============= @@ -71,7 +66,7 @@ Call a Method The HTTP METHOD may be one of GET, POST, PUT, DELETE, depending on the driver and method. -This endpoint passes the request directly to the Node's hardware driver. The +This endpoint passes the request directly to the hardware driver. The HTTP BODY must be parseable JSON, which will be converted to parameters passed to that function. Unparseable JSON, missing parameters, or excess parameters will cause the request to be rejected with an HTTP 400 error. @@ -94,4 +89,4 @@ method_name. Response -------- -Varies. \ No newline at end of file +Varies. diff --git a/api-ref/source/samples/driver-passthru-methods-response.json b/api-ref/source/samples/driver-passthru-methods-response.json deleted file mode 100644 index df9160f7bc..0000000000 --- a/api-ref/source/samples/driver-passthru-methods-response.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "lookup": { - "async": false, - "attach": false, - "description": "", - "http_methods": [ - "POST" - ] - } -} diff --git a/api-ref/source/samples/node-vendor-passthru-response.json b/api-ref/source/samples/node-vendor-passthru-response.json index 49e71da8a4..225d3ab48d 100644 --- a/api-ref/source/samples/node-vendor-passthru-response.json +++ b/api-ref/source/samples/node-vendor-passthru-response.json @@ -8,15 +8,6 @@ ], "require_exclusive_lock": true }, - "heartbeat": { - "async": true, - "attach": false, - "description": "", - "http_methods": [ - "POST" - ], - "require_exclusive_lock": true - }, "send_raw": { "async": true, "attach": false, diff --git a/ironic/api/controllers/v1/driver.py b/ironic/api/controllers/v1/driver.py index 5f5b1ec71f..212e3c2ac9 100644 --- a/ironic/api/controllers/v1/driver.py +++ b/ironic/api/controllers/v1/driver.py @@ -285,10 +285,7 @@ class DriverPassthruController(rest.RestController): :param data: body of data to supply to the specified method. """ cdict = pecan.request.context.to_policy_values() - if method == "lookup": - policy.authorize('baremetal:driver:ipa_lookup', cdict, cdict) - else: - policy.authorize('baremetal:driver:vendor_passthru', cdict, cdict) + policy.authorize('baremetal:driver:vendor_passthru', cdict, cdict) topic = pecan.request.rpcapi.get_topic_for_driver(driver_name) return api_utils.vendor_passthru(driver_name, method, topic, data=data,