diff --git a/specs/list-introspection-statuses.rst b/specs/list-introspection-statuses.rst new file mode 100644 index 0000000..88bb1d4 --- /dev/null +++ b/specs/list-introspection-statuses.rst @@ -0,0 +1,299 @@ +.. + This work is licensed under a Creative Commons Attribution 3.0 Unported + License. + + http://creativecommons.org/licenses/by/3.0/legalcode + +=========================== +List introspection statuses +=========================== + +`List introspection statuses RFE`_ + +.. _List introspection statuses RFE: https://bugs.launchpad.net/ironic-\ + inspector/+bug/1525238 + +There is no way a user can get the list of all introspection statuses from the +ironic inspector service besides first fetching a list of nodes from the ironic +service. The ironic inspector misses an API endpoint to serve this information. +The purpose of this spec is to describe such an endpoint. + + +Problem description +=================== + +A user should be able to obtain a list of introspection statuses managed by +ironic inspector through a dedicated API endpoint. The introspection status +list item should provide *basic* status information about particular node +introspection status and a link to the full introspection status endpoint. The +list of the status items should be `paginated`_. It should be possible to +filter the status list based on the ``started_at``, ``finished_at`` and +``state`` node introspection status attributes. + +.. _paginated: http://developer.openstack.org/api-ref/baremetal/index.html\ + ?expanded=list-nodes-detail#list-nodes + + +Proposed change +=============== + +The endpoint should reside at ``GET@/v1/introspection`` path yielding the list +of introspection statuses, encoded in *JSON*. The endpoint should consider +these queries affecting the pagination and filtering of the list: + +Pagination +---------- + +``?marker=&limit=`` The default and maximum value of the limit +query is configurable as ``CONF.api_max_limit = 1000``. The default ordering of +the resources for the pagination is based on the ``started_at, uuid`` tuple, +newer items first. The pagination is always in effect to avoid exhausting +server resources. With no marker specified, the user always receives first +``CONF.api_max_limit`` statuses. Sorting keys can be changed through the query +``?sort=[,...]``. The key can be any of the +``started_at, finished_at, state, error, uuid`` attributes. It is possible to +change the `sorting direction`_ through the ``[:asc|desc]`` sort key query +direction suffix. + +.. _sorting direction: https://specs.openstack.org/openstack/openstack-specs/\ + specs/cli-sorting-args.html + +State query +----------- + +``?state=:[,...]`` Only return items matching the +states specified; acts as a *set*. Allowed operators: ``=in: =nin:`` the latter +meaning not in. Recognized state name values are as per the `HA Inspector +spec`_ and as further amended with the `introspection state patch`_: +``starting, waiting, processing, finished, reapplying, enrolling, error``. +Just the first occurrence of the ``state`` query string field is considered, +any repetitions are ignored. + +.. _HA inspector spec: https://specs.openstack.org/openstack/ironic-inspector + -specs/specs/HA_inspector.html +.. _introspection state patch: https://review.openstack.org/#/c/348943/ + +Time query +---------- + +* ``?started_at=: