inject_user_key routine fixes
[osm/RO.git] / osm_ro / nfvo_db.py
index d0abdf3..eb72b13 100644 (file)
@@ -491,7 +491,7 @@ class nfvo_db(db_base.db_base):
         return item_changed
 
 #     def get_instance_scenario(self, instance_scenario_id, tenant_id=None):
-#         '''Obtain the scenario instance information, filtering by one or serveral of the tenant, uuid or name
+#         '''Obtain the scenario instance information, filtering by one or several of the tenant, uuid or name
 #         instance_scenario_id is the uuid or the name if it is not a valid uuid format
 #         Only one scenario isntance must mutch the filtering or an error is returned
 #         '''
@@ -543,7 +543,7 @@ class nfvo_db(db_base.db_base):
     @retry
     @with_transaction(cursor='dict')
     def get_scenario(self, scenario_id, tenant_id=None, datacenter_vim_id=None, datacenter_id=None):
-        '''Obtain the scenario information, filtering by one or serveral of the tenant, uuid or name
+        '''Obtain the scenario information, filtering by one or several of the tenant, uuid or name
         scenario_id is the uuid or the name if it is not a valid uuid format
         if datacenter_vim_id,d datacenter_id is provided, it supply aditional vim_id fields with the matching vim uuid
         Only one scenario must mutch the filtering or an error is returned
@@ -964,7 +964,7 @@ class nfvo_db(db_base.db_base):
 
             # instance vms
             cmd = "SELECT iv.uuid as uuid, vim_vm_id, status, error_msg, vim_info, iv.created_at as "\
-                    "created_at, name, vms.osm_id as vdu_osm_id, vim_name, vms.uuid as vm_uuid"\
+                    "created_at, name, vms.osm_id as vdu_osm_id, vim_name, vms.uuid as vm_uuid, related"\
                     " FROM instance_vms as iv join vms on iv.vm_id=vms.uuid "\
                     " WHERE instance_vnf_id='{}' ORDER BY iv.created_at".format(vnf['uuid'])
             self.logger.debug(cmd)
@@ -1002,7 +1002,7 @@ class nfvo_db(db_base.db_base):
         #where_text = "instance_nets.instance_scenario_id='"+ instance_dict['uuid'] + "'"
         cmd = "SELECT inets.uuid as uuid,vim_net_id,status,error_msg,vim_info,created, sce_net_id, " \
                 "net_id as vnf_net_id, datacenter_id, datacenter_tenant_id, sdn_net_id, " \
-                "snets.osm_id as ns_net_osm_id, nets.osm_id as vnf_net_osm_id, inets.vim_name " \
+                "snets.osm_id as ns_net_osm_id, nets.osm_id as vnf_net_osm_id, inets.vim_name, related " \
                 "FROM instance_nets as inets left join sce_nets as snets on inets.sce_net_id=snets.uuid " \
                 "left join nets on inets.net_id=nets.uuid " \
                 "WHERE instance_scenario_id='{}' ORDER BY inets.created_at".format(instance_dict['uuid'])
@@ -1012,7 +1012,7 @@ class nfvo_db(db_base.db_base):
 
         #instance_sfps
         cmd = "SELECT uuid,vim_sfp_id,sce_rsp_id,datacenter_id,"\
-                "datacenter_tenant_id,status,error_msg,vim_info"\
+                "datacenter_tenant_id,status,error_msg,vim_info, related"\
                 " FROM instance_sfps" \
                 " WHERE instance_scenario_id='{}' ORDER BY created_at".format(instance_dict['uuid'])
         self.logger.debug(cmd)
@@ -1022,7 +1022,7 @@ class nfvo_db(db_base.db_base):
         # for sfp in instance_dict['sfps']:
         #instance_sfs
         cmd = "SELECT uuid,vim_sf_id,sce_rsp_hop_id,datacenter_id,"\
-                "datacenter_tenant_id,status,error_msg,vim_info"\
+                "datacenter_tenant_id,status,error_msg,vim_info, related"\
                 " FROM instance_sfs" \
                 " WHERE instance_scenario_id='{}' ORDER BY created_at".format(instance_dict['uuid']) # TODO: replace instance_scenario_id with instance_sfp_id
         self.logger.debug(cmd)
@@ -1032,7 +1032,7 @@ class nfvo_db(db_base.db_base):
         #for sf in instance_dict['sfs']:
         #instance_sfis
         cmd = "SELECT uuid,vim_sfi_id,sce_rsp_hop_id,datacenter_id,"\
-                "datacenter_tenant_id,status,error_msg,vim_info"\
+                "datacenter_tenant_id,status,error_msg,vim_info, related"\
                 " FROM instance_sfis" \
                 " WHERE instance_scenario_id='{}' ORDER BY created_at".format(instance_dict['uuid']) # TODO: replace instance_scenario_id with instance_sf_id
         self.logger.debug(cmd)
@@ -1042,7 +1042,7 @@ class nfvo_db(db_base.db_base):
 
         #instance_classifications
         cmd = "SELECT uuid,vim_classification_id,sce_classifier_match_id,datacenter_id,"\
-                "datacenter_tenant_id,status,error_msg,vim_info"\
+                "datacenter_tenant_id,status,error_msg,vim_info, related"\
                 " FROM instance_classifications" \
                 " WHERE instance_scenario_id='{}' ORDER BY created_at".format(instance_dict['uuid'])
         self.logger.debug(cmd)
@@ -1057,7 +1057,7 @@ class nfvo_db(db_base.db_base):
     @retry(command='delete', extra='No dependences can avoid deleting!!!!')
     @with_transaction(cursor='dict')
     def delete_instance_scenario(self, instance_id, tenant_id=None):
-        '''Deletes a instance_Scenario, filtering by one or serveral of the tenant, uuid or name
+        '''Deletes a instance_Scenario, filtering by one or several of the tenant, uuid or name
         instance_id is the uuid or the name if it is not a valid uuid format
         Only one instance_scenario must mutch the filtering or an error is returned
         '''