openstack.baremetal_introspection.v1.Introspection¶
Introspection 类¶
The Introspection 类继承自 Resource。
- class openstack.baremetal_introspection.v1.introspection.Introspection(_synchronized=False, connection=None, **attrs)¶
基础资源
- 参数:
_synchronized (bool) – 这不打算直接使用。请参阅
new()和existing()。connection (openstack.connection.Connection) – 对正在使用的 Connection 的引用。默认为 None,允许在单元测试中等情况下使用不带活动 Connection 的 Resource 对象。Resource 代码中对
self._connection的使用应使用 None 检查进行保护。
- resources_key = 'introspection'¶
资源的复数形式的键。
- base_path = '/introspection'¶
此资源的 URI 的基本部分。
- allow_create = True¶
允许对此资源进行创建操作。
- allow_fetch = True¶
允许对此资源进行获取操作。
- allow_commit = False¶
允许对此资源进行更新操作。
- allow_delete = True¶
允许对此资源进行删除操作。
- allow_list = True¶
允许对此资源进行列表操作。
- create_method = 'POST'¶
创建资源的 HTTP 方法 (POST、PUT)
- create_requires_id = True¶
创建是否需要 ID(如果为 None,则由方法确定)。
- create_returns_body = False¶
如果 create 返回 body 为 False,则需要 ID,默认为 has_body
- finished_at¶
完成内省的的时间戳。
- error¶
最后的错误消息(如果有)。
- id¶
内省的 UUID(与节点 UUID 匹配)。
- is_finished¶
内省是否完成。
- links¶
相对链接列表,包括 self 和 bookmark 链接。
- started_at¶
开始内省的时间戳。
- state¶
当前的内省状态。
- abort(session)¶
中止内省。
- 参数:
session (
Adapter) – 用于发出此请求的会话。
- get_data(session, processed=True)¶
获取内省数据。
请注意,内省数据格式不稳定,并且可能因环境而异。
- 参数:
session (
Adapter) – 用于发出此请求的会话。processed (bool) – 是否获取最终处理后的数据(默认)或从 ramdisk 接收到的原始未处理数据。
- 返回值:
来自最近一次成功运行的内省数据。
- 返回类型:
dict
- wait(session, timeout=None, ignore_error=False)¶
等待节点达到预期状态。
- 参数:
session (
Adapter) – 用于发出此请求的会话。timeout – 等待内省的时间(以秒为单位)。
None(默认值)表示没有客户端超时。ignore_error – 如果为
True,则如果内省达到error状态,则此调用将引发异常。否则,错误状态被视为成功,并且调用返回。
- 返回值:
此
Introspection实例。- 引发:
ResourceFailure如果内省失败且ignore_error为False。- 引发:
ResourceTimeout超时时。