Beispiel #1
0
 def enable_lbvserver(self, client) :
     try :
         lbvserver.enable(client,"lb_vip")
         print("enable_lbvserver - Done")
     except nitro_exception as e :
         print("Exception::enable_lbvserver::errorcode="+str(e.errorcode)+",message="+ e.message)
     except Exception as e:
         print("Exception::enable_lbvserver::message="+str(e.args))
Beispiel #2
0
 def add_lbvs_bulk(self, client) : 
     try :
         lb = [lbvserver() for _ in range(2)]
         lb[0].name = "lb1"
         lb[0].servicetype = lbvserver.Servicetype.HTTP
         
         lb[1].name = "lb2"
         lb[1].servicetype = lbvserver.Servicetype.SSL
         
         lbvserver.add(client, lb)
         print("add_lbvs_bulk - Done")
         lbvserver.enable(client, lb)
         print("enable bulk resources - Done")
     except nitro_exception as e :
         print("Exception::add_lbvs_bulk::errorcode="+str(e.errorcode)+",message="+ e.message)
     except Exception as e:
         print("Exception::add_lbvs_bulk::message="+str(e.args))
Beispiel #3
0
	def change_state(self, client, lbv_name, svc_name) : 
		try : 
			if lbvserver_stats.get(client, lbv_name).state == "ENABLED":
				lbvserver.disable(client, lbv_name)
			else:
				lbvserver.enable(client, lbv_name)

			print("service result::state="+service.get(client, svc_name).svrstate)

			if service.get(client, svc_name).svrstate == "UP":
				service.disable(client, svc_name)
			else:
				service.enable(client, svc_name)

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