[RFE] Enhance /drivers/properties API to have machine readable detail view
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ironic |
In Progress
|
Wishlist
|
Unassigned |
Bug Description
Currently the /drivers/properties API outputs property information in a json like
{
property_name1: <description>
property_name2: <description>
}
Often the description includes information such as whether the property is required or optional or if it depends on another properties value. This information in its current form is useful for users using the CLI to call this API, however it isn't so useful for cases when a machine might call this API, for example when trying to build a GUI form for enrolling a node of a particular type. The only option right now is to parse the description string with a REGEX, but with no defined standard this might not always work.
This RFE is proposing to enhance the /drivers/
{
property_name1: { description: <description>,
},
property_name2: { description: <description>,
}
}
There are two possibilities for preventing API breakage here, either have the new view protected by microversions or only displaying this view if you provide a ?detail=True query. Which of these is TBD.
Additionally, to accommodate for standardising in the API, a more standardised way to define driver properties in the driver modules would be provided, using a similar (or the same) interface as the oslo.cfg opts definitions that allows a driver developer to define a property as an object with fields like required=True and also to type the options like str option or bool option in oslo.cfg. This will allow the Ironic code for parsing, returning and validating properties for drivers to be simpler, more consistent and common across multiple drivers, avoiding the duplication of property parsing we see today in many drivers.
tags: | added: needs-spec |
description: | updated |
Changed in ironic: | |
status: | New → Confirmed |
Changed in ironic: | |
assignee: | nobody → Madhuri Kumari (madhuri-rai07) |
Changed in ironic: | |
assignee: | Ruby Loo (rloo) → nobody |
Note that it isn't possible to always have required=True/False because some of them depend on other things. See eg: https:/ /github. com/openstack/ ironic/ blob/31d889a7c4 5c63664969c8987 8e88652697b7949 /ironic/ drivers/ modules/ ipmitool. py#L80- L92
We (or I) did go down that road and was going to put in some field with required, but at the time, it wasn't clear how we wanted to handle the 'depends' case.
Here's the spec for the existing command. If nothing else, it will be of historical interest :) : http:// specs.openstack .org/openstack/ ironic- specs/specs/ juno-implemente d/get-required- driver- info.html
-