本文整理汇总了Python中topology.BaseTopology.get_topology方法的典型用法代码示例。如果您正苦于以下问题:Python BaseTopology.get_topology方法的具体用法?Python BaseTopology.get_topology怎么用?Python BaseTopology.get_topology使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类topology.BaseTopology
的用法示例。
在下文中一共展示了BaseTopology.get_topology方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_topology_defaults
# 需要导入模块: from topology import BaseTopology [as 别名]
# 或者: from topology.BaseTopology import get_topology [as 别名]
def update_topology_defaults(top_id, data, user=""):
serializer = TopologyPostDefaultsSerializer(data=data)
if not serializer.is_valid():
raise IgniteException(serializer.errors)
BaseTopology.get_object(top_id, user).update_defaults(serializer.data)
serializer = TopologySerializer(BaseTopology.get_topology(top_id))
return serializer.data
示例2: add_topology_link
# 需要导入模块: from topology import BaseTopology [as 别名]
# 或者: from topology.BaseTopology import get_topology [as 别名]
def add_topology_link(top_id, data, user=""):
serializer = LinkPostSerializer(data=data)
if not serializer.is_valid():
raise IgniteException(serializer.errors)
BaseTopology.get_object(top_id, user).add_link(serializer.data)
serializer = TopologySerializer(BaseTopology.get_topology(top_id))
return serializer.data
示例3: update_topology_switch
# 需要导入模块: from topology import BaseTopology [as 别名]
# 或者: from topology.BaseTopology import get_topology [as 别名]
def update_topology_switch(top_id, switch_id, data, user=""):
serializer = TopologySwitchPutSerializer(data=data)
if not serializer.is_valid():
raise IgniteException(serializer.errors)
BaseTopology.get_object(top_id, user).update_switch(switch_id,
serializer.data)
serializer = TopologySerializer(BaseTopology.get_topology(top_id))
return serializer.data
示例4: get_fabric
# 需要导入模块: from topology import BaseTopology [as 别名]
# 或者: from topology.BaseTopology import get_topology [as 别名]
def get_fabric(fab_id):
# get topology info, then add fabric info
top = BaseTopology.get_topology(fab_id)
top.site = top.fabric.site
return top
示例5: delete_topology_link
# 需要导入模块: from topology import BaseTopology [as 别名]
# 或者: from topology.BaseTopology import get_topology [as 别名]
def delete_topology_link(top_id, link_id, user=""):
BaseTopology.get_object(top_id, user).delete_link(link_id)
serializer = TopologySerializer(BaseTopology.get_topology(top_id))
return serializer.data
示例6: delete_topology_switch
# 需要导入模块: from topology import BaseTopology [as 别名]
# 或者: from topology.BaseTopology import get_topology [as 别名]
def delete_topology_switch(top_id, switch_id, user=""):
BaseTopology.get_object(top_id, user).delete_switch(switch_id)
serializer = TopologySerializer(BaseTopology.get_topology(top_id))
return serializer.data
示例7: get_topology
# 需要导入模块: from topology import BaseTopology [as 别名]
# 或者: from topology.BaseTopology import get_topology [as 别名]
def get_topology(top_id):
top = BaseTopology.get_topology(top_id)
serializer = TopologySerializer(top)
return serializer.data
示例8: clear_topology
# 需要导入模块: from topology import BaseTopology [as 别名]
# 或者: from topology.BaseTopology import get_topology [as 别名]
def clear_topology(top_id, user=""):
BaseTopology.clear_topology(top_id, user)
serializer = TopologySerializer(BaseTopology.get_topology(top_id))
return serializer.data
示例9: get_fabric
# 需要导入模块: from topology import BaseTopology [as 别名]
# 或者: from topology.BaseTopology import get_topology [as 别名]
def get_fabric(fab_id):
# get topology info, then add fabric info
top = BaseTopology.get_topology(fab_id)
top.site = top.fabric.site
top.maintenance_group_count = maintenance_group_count(fab_id)
return top