openstack.network.v2.agent

Agent 类

Agent 类继承自 Resource

class openstack.network.v2.agent.Agent(_synchronized=False, connection=None, **attrs)

Neutron agent 扩展。

基础资源

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

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

resource_key = 'agent'

资源的单数形式的键。

resources_key = 'agents'

资源的复数形式的键。

base_path = '/agents'

此资源的 URI 的基本部分。

allow_create = False

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

allow_fetch = True

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

allow_commit = True

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

allow_delete = True

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

allow_list = True

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

agent_type

网络 agent 的类型。

availability_zone

网络 agent 的可用区。

binary

网络 agent 的应用程序二进制文件的名称。

configuration

特定于 agent_type 的网络 agent 配置数据。

created_at

创建网络 agent 的时间戳。

description

网络 agent 的描述。

last_heartbeat_at

上次看到网络 agent 心跳的时间戳。

host

agent 运行的主机。

is_admin_state_up

网络 agent 的管理状态,为启用 True 或禁用 False类型: bool

is_alive

网络 agent 是否存活。类型: bool

resources_synced

agent 是否已成功与 placement 同步。支持保证最小带宽功能的 agent 会将其资源视图与 neutron-server 共享,neutron-server 会将此视图与 placement 共享,resources_synced 表示后者的成功。值 None 表示未尝试与 Placement 进行资源视图同步。true / false 值表示上次同步尝试的成功。类型: bool

started_at

上次启动网络 agent 的时间戳。

topic

网络 agent 订阅的消息队列主题。

ha_state

L3 agent 的 HA 状态。对于 HA 路由器,此状态为 ‘active’、‘standby’ 或 ‘fault’,对于其他类型的路由器则为 None。

get_bgp_speakers_hosted_by_dragent(session)

列出由动态路由 agent 托管的 BGP speaker

参数:

session (Adapter) – 用于通信的会话。

返回值:

BgpSpeakers 列表

返回类型:

BgpSpeaker