ironic.api.controllers.v1.driver module

class ironic.api.controllers.v1.driver.DriverPassthruController(*args, **kwargs)[source]

Bases: pecan.rest.RestController

REST controller for driver passthru.

This controller allow vendors to expose cross-node functionality in the Ironic API. Ironic will merely relay the message from here to the specified driver, no introspection will be made in the message body.

methods(driver_name)[source]

Retrieve information about vendor methods of the given driver.

Parameters

driver_name – name of the driver.

Returns

dictionary with <vendor method name>:<method metadata> entries.

Raises

DriverNotFound – if the driver name is invalid or the driver cannot be loaded.

class ironic.api.controllers.v1.driver.DriverRaidController(*args, **kwargs)[source]

Bases: pecan.rest.RestController

logical_disk_properties(driver_name)[source]

Returns the logical disk properties for the driver.

Parameters

  • driver_name – Name of the driver.

Returns

Success:

A dictionary containing the properties that can be mentioned

Failure:

  • UnsupportedDriverExtension (HTTP 400 Bad Request) – Driver %(driver)s does not support %(extension)s (disabled or not implemented). If the driver doesn’t support RAID configuration.

  • NotAcceptable (HTTP 406 Not Acceptable) – Request not acceptable. If requested version of the API is less than 1.12.

  • DriverNotFound (HTTP 404 Not Found) – Could not find the following driver(s) or hardware type(s): %(driver_name)s. If driver is not loaded on any of the conductors.

class ironic.api.controllers.v1.driver.DriversController(*args, **kwargs)[source]

Bases: pecan.rest.RestController

REST controller for Drivers.

get_all(type=None, detail=None, fields=None)[source]

Retrieve a list of drivers.

get_one(driver_name, fields=None)[source]

Retrieve a single driver.

properties(driver_name)[source]

Retrieve property information of the given driver.

Parameters

driver_name – name of the driver.

Returns

dictionary with <property name>:<property description> entries.

Raises

DriverNotFound (HTTP 404) – if the driver name is invalid or the driver cannot be loaded.

raid = <ironic.api.controllers.v1.driver.DriverRaidController object>

Expose RAID as a sub-element of drivers

vendor_passthru = <ironic.api.controllers.v1.driver.DriverPassthruController object>

Convert driver/hardware type info to a dict.

Parameters
  • name – name of a hardware type.

  • hosts – list of conductor hostnames driver is active on.

  • detail – boolean, whether to include detailed info, such as the ‘type’ field and default/enabled interfaces fields.

  • interface_info – optional list of dicts of hardware interface info.

  • fields – list of fields to preserve, or None to preserve default

  • sanitize – boolean, sanitize driver

Returns

dict representing the driver object.

ironic.api.controllers.v1.driver.driver_sanitize(driver, fields=None)[source]
ironic.api.controllers.v1.driver.hide_fields_in_newer_versions(driver)[source]

This method hides fields that were added in newer API versions.

Certain fields were introduced at certain API versions. These fields are only made available when the request’s API version matches or exceeds the versions when these fields were introduced.

Convert drivers and hardware types to an API-serializable object.

Parameters
  • hardware_types – dict mapping hardware type names to conductor hostnames.

  • detail – boolean, whether to include detailed info, such as the ‘type’ field and default/enabled interfaces fields.

  • fields – list of fields to preserve, or None to preserve default

Returns

an API-serializable driver collection object.