当前位置: 首页>>代码示例>>Python>>正文


Python Controller.delete_netconf_node方法代码示例

本文整理汇总了Python中framework.controller.controller.Controller.delete_netconf_node方法的典型用法代码示例。如果您正苦于以下问题:Python Controller.delete_netconf_node方法的具体用法?Python Controller.delete_netconf_node怎么用?Python Controller.delete_netconf_node使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在framework.controller.controller.Controller的用法示例。


在下文中一共展示了Controller.delete_netconf_node方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: print

# 需要导入模块: from framework.controller.controller import Controller [as 别名]
# 或者: from framework.controller.controller.Controller import delete_netconf_node [as 别名]
    print ("<<< Show OpenVPN interfaces configuration on the '%s'" % nodeName)
    result = vrouter.get_openvpn_interfaces_cfg()
    time.sleep(rundelay)
    status = result.get_status()
    if (status.eq(STATUS.OK)):
        print ("'%s' OpenVPN interfaces configuration:" % nodeName)
        iflist = result.get_data()
        assert(isinstance(iflist, list))
        for item in iflist:
            print json.dumps(item, indent=4, sort_keys=True)
    elif (status.eq(STATUS.DATA_NOT_FOUND)):
        print ("No OpenVPN interfaces configuration found")
    else:
        print ("\n")
        print ("!!!Demo terminated, reason: %s" % status.detailed())
        ctrl.delete_netconf_node(vrouter)
        exit(0)

    print "\n"
    ifname = 'vtun0'
    print (">>> Configure new '%s' OpenVPN tunnel interface on the '%s'"
           % (ifname, nodeName))
    time.sleep(rundelay)

    # Create OpenVPN interface
    vpnif = OpenVpnInterface(ifname)

    # Set the OpenVPN mode to 'site-to-site'
    mode = 'site-to-site'
    vpnif.set_mode(mode)
开发者ID:Elbrys,项目名称:pydevodl,代码行数:32,代码来源:vr_demo14.py

示例2: print

# 需要导入模块: from framework.controller.controller import Controller [as 别名]
# 或者: from framework.controller.controller.Controller import delete_netconf_node [as 别名]
    status = result.get_status()
    if(status.eq(STATUS.NODE_CONNECTED)):
        print ("'%s' node is connected" % nodeName)
    elif (status.eq(STATUS.NODE_DISONNECTED)):
        print ("'%s' node is not connected" % nodeName)
    elif (status.eq(STATUS.NODE_NOT_FOUND)):
        print ("'%s' node is not found" % nodeName)
    else:
        print ("\n")
        print ("!!!Demo terminated, reason: %s" % status.brief())
        exit(0)

    print "\n"
    print (">>> Remove '%s' NETCONF node from the Controller" % nodeName)
    time.sleep(rundelay)
    result = ctrl.delete_netconf_node(node)
    status = result.get_status()
    if(status.eq(STATUS.OK)):
        print ("'%s' NETCONF node was successfully removed "
               "from the Controller" % nodeName)
    else:
        print ("\n")
        print ("!!!Demo terminated, reason: %s" % status.brief())
        exit(0)

    print "\n"
    print ("<<< Show NETCONF nodes configured on the Controller")
    time.sleep(rundelay)
    result = ctrl.get_netconf_nodes_in_config()
    status = result.get_status()
    if(status.eq(STATUS.OK)):
开发者ID:Elbrys,项目名称:pydevodl,代码行数:33,代码来源:ctrl_demo11.py


注:本文中的framework.controller.controller.Controller.delete_netconf_node方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。