2 """ PostGreSQL table management """
4 from sfa.storage.model import Base
5 from sqlalchemy import Column, Integer, String
8 class LeaseTable(Base):
9 """ SQL alchemy class to manipulate the rows of the lease_table table in the
10 SFA database. Table creation is made by the importer (iotlabimporter.py)
11 if it is not in the database yet.
13 As we don't have a link between a lease (OAR job submission) and a slice we
14 store this information in database. We matched OAR job id and slice hrn.
16 # pylint:disable=R0903
17 __tablename__ = 'lease_table'
19 job_id = Column(Integer, primary_key=True)
20 slice_hrn = Column(String)
22 def __init__(self, job_id, slice_hrn):
24 Defines a row of the lease_table table
27 self.slice_hrn = slice_hrn
30 """Prints the SQLAlchemy record to the format defined
33 result = "job_id %s, slice_hrn = %s" % (self.job_id,