Esempio n. 1
0
 def clean(self, fiware_service=None, **kwargs):
     types = CrateTranslator.query_entity_types(
         self, fiware_service=fiware_service, **kwargs)
     if types:
         for t in types:
             CrateTranslator.drop_table(self,
                                        t,
                                        fiware_service=fiware_service,
                                        **kwargs)
         try:
             self._refresh(types, fiware_service=fiware_service)
         except exceptions.ProgrammingError:
             pass
Esempio n. 2
0
 def insert(self,
            entities,
            fiware_service=None,
            fiware_servicepath=None):
     r = CrateTranslator.insert(self, entities, fiware_service,
                                fiware_servicepath)
     self._refresh(set([e['type'] for e in entities]),
                   fiware_service=fiware_service)
     return r
Esempio n. 3
0
 def entity_types(self, fiware_service=None, **kwargs):
     r = CrateTranslator.query_entity_types(
         self,
         entity_type=None,
         fiware_service=fiware_service,
         **kwargs)
     try:
         self._refresh(r, fiware_service=fiware_service)
     except exceptions.ProgrammingError:
         pass
     return r
Esempio n. 4
0
 def delete_entities(self,
                     entity_type=None,
                     fiware_service=None,
                     **kwargs):
     r = CrateTranslator.delete_entities(self,
                                         entity_type,
                                         fiware_service=fiware_service,
                                         **kwargs)
     try:
         self._refresh([entity_type], fiware_service=fiware_service)
     except exceptions.ProgrammingError:
         pass
     return r