2 File holding a class to define the table in the iotlab dedicated table.
3 The table is the SFA dtabase, therefore all the access mecanism
4 (session, engine...) is handled by alchemy.py.
9 from sfa.storage.model import Base
10 from sqlalchemy import Column, Integer, String
14 class LeaseTableXP (Base):
15 """ SQL alchemy class to manipulate the rows of the lease_table table in the
16 SFA database. Handles the records representation and creates.
17 Table creation is made by the importer if it is not in the database yet.
19 .. seealso:: init_tables in model.py, run in iotlabimporter.py
22 __tablename__ = 'lease_table'
24 slice_hrn = Column(String)
25 experiment_id = Column(Integer, primary_key=True)
26 end_time = Column(Integer, nullable=False)
28 def __init__(self, slice_hrn=None, experiment_id=None, end_time=None):
30 Defines a row of the lease_table table
33 self.slice_hrn = slice_hrn
35 self.experiment_id = experiment_id
37 self.end_time = end_time
40 """Prints the SQLAlchemy record to the format defined
43 result = "<lease_table : slice_hrn = %s , experiment_id %s \
44 end_time = %s" % (self.slice_hrn, self.experiment_id,