本文整理汇总了Python中juju.state.service.ServiceStateManager._read_topology方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceStateManager._read_topology方法的具体用法?Python ServiceStateManager._read_topology怎么用?Python ServiceStateManager._read_topology使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类juju.state.service.ServiceStateManager
的用法示例。
在下文中一共展示了ServiceStateManager._read_topology方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_service_states
# 需要导入模块: from juju.state.service import ServiceStateManager [as 别名]
# 或者: from juju.state.service.ServiceStateManager import _read_topology [as 别名]
def get_service_states(self):
"""Get all the services associated with this relation.
@return: list of ServiceState instance associated with this relation.
"""
from juju.state.service import ServiceStateManager, ServiceState
service_manager = ServiceStateManager(self._client)
services = []
topology = yield service_manager._read_topology()
for service_id in topology.get_relation_services(
self.internal_relation_id):
service_name = topology.get_service_name(service_id)
service = ServiceState(self._client, service_id, service_name)
services.append(service)
returnValue(services)