API for getting discovery status for a node

Registered by Dmitry Tantsur

We need an API to get discovery status for a given node, because we can't rely on Ironic to provide such.

* Endpoint will be GET /v1/introspection/<UUID> (to accommodate for future API enhancements)
** Result is dict with keys finished: bool, error: str or null
** Error 404 if node is not found
** This API will NOT access Ironic, only local database
* Client call will be ironic_discoverd.client.get_status(uuid)
** Result is the same dict

Blueprint information

Status:
Complete
Approver:
Dmitry Tantsur
Priority:
High
Drafter:
Dmitry Tantsur
Direction:
Approved
Assignee:
Dmitry Tantsur
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
milestone icon 1.0.0
Started by
Dmitry Tantsur
Completed by
Dmitry Tantsur

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/get-status-api,n,z

Addressed by: https://review.openstack.org/145008
    Store introspection result in the local database

Addressed by: https://review.openstack.org/146067
    Implement get status endpoint

Addressed by: https://review.openstack.org/146148
    Rework node cache clean up according to recent changes

(?)

Work Items

Work items:
Add finished_on and error fields to `nodes` table: DONE
Do not clean `nodes` table on success and error: DONE
On error record it in `nodes` table and clean `attributes` table: DONE
On success record finishing time in `nodes` table and clean `attributes` table: DONE
Create new endpoint: DONE
Create new client call: DONE
Periodically clean `nodes` table of old records: DONE

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.