Initial Commit
This commit is contained in:
49
api/app/models/vmware/reports/sharedNetworks/report.py
Normal file
49
api/app/models/vmware/reports/sharedNetworks/report.py
Normal file
@@ -0,0 +1,49 @@
|
||||
from sqlalchemy import (
|
||||
Column,
|
||||
String,
|
||||
Integer,
|
||||
Float,
|
||||
ForeignKey
|
||||
)
|
||||
|
||||
from models.common.base import BaseModel
|
||||
|
||||
|
||||
class sharedNetwork(BaseModel):
|
||||
"""
|
||||
description: Shared Networks report model
|
||||
"""
|
||||
__tablename__ = "tvrsn_report"
|
||||
_s_collection_name = "sharedNetworks"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True, index=True)
|
||||
vrf = Column(String(64), nullable=False)
|
||||
vrfId = Column(Integer, nullable=False, index=True)
|
||||
subnet = Column(String(15), nullable=False)
|
||||
subnetId = Column(Integer, nullable=False, unique=True, index=True)
|
||||
subnetMask = Column(Integer, nullable=False)
|
||||
requestsID = Column(String(32))
|
||||
bussinessLine = Column(String(32))
|
||||
subnetManager = Column(String(32), index=True)
|
||||
virtSubnetName = Column(String(32))
|
||||
virtSubnetUUID = Column(String(32))
|
||||
freeIPPercent = Column(Float, nullable=False)
|
||||
|
||||
cluster_id = Column(
|
||||
Integer,
|
||||
ForeignKey("tvc_clusters.id"),
|
||||
nullable=True,
|
||||
index=True
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
platform = kwargs.pop("platform", None) # noqa
|
||||
|
||||
BaseModel.__init__(self, **kwargs)
|
||||
|
||||
def to_dict(self):
|
||||
result = BaseModel.to_dict(self)
|
||||
|
||||
result["platform"] = "vmware"
|
||||
|
||||
return result
|
||||
Reference in New Issue
Block a user