Beispiel #1
0
 def InsertSqlInDownStreamMeta(self, downStreamList, plugin_id, service_id):
     store_list = []
     for stream in downStreamList:
         for cf in stream.get("config"):
             tspa = TenantServicePluginAttr(
                 service_id=stream.get("service_id"),
                 service_alias=stream.get("service_alias"),
                 dest_service_id=stream.get("dest_service_id"),
                 dest_service_alias=stream.get("dest_service_alias"),
                 plugin_id=plugin_id,
                 service_meta_type=stream.get("service_meta_type"),
                 injection=stream.get("injection"),
                 container_port=stream.get("port"),
                 attr_name=cf.get("attr_name"),
                 attr_value=cf.get("attr_default_value", " "),
                 attr_type=cf.get("attr_type"),
                 attr_default_value=cf.get("attr_default_value"),
                 attr_alt_value=cf.get("attr_alt_value"),
                 protocol=stream.get("protocol"),
                 attr_info=cf.get("attr_info"),
                 is_change=cf.get("is_change"))
             store_list.append(tspa)
     TenantServicePluginAttr.objects.filter(
         service_id=service_id, plugin_id=plugin_id, service_meta_type=ConstKey.DOWNSTREAM_PORT).delete()
     TenantServicePluginAttr.objects.bulk_create(store_list)
Beispiel #2
0
 def UpdateSqlInENVMeta(self, envList, plugin_id, service_id):
     store_list = []
     for stream in envList:
         for cf in stream.get("config"):
             tspa = TenantServicePluginAttr(
                 service_id=stream.get("service_id"),
                 service_alias=stream.get("service_alias"),
                 plugin_id=plugin_id,
                 service_meta_type=stream.get("service_meta_type"),
                 container_port=0,
                 injection=stream.get("injection"),
                 attr_name=cf.get("attr_name"),
                 attr_value=cf.get("attr_value", " "),
                 attr_type=cf.get("attr_type"),
                 attr_default_value=cf.get("attr_default_value"),
                 attr_alt_value=cf.get("attr_alt_value"),
                 attr_info=cf.get("attr_info"),
                 is_change=cf.get("is_change"))
             store_list.append(tspa)
     TenantServicePluginAttr.objects.bulk_create(store_list)
Beispiel #3
0
 def create_tenant_service_plugin(self, **kwargs):
     tenant_service_plugin = TenantServicePluginAttr(**kwargs)
     tenant_service_plugin.save()
     return tenant_service_plugin