ironic.api.controllers.v1.driver module

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

Bases: 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: RestController

logical_disk_properties(driver_name)[source]

Returns the logical disk properties for the driver.

Parameters:

driver_name – Name of the driver.

Returns:

A dictionary containing the properties that can be mentioned for logical disks and a textual description for them.

Raises:

UnsupportedDriverExtension if the driver doesn’t support RAID configuration.

Raises:

NotAcceptable, if requested version of the API is less than 1.12.

Raises:

DriverNotFound, if driver is not loaded on any of the conductors.

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

Bases: RestController

REST controller for Drivers.

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

Retrieve a list of drivers.

get_one(driver_name)[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.

Returns:

dict representing the driver object.

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.

Returns:

an API-serializable driver collection object.