openstack.baremetal.v1.driver

驱动器类

Driver 类继承自 Resource

class openstack.baremetal.v1.driver.Driver(_synchronized=False, connection=None, **attrs)

基础资源

参数:
  • _synchronized (bool) – 这不打算直接使用。请参阅 new()existing()

  • connection (openstack.connection.Connection) – 对正在使用的 Connection 的引用。默认为 None,允许在单元测试中等情况下使用不带活动 Connection 的 Resource 对象。Resource 代码中对 self._connection 的使用应使用 None 检查进行保护。

resources_key = 'drivers'

资源的复数形式的键。

base_path = '/drivers'

此资源的 URI 的基本部分。

allow_create = False

允许对此资源进行创建操作。

allow_fetch = True

允许对此资源进行获取操作。

allow_commit = False

允许对此资源进行更新操作。

allow_delete = False

允许对此资源进行删除操作。

allow_list = True

允许对此资源进行列表操作。

hosts

支持此驱动器的活动主机列表。

相对链接列表,包括 self 和 bookmark 链接。

name

驱动器的名称

properties

驱动器属性的链接列表。

default_bios_interface

默认 BIOS 接口实现。在 API 微版本 1.40 中引入。

default_boot_interface

默认启动接口实现。在 API 微版本 1.30 中引入。

default_console_interface

默认控制台接口实现。在 API 微版本 1.30 中引入。

default_deploy_interface

默认部署接口实现。在 API 微版本 1.30 中引入。

default_firmware_interface

默认固件接口实现。在 API 微版本 1.86 中引入。

default_inspect_interface

默认检查接口实现。在 API 微版本 1.30 中引入。

default_management_interface

默认管理接口实现。在 API 微版本 1.30 中引入。

default_network_interface

默认网络接口实现。在 API 微版本 1.30 中引入。

default_power_interface

默认电源接口实现。在 API 微版本 1.30 中引入。

default_raid_interface

默认 RAID 接口实现。在 API 微版本 1.30 中引入。

default_rescue_interface

默认救援接口实现。在 API 微版本 1.38 中引入。

default_storage_interface

默认存储接口实现。在 API 微版本 1.33 中引入。

default_vendor_interface

默认供应商接口实现。在 API 微版本 1.30 中引入。

enabled_bios_interfaces

启用的 BIOS 接口实现。在 API 微版本 1.40 中引入。

enabled_boot_interfaces

启用的启动接口实现。在 API 微版本 1.30 中引入。

enabled_console_interfaces

启用的控制台接口实现。在 API 微版本 1.30 中引入。

enabled_deploy_interfaces

启用的部署接口实现。在 API 微版本 1.30 中引入。

enabled_firmware_interfaces

启用的固件接口实现。在 API 微版本 1.86 中引入。

enabled_inspect_interfaces

启用的检查接口实现。在 API 微版本 1.30 中引入。

enabled_management_interfaces

启用的管理接口实现。在 API 微版本 1.30 中引入。

enabled_network_interfaces

启用的网络接口实现。在 API 微版本 1.30 中引入。

enabled_power_interfaces

启用的电源接口实现。在 API 微版本 1.30 中引入。

enabled_raid_interfaces

启用的 RAID 接口实现。在 API 微版本 1.30 中引入。

enabled_rescue_interfaces

启用的救援接口实现。在 API 微版本 1.38 中引入。

enabled_storage_interfaces

启用的存储接口实现。在 API 微版本 1.33 中引入。

enabled_vendor_interfaces

启用的供应商接口实现。在 API 微版本 1.30 中引入。

list_vendor_passthru(session)

获取驱动器暴露的供应商特定方法

参数:

session – 用于进行此请求的会话。

返回值:

一个字典,其中键是可用的供应商传递方法名称,对应的值是描述方法用法的字典。用法字典属性:* async:bool # passthru 函数是否异步调用 * attach:bool # 返回值是否附加到响应对象 * description:str # 方法描述 * http_methods:list # 支持的 HTTP 方法列表

call_vendor_passthru(session, verb, method, body=None)

调用供应商特定的传递方法

body 的内容是传递给硬件驱动器函数的参数。验证在那里发生。缺少参数或多余的参数将导致请求被拒绝

参数:
  • session – 用于进行此请求的会话。

  • method – 供应商传递方法名称。

  • verb – GET、POST、PUT、DELETE 中的一种,具体取决于驱动程序和方法。

  • body – 作为 json body 传递给供应商函数。

引发:

ValueError 如果 verb 不是 GET、POST、PUT、DELETE 中的一种

返回值:

方法调用的响应。