ironic-inspector/ironic_inspector
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
..
common Update translation setup 2016-01-29 09:34:46 +01:00
migrations Enable migration autogenerate 2015-11-02 17:24:52 +00:00
plugins Add new conditions: matches and contains 2016-01-26 17:01:41 +01:00
test Introduce API for aborting introspection 2016-02-09 15:30:46 +01:00
__init__.py Switch to pbr 2015-06-18 16:09:07 +02:00
alembic.ini Add alembic migrations for the inspector database 2015-09-23 14:44:46 +01:00
conf.py Track node identification during the whole processing 2016-01-13 12:23:15 +01:00
db.py Enable migration autogenerate 2015-11-02 17:24:52 +00:00
dbsync.py Enable migration autogenerate 2015-11-02 17:24:52 +00:00
firewall.py Improve debug logging 2015-12-14 14:19:06 +01:00
introspect.py Introduce API for aborting introspection 2016-02-09 15:30:46 +01:00
main.py Introduce API for aborting introspection 2016-02-09 15:30:46 +01:00
node_cache.py Track node identification during the whole processing 2016-01-13 12:23:15 +01:00
process.py Introduce API for aborting introspection 2016-02-09 15:30:46 +01:00
rules.py Track node identification during the whole processing 2016-01-13 12:23:15 +01:00
utils.py Merge "Enable Keystone v3 endpoints for Inspector" 2016-02-03 12:01:43 +00:00
version.py Use Reno for release notes management 2015-11-26 10:12:14 +01:00