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


Python API.retrieve_all_nodes方法代码示例

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


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

示例1: main

# 需要导入模块: import API [as 别名]
# 或者: from API import retrieve_all_nodes [as 别名]
def main(argv):
    """Main function of the Test script"""
    try:
        opts, args = getopt.getopt(argv, "hu:p:d:P:s:",
                                   ["username=", "password=",
                                    "domain=", "port=",
                                    "secure-port="])
    except getopt.GetoptError:
        usage()
        sys.exit(2)
    for opt, arg in opts:
        if opt == '-h':
            usage()
            sys.exit(0)
        elif opt in ("-u", "--username"):
            global user
            user = arg
            print "Username = ", user
        elif opt in ("-p", "--password"):
            global password
            password = arg
            print "Password = ", password
        elif opt in ("-d", "--domain"):
            global domain
            domain = arg
            print "Domain = ", domain
        elif opt in ("-P", "--port"):
            global port
            port = arg
            print "Port = ", port
        elif opt in ("-s", "--secure-port"):
            global sport
            sport = arg
            print "Secure port = ", sport

    myodl = ODL(auth=HTTPBasicAuth(user, password),
                domain=domain, port=port, sec_port=sport)
    api = API(odl=myodl, format='json')
    reportList = []

    # test for add UserLink and retrieve current network topology 
    #test_Topology_all(api, reportList)

    #individualTest = []
    #individualTest.append("Retreive Topology")
    #response = api.retrieve_the_topology()
    #response = api.retrieve_node_flows(nodeId='00:00:b8:ca:3a:65:c6:55') #retrieve_all_nodes() #api.retrieve_node_connectors_by_node(nodeId='00:00:b8:ca:3a:65:c6:55')
    #prepareReport(response.status_code, reportList, individualTest)

    #test_SwitchManager_all(api, reportList)
    #test_ContainerManager_all(api, reportList)
    #
    #test_Statistics_all(api, reportList)


    """individualTest = []
    response = api.retrieve_userLinks()
    individualTest.append("Retrieve UserLinks")
    prepareReport(response.status_code, reportList, individualTest)"""

    """individualTest = []
    individualTest.append("Retrieve node Statistics")
    response = api.retrieve_node_statistics_flow(nodeId='00:00:b8:ca:3a:65:c6:55')
    prepareReport(response.status_code, reportList, individualTest)"""

    """individualTest = []
    individualTest.append("Retrieve node Statisics Ports")
    response = api.retrieve_node_statistics_port(nodeId='00:00:b8:ca:3a:65:c6:55')
    prepareReport(response.status_code, reportList, individualTest)"""

    """individualTest = []
    individualTest.append("Retrieve node Statistics Tables")
    response = api.retrieve_node_statistics_table(nodeId='00:00:b8:ca:3a:65:c6:55')
    prepareReport(response.status_code, reportList, individualTest)"""

    individualTest = [] 
    individualTest.append("Retrieve node Statistics Tables")
    response = api.retrieve_all_nodes()
    #response = api.retrieve_node_connectors_by_node(nodeId='00:00:b8:ca:3a:65:c6:55')
    prepareReport(response.status_code, reportList, individualTest)






    """test_FlowProgrammer_all(api, reportList)
开发者ID:life1347,项目名称:pyodl,代码行数:89,代码来源:testAPI.py


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