X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fstorage%2Fmodel.py;h=b0950429d604c37768d3a2c96a9579a1457fda62;hb=1cc8e9613cab8b5b22478de369f259e591c54e6d;hp=05046d060f3da77393e84108f970a3a1b90fcb76;hpb=2be379dd1f4e8e74de143fb6c7c530d11b128c8b;p=sfa.git diff --git a/sfa/storage/model.py b/sfa/storage/model.py index 05046d06..b0950429 100644 --- a/sfa/storage/model.py +++ b/sfa/storage/model.py @@ -1,6 +1,7 @@ from types import StringTypes from datetime import datetime +from sqlalchemy import or_, and_ from sqlalchemy import Column, Integer, String, DateTime from sqlalchemy import Table, Column, MetaData, join, ForeignKey from sqlalchemy.orm import relationship, backref @@ -311,6 +312,91 @@ class RegKey (Base): result += ">" return result +class SliverAllocation(Base,AlchemyObj): + __tablename__ = 'sliver_allocation' + sliver_id = Column(String, primary_key=True) + client_id = Column(String) + component_id = Column(String) + slice_urn = Column(String) + allocation_state = Column(String) + + def __init__(self, **kwds): + if 'sliver_id' in kwds: + self.sliver_id = kwds['sliver_id'] + if 'client_id' in kwds: + self.client_id = kwds['client_id'] + if 'component_id' in kwds: + self.component_id = kwds['component_id'] + if 'slice_urn' in kwds: + self.slice_urn = kwds['slice_urn'] + if 'allocation_state' in kwds: + self.allocation_state = kwds['allocation_state'] + + def __repr__(self): + result = "