zoukankan      html  css  js  c++  java
  • python 操作f5 node

    #NodeAddress
    # -*- coding: utf-8 -*-
    import sys
    import time
    import csv
    import ssl
    reload(sys)
    sys.path.append('./pycontrol')
    import pycontrol.pycontrol as pc
    #ssl._create_default_https_context = ssl._create_unverified_context
    if len(sys.argv) != 5:
        print sys.argv[0] + ' ' + 'f5managedip' + ' ' + 'username' + ' ' + 'passwd' + ' ' + 'nodeip'
    else :
     f5ip= sys.argv[1]
     username= sys.argv[2]
     passwd= sys.argv[3]
     nodeip= sys.argv[4]
     b = pc.BIGIP(
     hostname = f5ip,
     username = username,
     password = passwd,
     fromurl = True,
        wsdls=['LocalLB.NodeAddress'])
     node = b.LocalLB.NodeAddress
     ipaddress=nodeip
     a=node.get_object_status(node_addresses=[ipaddress])
     print a[0].availability_status
    
    
    #NodeAddress
    # -*- coding: utf-8 -*-
    import sys
    import time
    import csv
    import ssl
    reload(sys)
    sys.path.append('./pycontrol')
    import pycontrol.pycontrol as pc
    #ssl._create_default_https_context = ssl._create_unverified_context
    if len(sys.argv) != 5:
        print sys.argv[0] + ' ' + 'f5managedip' + ' ' + 'username' + ' ' + 'passwd' + ' ' + 'nodeip'
    else :
     f5ip= sys.argv[1]
     username= sys.argv[2]
     passwd= sys.argv[3]
     nodeip= sys.argv[4]
     b = pc.BIGIP(
     hostname = f5ip,
     username = username,
     password = passwd,
     fromurl = True,
        wsdls=['LocalLB.NodeAddress'])
     node = b.LocalLB.NodeAddress
     ipaddress=nodeip
     a=node.get_object_status(node_addresses=[ipaddress])
     print a[0].availability_status
    
  • 相关阅读:
    chm打开看不到内容时好时坏
    pugixml应用随笔
    鸟哥书:记一笔
    c++ stl list使用总结(转)
    增加swap分区
    复制虚拟机,链接网络问题:没有找到合适的设备:没有找到可用于链接System eth0 的
    Python编码相关文章推荐
    Python Counter() 的实现
    Python Counter()计数工具
    浏览器自动化工具-Selenium
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348671.html
Copyright © 2011-2022 走看看