def delete_pool(self, context, pool): # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(pool["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._delete(context, pool['tenant_id'], 'pool', nf, pool=pool) nfp_logging.clear_logging_context()
def delete_vip(self, context, vip): # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(vip["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._delete(context, vip['tenant_id'], 'vip', nf, vip=vip) nfp_logging.clear_logging_context()
def delete_member(self, context, member): loadbalancer = member['pool']['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('member', member) self._delete(context, member['tenant_id'], 'member', nf, member=member) nfp_logging.clear_logging_context()
def delete_member(self, context, member): # Fetch pool from pool_id pool = self._get_pool(context, member['pool_id']) # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(pool["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._delete(context, member['tenant_id'], 'member', nf, member=member) nfp_logging.clear_logging_context()
def create_pool(self, context, pool): loadbalancer = pool['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('pool', pool) self._post(context, pool['tenant_id'], 'pool', nf, pool=pool) nfp_logging.clear_logging_context()
def delete_firewall(self, context, firewall, host): # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(firewall["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) body = self._data_wrapper(context, firewall, host, nf, 'DELETE') transport.send_request_to_configurator(self._conf, context, body, "DELETE") nfp_logging.clear_logging_context()
def delete_pool(self, context, pool): nfp_context = module_context.init() LOG.info("Received RPC DELETE POOL for Pool:%(pool)s", {'pool': pool}) loadbalancer = pool['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('pool', pool) self._delete(context, pool['tenant_id'], 'pool', nf, pool=pool)
def delete_loadbalancer(self, context, loadbalancer, delete_vip_port=True): # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._delete( context, loadbalancer['tenant_id'], 'loadbalancer', nf, loadbalancer=loadbalancer) nfp_logging.clear_logging_context()
def create_listener(self, context, listener): loadbalancer = listener['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._post( context, listener['tenant_id'], 'listener', nf, listener=listener) nfp_logging.clear_logging_context()
def delete_healthmonitor(self, context, healthmonitor): loadbalancer = healthmonitor['pool']['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._delete( context, healthmonitor['tenant_id'], 'healthmonitor', nf, healthmonitor=healthmonitor) nfp_logging.clear_logging_context()
def delete_firewall(self, context, firewall, host): nfp_context = module_context.init() # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(firewall["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) LOG.info("Received RPC DELETE FIREWALL for " "Firewall: %(firewall)s", {'firewall': firewall}) body = self._data_wrapper(context, firewall, host, nf, 'DELETE') transport.send_request_to_configurator(self._conf, context, body, "DELETE")
def create_loadbalancer(self, context, loadbalancer, driver_name, allocate_vip=True): # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._post( context, loadbalancer['tenant_id'], 'loadbalancer', nf, loadbalancer=loadbalancer, driver_name=driver_name) nfp_logging.clear_logging_context()
def update_member(self, context, old_member, member): nfp_context = module_context.init() loadbalancer = member['pool']['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('member', member) self._put( context, member['tenant_id'], 'member', nf, old_member=old_member, member=member)
def delete_member(self, context, member): nfp_context = module_context.init() LOG.info(_LI("Received RPC DELETE MEMBER for Member:%(member)s"), {'member': member}) loadbalancer = member['pool']['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('member', member) self._delete(context, member['tenant_id'], 'member', nf, member=member)
def delete_pool_health_monitor(self, context, health_monitor, pool_id): # Fetch pool from pool_id pool = self._get_pool(context, pool_id) # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(pool["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._delete( context, health_monitor['tenant_id'], 'pool_health_monitor', nf, health_monitor=health_monitor, pool_id=pool_id) nfp_logging.clear_logging_context()
def delete_firewall(self, context, firewall, host): nfp_context = module_context.init() # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(firewall["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) LOG.info("Received RPC DELETE FIREWALL for " "Firewall: %(firewall)s", {'firewall': firewall}) body = self._data_wrapper(context, firewall, host, nf, 'DELETE') transport.send_request_to_configurator(self._conf, context, body, "DELETE")
def vpnservice_updated(self, context, **kwargs): # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc( kwargs['resource']['description']) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) reason = kwargs['reason'] body = self._data_wrapper(context, kwargs['resource']['tenant_id'], nf, **kwargs) transport.send_request_to_configurator(self._conf, context, body, reason) nfp_logging.clear_logging_context()
def delete_loadbalancer(self, context, loadbalancer, delete_vip_port=True): nfp_context = module_context.init() LOG.info("Received RPC DELETE LOADBALANCER for LB:" "%(lb)s", {'lb': loadbalancer}) # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('loadbalancer', loadbalancer) self._delete( context, loadbalancer['tenant_id'], 'loadbalancer', nf, loadbalancer=loadbalancer)
def update_loadbalancer(self, context, old_loadbalancer, loadbalancer): nfp_context = module_context.init() # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('loadbalancer', loadbalancer) self._put(context, loadbalancer['tenant_id'], 'loadbalancer', nf, old_loadbalancer=old_loadbalancer, loadbalancer=loadbalancer)
def create_listener(self, context, listener): nfp_context = module_context.init() LOG.info("Received RPC CREATE LISTENER for Listener:%(listener)s", {'listener': listener}) loadbalancer = listener['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('listener', listener) self._post( context, listener['tenant_id'], 'listener', nf, listener=listener)
def delete_pool(self, context, pool): nfp_context = module_context.init() LOG.info("Received RPC DELETE POOL for Pool:%(pool)s", {'pool': pool}) loadbalancer = pool['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('pool', pool) self._delete( context, pool['tenant_id'], 'pool', nf, pool=pool)
def delete_member(self, context, member): nfp_context = module_context.init() LOG.info("Received RPC DELETE MEMBER for Member:%(member)s", {'member': member}) loadbalancer = member['pool']['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('member', member) self._delete( context, member['tenant_id'], 'member', nf, member=member)
def delete_healthmonitor(self, context, healthmonitor): nfp_context = module_context.init() LOG.info("Received RPC DELETE HEALTH MONITOR for HM:%(hm)s", {'hm': healthmonitor}) loadbalancer = healthmonitor['pool']['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('healthmonitor', healthmonitor) self._delete( context, healthmonitor['tenant_id'], 'healthmonitor', nf, healthmonitor=healthmonitor)
def update_loadbalancer(self, context, old_loadbalancer, loadbalancer): # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_logging.store_logging_context(meta_id=nf_id) nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('loadbalancer', loadbalancer) self._put(context, loadbalancer['tenant_id'], 'loadbalancer', nf, old_loadbalancer=old_loadbalancer, loadbalancer=loadbalancer) nfp_logging.clear_logging_context()
def delete_loadbalancer(self, context, loadbalancer, delete_vip_port=True): nfp_context = module_context.init() LOG.info(_LI("Received RPC DELETE LOADBALANCER for LB:" "%(lb)s"), {'lb': loadbalancer}) # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('loadbalancer', loadbalancer) self._delete(context, loadbalancer['tenant_id'], 'loadbalancer', nf, loadbalancer=loadbalancer)
def vpnservice_updated(self, context, **kwargs): nfp_context = module_context.init() LOG.info(_LI("Received RPC VPN SERVICE UPDATED with data:%(data)s"), {'data': kwargs}) # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc( kwargs['resource']['description']) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) reason = kwargs['reason'] body = self._data_wrapper(context, kwargs['resource']['tenant_id'], nf, **kwargs) transport.send_request_to_configurator(self._conf, context, body, reason)
def delete_healthmonitor(self, context, healthmonitor): nfp_context = module_context.init() LOG.info(_LI("Received RPC DELETE HEALTH MONITOR for HM:%(hm)s"), {'hm': healthmonitor}) loadbalancer = healthmonitor['pool']['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('healthmonitor', healthmonitor) self._delete(context, healthmonitor['tenant_id'], 'healthmonitor', nf, healthmonitor=healthmonitor)
def create_listener(self, context, listener): nfp_context = module_context.init() LOG.info(_LI("Received RPC CREATE LISTENER for Listener:%(listener)s"), {'listener': listener}) loadbalancer = listener['loadbalancer'] # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('listener', listener) self._post(context, listener['tenant_id'], 'listener', nf, listener=listener)
def vpnservice_updated(self, context, **kwargs): nfp_context = module_context.init() LOG.info("Received RPC VPN SERVICE UPDATED with data:%(data)s", {'data': kwargs}) # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(kwargs[ 'resource']['description']) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) reason = kwargs['reason'] body = self._data_wrapper(context, kwargs[ 'resource']['tenant_id'], nf, **kwargs) transport.send_request_to_configurator(self._conf, context, body, reason)
def create_loadbalancer(self, context, loadbalancer, driver_name, allocate_vip=True): nfp_context = module_context.init() LOG.info("Received RPC CREATE LOADBALANCER for LB:%(lb)s", {'lb': loadbalancer}) # Fetch nf_id from description of the resource nf_id = self._fetch_nf_from_resource_desc(loadbalancer["description"]) nfp_context['log_context']['meta_id'] = nf_id nf = common.get_network_function_details(context, nf_id) self._update_tls_cert('loadbalancer', loadbalancer) self._post(context, loadbalancer['tenant_id'], 'loadbalancer', nf, loadbalancer=loadbalancer, driver_name=driver_name)