本文整理匯總了Python中loadbalancer_agent.LoadbalancerAgent.audit_lb_pools方法的典型用法代碼示例。如果您正苦於以下問題:Python LoadbalancerAgent.audit_lb_pools方法的具體用法?Python LoadbalancerAgent.audit_lb_pools怎麽用?Python LoadbalancerAgent.audit_lb_pools使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類loadbalancer_agent.LoadbalancerAgent
的用法示例。
在下文中一共展示了LoadbalancerAgent.audit_lb_pools方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: SvcMonitor
# 需要導入模塊: from loadbalancer_agent import LoadbalancerAgent [as 別名]
# 或者: from loadbalancer_agent.LoadbalancerAgent import audit_lb_pools [as 別名]
#.........這裏部分代碼省略.........
continue
vm.virtualization_type = st.virtualization_type
self._delete_service_instance(vm)
def launch_services(self):
for si in ServiceInstanceSM.values():
self._create_service_instance(si)
def sync_sm(self):
# Read and Sync all DBase
for cls in DBBaseSM.get_obj_type_map().values():
for obj in cls.list_obj():
cls.locate(obj['uuid'], obj)
# Link SI and VM
for vm in VirtualMachineSM.values():
if vm.service_instance:
continue
for vmi_id in vm.virtual_machine_interfaces:
vmi = VirtualMachineInterfaceSM.get(vmi_id)
if not vmi:
continue
self.port_delete_or_si_link(vm, vmi)
# Load the loadbalancer driver
self.loadbalancer_agent.load_drivers()
# Invoke the loadbalancer pools
for lb_pool in LoadbalancerPoolSM.values():
lb_pool.add()
# Audit the lb pools
self.loadbalancer_agent.audit_lb_pools()
# Audit the SNAT instances
self.snat_agent.audit_snat_instances()
# end sync_sm
# create service template
def _create_default_template(self, st_name, svc_type, svc_mode=None,
hypervisor_type='virtual-machine',
image_name=None, flavor=None, scaling=False,
vrouter_instance_type=None,
instance_data=None):
domain_name = 'default-domain'
domain_fq_name = [domain_name]
st_fq_name = [domain_name, st_name]
self.logger.log_info("Creating %s %s hypervisor %s" %
(domain_name, st_name, hypervisor_type))
domain_obj = None
for domain in DomainSM.values():
if domain.fq_name == domain_fq_name:
domain_obj = Domain()
domain_obj.uuid = domain.uuid
domain_obj.fq_name = domain_fq_name
break
if not domain_obj:
self.logger.log_error("%s domain not found" % (domain_name))
return
for st in ServiceTemplateSM.values():
if st.fq_name == st_fq_name:
self.logger.log_info("%s exists uuid %s" %
(st.name, str(st.uuid)))
示例2: SvcMonitor
# 需要導入模塊: from loadbalancer_agent import LoadbalancerAgent [as 別名]
# 或者: from loadbalancer_agent.LoadbalancerAgent import audit_lb_pools [as 別名]
#.........這裏部分代碼省略.........
else:
for fq_name, uuid in sg_list:
SecurityGroupSM.locate(uuid)
ok, vm_list = self._cassandra._cassandra_virtual_machine_list()
if not ok:
pass
else:
for fq_name, uuid in vm_list:
vm = VirtualMachineSM.locate(uuid)
if vm.service_instance:
continue
for vmi_id in vm.virtual_machine_interfaces:
vmi = VirtualMachineInterfaceSM.get(vmi_id)
if not vmi:
continue
self.check_link_si_to_vm(vm, vmi)
ok, lr_list = self._cassandra._cassandra_logical_router_list()
if not ok:
pass
else:
for fq_name, uuid in lr_list:
lr = LogicalRouterSM.locate(uuid)
# Load the loadbalancer driver
self.loadbalancer_agent.load_drivers()
for lb_pool in LoadbalancerPoolSM.values():
lb_pool.add()
# Audit the lb pools
self.loadbalancer_agent.audit_lb_pools()
# Audit the SNAT instances
self.snat_agent.audit_snat_instances()
# end sync_sm
# create service template
def _create_default_template(self, st_name, svc_type, svc_mode=None,
hypervisor_type='virtual-machine',
image_name=None, flavor=None, scaling=False,
vrouter_instance_type=None,
instance_data=None):
domain_name = 'default-domain'
domain_fq_name = [domain_name]
st_fq_name = [domain_name, st_name]
self.logger.log_info("Creating %s %s hypervisor %s" %
(domain_name, st_name, hypervisor_type))
domain_obj = None
for domain in DomainSM.values():
if domain.fq_name == domain_fq_name:
domain_obj = Domain()
domain_obj.uuid = domain.uuid
domain_obj.fq_name = domain_fq_name
break
if not domain_obj:
self.logger.log_error("%s domain not found" % (domain_name))
return
for st in ServiceTemplateSM.values():
if st.fq_name == st_fq_name:
self.logger.log_info("%s exists uuid %s" %
示例3: SvcMonitor
# 需要導入模塊: from loadbalancer_agent import LoadbalancerAgent [as 別名]
# 或者: from loadbalancer_agent.LoadbalancerAgent import audit_lb_pools [as 別名]
#.........這裏部分代碼省略.........
continue
for vmi_id in vm.virtual_machine_interfaces:
vmi = VirtualMachineInterfaceSM.get(vmi_id)
if not vmi:
continue
self.port_delete_or_si_link(vm, vmi)
# invoke port tuple handling
try:
self.port_tuple_agent.update_port_tuples()
except Exception:
cgitb_error_log(self)
# Load the loadbalancer driver
self.loadbalancer_agent.load_drivers()
# Invoke the health monitors
for hm in HealthMonitorSM.values():
hm.sync()
# Invoke the loadbalancers
for lb in LoadbalancerSM.values():
lb.sync()
# Invoke the loadbalancer listeners
for lb_listener in LoadbalancerListenerSM.values():
lb_listener.sync()
# Invoke the loadbalancer pools
for lb_pool in LoadbalancerPoolSM.values():
lb_pool.sync()
# Audit the lb pools
self.loadbalancer_agent.audit_lb_pools()
# Audit the SNAT instances
self.snat_agent.audit_snat_instances()
# end sync_sm
# create service template
def _create_default_template(self, st_name, svc_type, svc_mode=None,
hypervisor_type='virtual-machine',
image_name=None, flavor=None, scaling=False,
vrouter_instance_type=None,
instance_data=None):
domain_name = 'default-domain'
domain_fq_name = [domain_name]
st_fq_name = [domain_name, st_name]
self.logger.info("Creating %s %s hypervisor %s" %
(domain_name, st_name, hypervisor_type))
domain_obj = None
for domain in DomainSM.values():
if domain.fq_name == domain_fq_name:
domain_obj = Domain()
domain_obj.uuid = domain.uuid
domain_obj.fq_name = domain_fq_name
break
if not domain_obj:
self.logger.error("%s domain not found" % (domain_name))
return
for st in ServiceTemplateSM.values():
if st.fq_name == st_fq_name:
self.logger.info("%s exists uuid %s" %
(st.name, str(st.uuid)))
示例4: SvcMonitor
# 需要導入模塊: from loadbalancer_agent import LoadbalancerAgent [as 別名]
# 或者: from loadbalancer_agent.LoadbalancerAgent import audit_lb_pools [as 別名]
#.........這裏部分代碼省略.........
for si in ServiceInstanceSM.values():
self.create_service_instance(si)
def sync_sm(self):
# Read and Sync all DBase
for cls in DBBaseSM.get_obj_type_map().values():
for obj in cls.list_obj():
cls.locate(obj['uuid'], obj)
# Link SI and VM
for vm in VirtualMachineSM.values():
if vm.service_instance:
continue
for vmi_id in vm.virtual_machine_interfaces:
vmi = VirtualMachineInterfaceSM.get(vmi_id)
if not vmi:
continue
self.port_delete_or_si_link(vm, vmi)
# invoke port tuple handling
try:
self.port_tuple_agent.update_port_tuples()
except Exception:
cgitb_error_log(self)
# Load the loadbalancer driver
self.loadbalancer_agent.load_drivers()
# Invoke the loadbalancer pools
for lb_pool in LoadbalancerPoolSM.values():
lb_pool.add()
# Audit the lb pools
self.loadbalancer_agent.audit_lb_pools()
# Audit the SNAT instances
self.snat_agent.audit_snat_instances()
# end sync_sm
# create service template
def _create_default_template(self, st_name, svc_type, svc_mode=None,
hypervisor_type='virtual-machine',
image_name=None, flavor=None, scaling=False,
vrouter_instance_type=None,
instance_data=None):
domain_name = 'default-domain'
domain_fq_name = [domain_name]
st_fq_name = [domain_name, st_name]
self.logger.info("Creating %s %s hypervisor %s" %
(domain_name, st_name, hypervisor_type))
domain_obj = None
for domain in DomainSM.values():
if domain.fq_name == domain_fq_name:
domain_obj = Domain()
domain_obj.uuid = domain.uuid
domain_obj.fq_name = domain_fq_name
break
if not domain_obj:
self.logger.error("%s domain not found" % (domain_name))
return
for st in ServiceTemplateSM.values():
if st.fq_name == st_fq_name:
self.logger.info("%s exists uuid %s" %
(st.name, str(st.uuid)))