示例#1
0
 def add_csvserver(self, client) :
     try :
         obj = csvserver()
         obj.name = "cs_vip"
         obj.servicetype = csvserver.Servicetype.HTTP
         obj.ipv46 = "9.1.1.8"
         obj.port = 80
         csvserver.add(client, obj)
         print("add_csvserver - Done")
     except nitro_exception as e :
         print("Exception::add_csvserver::errorcode="+str(e.errorcode)+",message="+ e.message)
     except Exception as e:
         print("Exception::add_csvserver::message="+str(e.args))
示例#2
0
    def _create_cs_vserver(self, cs_name, vip, port, service_type="HTTP"):
        try:
            cs = csvserver.get(self.ns_session, cs_name)
            if (cs.name == cs_name):
                logger.info("CS %s is already configured " % cs_name)
                return
        except nitro_exception:
            pass

        cs = csvserver()
        cs.name = cs_name
        cs.servicetype = service_type
        cs.ipv46 = vip
        cs.port = port
        csvserver.add(self.ns_session, cs)
    def add_csvserver(self, client,csvserverhttp,csvserverssl,cs_ip) :
        try :
            obj = csvserver()
            obj.name = csvserverhttp
            obj.servicetype = csvserver.Servicetype.HTTP
            obj.ipv46 = cs_ip
            obj.port = 80
            csvserver.add(client, obj)
            print("\nadd_csvserver "+obj.name+"- Done\n")

            obj1 = csvserver()
            obj1.name = csvserverssl
            obj1.servicetype = csvserver.Servicetype.SSL
            obj1.ipv46 = cs_ip
            obj1.port = 443
            csvserver.add(client, obj1)
            print("add_csvserver "+obj1.name+"- Done\n")

        except nitro_exception as e :
            print("Exception::add_csvserver::errorcode="+str(e.errorcode)+",message="+ e.message)
        except Exception as e:
            print("Exception::add_csvserver::message="+str(e.args))