ironic-inspector/ironic_inspector/test
dparalen 7a3d93700e Introduce API for aborting introspection
It is not currently possible to stop a running introspection.  This
may be annoying for the operator, considering the amount of time it
takes for the bare metal node to call the continue API request,
especially knowing the introspection will fail/time-out eventually
(such as when debugging).

This patch introduces a REST API endpoint "POST
/v1/introspection/<node-UUID>/abort" in order to fill the gap.  Upon the
abort method call, following preconditions are checked:

* there's a bare metal node matching the UUID
* introspection was not finished for the node
* introspection process is waiting for the node to give the continue call

Following Responses are returned to the caller in case the
preconditions were not met:

* 404 Response in case node wasn't found
* 409 Response (resource busy) in case the introspection process is not
      waiting for the Continue call

Otherwise, a 202 Response is returned.

When the abort method is processed, the node is powered off and it is
black-listed in inspector's firewall to prevent it from booting the
introspection image. This happens asynchronously.

To prevent interference with the continue call processing, the
processing method was updated to give a 400 Response to the
introspection client in case continuing a finished or canceled
introspection.

Limitations:
* IMPI credentials are never updated in case introspection was canceled
* 202 response is returned even if the introspection was already finished
* the endpoint differs from requested "DELETE
  /v1/introspection/<node-UUID>"

Links:
[1] https://bugs.launchpad.net/ironic-inspector/+bug/1525235

Change-Id: If043171f0d292ae2775dc1f26233dd4911599247
Closes-Bug: #1525235
2016-02-09 15:30:46 +01:00
..
__init__.py Rename discoverd -> inspector 2015-05-29 09:06:56 +02:00
base.py Lock nodes to avoid simultaneous introspection requests 2015-11-27 12:05:27 +01:00
functional.py Introduce API for aborting introspection 2016-02-09 15:30:46 +01:00
test_firewall.py Use rootwrap to execute iptables instead of requiring root 2015-09-23 13:27:15 +02:00
test_introspect.py Introduce API for aborting introspection 2016-02-09 15:30:46 +01:00
test_main.py Introduce API for aborting introspection 2016-02-09 15:30:46 +01:00
test_node_cache.py Lock nodes to avoid simultaneous introspection requests 2015-11-27 12:05:27 +01:00
test_plugins_base.py Add introspection rules support 2015-09-14 14:56:09 +02:00
test_plugins_extra_hardware.py Convert eDeploy data so that rules can process it 2015-09-22 13:29:58 +01:00
test_plugins_raid_device.py Support IPA in raid_device plugin 2015-09-22 17:05:02 +02:00
test_plugins_rules.py Add new conditions: matches and contains 2016-01-26 17:01:41 +01:00
test_plugins_standard.py Switch to IPA as a primary ramdisk 2016-01-13 17:30:56 +01:00
test_process.py Introduce API for aborting introspection 2016-02-09 15:30:46 +01:00
test_rules.py Add introspection rules support 2015-09-14 14:56:09 +02:00
test_swift.py Store and expose introspection data 2015-08-27 20:18:54 -04:00
test_utils.py Merge "Enable Keystone v3 endpoints for Inspector" 2016-02-03 12:01:43 +00:00