41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
from sqlalchemy import (
|
|
Column,
|
|
String,
|
|
Integer,
|
|
ForeignKey
|
|
)
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from models.common.base import BaseModel
|
|
|
|
|
|
class pcentral(BaseModel):
|
|
"""
|
|
description: Nutanix prism central model
|
|
"""
|
|
__tablename__ = "tnc_pcentrals"
|
|
_s_collection_name = "pcentrals"
|
|
_s_class_name = "pcentral"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True, index=True)
|
|
name = Column(String(32), unique=True, index=True, nullable=False)
|
|
hostname = Column(String(64), unique=True, index=True, nullable=True)
|
|
ncc_version = Column(String(16), index=True, nullable=False)
|
|
aos_version = Column(String(16), index=True, nullable=False)
|
|
|
|
contour_id = Column(Integer, ForeignKey("tcc_contours.id"))
|
|
contour = relationship("contour", back_populates="pcentral")
|
|
|
|
npcreport = relationship(
|
|
"npcreport",
|
|
backref="pcentral",
|
|
cascade="save-update, delete",
|
|
lazy="dynamic"
|
|
)
|
|
pelement = relationship(
|
|
"pelement",
|
|
backref="pcentral",
|
|
cascade="save-update, delete",
|
|
lazy="dynamic"
|
|
)
|