API does not expose required driver_info

Bug #1261915 reported by devananda on 2013-12-17
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Ruby Loo

Bug Description

It is possible to create a node without specifying any driver_info in the initial POST -- this is reasonable and fine.

However, at the moment, the API does not expose what driver_info properties are required for the node's driver. The client can not know what fields to send in subsequent PATCH requests without reading Ironic's developer docs (or source code!).

devananda (devananda) on 2013-12-17
Changed in ironic:
status: New → Triaged
importance: Undecided → Medium
milestone: none → icehouse-3
Ruby Loo (rloo) on 2013-12-18
Changed in ironic:
assignee: nobody → Ruby Loo (rloo)
devananda (devananda) wrote :

Ruby, are you still working on this? It's been assigned to you for ~6 weeks and there is no patch linked from the bug. If you've got code up (and it's quite possible I haven't seen it) please tag this bug in the commit. If you're still working on this, that's fine, but otherwise please un-assign it.

Thanks!
-D

Fix proposed to branch: master
Review: https://review.openstack.org/73005

Changed in ironic:
status: Triaged → In Progress
Ruby Loo (rloo) wrote :

I wasn't quite sure what sort of API we wanted for this, so here's my (first) stab at it:

GET /v1/drivers/<driver>/properties that returns two lists
with the names of the required properties and optional properties
of the specified driver. An invalid driver name results in an HTTP 400.

Eg: 'GET /v1/drivers/pxe_ipminative/properties' results in:
{"required":
["ipmi_address", "ipmi_password", "ipmi_username", "pxe_deploy_kernel",
"pxe_deploy_ramdisk", "pxe_image_source", "pxe_root_gb"],
"optional":
["pxe_deploy_key", "pxe_instance_name", "pxe_key_data", "pxe_swap_mb"]
}

-----------

Will people want a description of the values for those properties too?

devananda (devananda) on 2014-03-04
Changed in ironic:
milestone: icehouse-3 → icehouse-rc1
Ruby Loo (rloo) on 2014-03-13
Changed in ironic:
milestone: icehouse-rc1 → next
devananda (devananda) on 2014-06-16
Changed in ironic:
milestone: next → juno-2

Change abandoned by Ruby Loo (<email address hidden>) on branch: master
Review: https://review.openstack.org/73005
Reason: Desperate to stop Jenkins!

Fix proposed to branch: master
Review: https://review.openstack.org/107096

Ruby Loo (rloo) wrote :

For the latest information (eg API, CLI, implementation details), see the blueprint corresponding to this: https://blueprints.launchpad.net/ironic/+spec/get-required-driver-info .

Reviewed: https://review.openstack.org/107092
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=c75a070520b02deafe61343157d3a4219374f6d3
Submitter: Jenkins
Branch: master

commit c75a070520b02deafe61343157d3a4219374f6d3
Author: Ruby Loo <email address hidden>
Date: Tue Jul 15 10:02:18 2014 -0400

    Add drivers.base.BaseDriver.get_properties()

    Adds ironic.drivers.base.BaseDriver.get_properties() which returns a
    dictionary of <property>:<description> entries.

    The driver interfaces (DeployInterface, PowerInterface, ...) have a
    new get_properties() method that returns a dictionary of
    <property>:<description>.

    These changes are needed in order to provide an API to get driver_info
    properties.

    Change-Id: I5994e990deb26841633ca26de1a5fb63b743271a
    Blueprint: get-required-driver-info
    Partial-Bug: #1261915

Reviewed: https://review.openstack.org/107096
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=a65d3e6b1126b4e148e825290a61b151e1a6559c
Submitter: Jenkins
Branch: master

commit a65d3e6b1126b4e148e825290a61b151e1a6559c
Author: Ruby Loo <email address hidden>
Date: Tue Jul 15 10:52:32 2014 -0400

    Implement API to get driver properties

    Implement GET /v1/drivers/<driver>/properties that returns a
    dictionary of (driver_info) properties of the specified driver.
    Each entry in the dictionary is:
      key: name of the property
      value: description of the property

    An invalid driver name results in an HTTP 404.

    Eg: 'GET /v1/drivers/pxe_ipminative/properties' returns:
    {"pxe_deploy_ramdisk": "UUID ... of the ramdisk... Required.",
     "ipmi_username": "IPMI username. Required.",
     "ipmi_address": "IP of the node's BMC. Required.",
     "ipmi_password": "IPMI password. Required.",
     "pxe_deploy_kernel": "UUID ... of the deployment kernel. Required."
    }

    If the properties for a driver are not cached, the API service makes
    an RPC request to a conductor to get the properties for that driver.
    It then caches that information for subsequent requests of that driver.

    Change-Id: I9c98f4369c54a7cdf9e20ea87348e61f7af10303
    Blueprint: get-required-driver-info
    Partial-Bug: #1261915

Ruby Loo (rloo) wrote :

All merged. The CLI part was https://review.openstack.org/76338

Changed in ironic:
status: In Progress → Fix Committed
Changed in ironic:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2014-10-16
Changed in ironic:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers