class calabiyau_subscriber(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) package_id = SQLModel.Uuid() domain = SQLModel.Fqdn(internal=True) tenant_id = SQLModel.Uuid(internal=True) username = SQLModel.Username(max_length=64, null=False) password = SQLModel.Password(max_length=150, null=True) email = SQLModel.Email(max_length=100) name = SQLModel.String(max_length=64) phone_mobile = SQLModel.Phone() phone_office = SQLModel.Phone() designation = SQLModel.Enum('', 'Mr', 'Mrs', 'Ms', 'Dr', 'Prof') static_ip4 = SQLModel.String(null=True, max_length=64) ctx = SQLModel.SmallInt(null=False, default=0) notified = SQLModel.Boolean(null=False, default=True) enabled = SQLModel.Boolean(default=True) creation_time = SQLModel.DateTime(null=False, default=now, readonly=True) volume_expire = SQLModel.DateTime(null=True) package_expire = SQLModel.DateTime(null=True) volume_used_bytes = SQLModel.BigInt(null=False, signed=False, default=0) volume_used = SQLModel.Boolean(null=False, default=False) calabiyau_unique = SQLModel.UniqueIndex(username, domain) calabiyau_pkg_ref = SQLModel.ForeignKey(package_id, calabiyau_package.id, on_delete='RESTRICT') primary_key = id
class tradius_group_attr(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) domain = SQLModel.Fqdn(internal=True) group_id = SQLModel.Uuid() attribute = SQLModel.String() op = SQLModel.String(max_length=2) value = SQLModel.String() ctx = SQLModel.Enum('reply', 'check') creation_time = SQLModel.DateTime(readonly=True, default=now) group_attr_ref = SQLModel.ForeignKey(group_id, tradius_group.id) primary_key = id
class calabiyau_package_attr(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) package_id = SQLModel.Uuid() attribute = SQLModel.String() tag = SQLModel.TinyInt(null=True, signed=False) value = SQLModel.String() ctx = SQLModel.String() nas_type = SQLModel.Word(max_length=64, null=False, regex=r'^[a-z0-9\._-]+$') creation_time = SQLModel.DateTime(readonly=True, default=now) pkg_attr_ref = SQLModel.ForeignKey(package_id, calabiyau_package.id) primary_key = id
class calabiyau_package(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) virtual_id = SQLModel.Uuid() domain = SQLModel.Fqdn(internal=True) name = SQLModel.String(max_length=64) plan = SQLModel.String(max_length=20) volume_gb = SQLModel.SmallInt(null=True, default=0) volume_metric = SQLModel.Enum('days', 'weeks', 'months') volume_span = SQLModel.TinyInt(null=True, default=0) volume_repeat = SQLModel.Boolean(default=True) package_metric = SQLModel.Enum('days', 'weeks', 'months') package_span = SQLModel.TinyInt(null=True, default=0) pool_id = SQLModel.String(null=True, max_length=64) static4 = SQLModel.Boolean(default=False) static6 = SQLModel.Boolean(default=False) simultaneous = SQLModel.Boolean(default=True) deactivate_login = SQLModel.String(max_length=20) deactivate_coa = SQLModel.String(max_length=20) activate_coa = SQLModel.String(max_length=20) fup_login = SQLModel.String(max_length=20) fup_coa = SQLModel.String(max_length=20) creation_time = SQLModel.DateTime(default=now, readonly=True) pkg_virtual_ref = SQLModel.ForeignKey(virtual_id, calabiyau_virtual.id, on_delete='RESTRICT') pkg_pool_ref = SQLModel.ForeignKey(pool_id, calabiyau_pool.id, on_delete='RESTRICT') primary_key = id
class tradius_user_attr(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) domain = SQLModel.Fqdn(internal=True) tenant_id = SQLModel.String() user_id = SQLModel.Uuid() attribute = SQLModel.String() op = SQLModel.String(max_length=2) value = SQLModel.String() creation_time = SQLModel.DateTime(readonly=True, default=now) user_attr_ref = SQLModel.ForeignKey(user_id, tradius_user.id) user_attrs = SQLModel.Index(user_id) user_attrs_domain = SQLModel.Index(domain, user_id) user_attrs_domain_tenant = SQLModel.Index(domain, tenant_id, user_id) primary_key = id
class tradius_ippool(SQLModel): id = SQLModel.BigInt() domain = SQLModel.Fqdn(internal=True) pool_name = SQLModel.String(max_length=30, null=False) framedipaddress = SQLModel.String(max_length=15, default='', null=False) nasipaddress = SQLModel.String(max_length=15, null=False, default = '') expiry_time = SQLModel.DateTime(null=True, default=None) username = SQLModel.String(max_length=64, default='', null=False) pool_key = SQLModel.String(max_length=30, null=False) primary_key = id poolname_expire_index = SQLModel.Index(pool_name, expiry_time) framedipaddress_index = SQLModel.Index(framedipaddress) nasip_poolkey_ipaddress_index = SQLModel.Index(nasipaddress, pool_key, framedipaddress)
class tradius_nas(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) virtual_id = SQLModel.Uuid(internal=True) domain = SQLModel.Fqdn(internal=True) name = SQLModel.Word(max_length=64, null=False) nas_type = SQLModel.String(max_length=64, null=False) secret = SQLModel.String(max_length=64, null=False) server = SQLModel.String(max_length=64, null=False) description = SQLModel.Text() creation_time = SQLModel.DateTime(default=now, readonly=True) nas_virtual_ref = SQLModel.ForeignKey(virtual_id, tradius_virtual.id) virtual_index = SQLModel.Index(virtual_id) nas_index = SQLModel.Index(server) primary_key = id unique_group = SQLModel.UniqueIndex(server)
class tradius_group(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) domain = SQLModel.Fqdn(internal=True) name = SQLModel.String(max_length=64, null=False) description = SQLModel.Text() creation_time = SQLModel.DateTime(default=now, readonly=True) primary_key = id
class calabiyau_nas(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) virtual_id = SQLModel.Uuid(internal=True) name = SQLModel.Word(max_length=64, null=False, regex=r'^[a-z0-9\._-]+$') nas_type = SQLModel.Word(max_length=64, upper=True, null=False, regex=r'^[a-z0-9\._-]+$') secret = SQLModel.String(max_length=64, null=False) server = SQLModel.String(max_length=64, null=False) description = SQLModel.Text() creation_time = SQLModel.DateTime(default=now, readonly=True) nas_virtual_ref = SQLModel.ForeignKey(virtual_id, calabiyau_virtual.id) nas_virtual_index = SQLModel.Index(virtual_id) nas_server_index = SQLModel.Index(server) nas_unique = SQLModel.UniqueIndex(server) primary_key = id
class luxon_role(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) name = SQLModel.String(max_length=64, null=False) description = SQLModel.Text() creation_time = SQLModel.DateTime(default=now, readonly=True) primary_key = id unique_role = SQLModel.UniqueIndex(name) db_default_rows = ROLES roles = SQLModel.Index(name)
class tradius_user(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) virtual_id = SQLModel.Uuid() domain = SQLModel.Fqdn(internal=True) tenant_id = SQLModel.Uuid(internal=True) username = SQLModel.Username(max_length=64, null=False) password = SQLModel.Password(max_length=150, null=True) email = SQLModel.Email(max_length=100) name = SQLModel.String(max_length=64) phone_mobile = SQLModel.Phone() phone_office = SQLModel.Phone() designation = SQLModel.Enum('', 'Mr', 'Mrs', 'Ms', 'Dr', 'Prof') dpi = SQLModel.String(max_length=20) enabled = SQLModel.Boolean(default=True) creation_time = SQLModel.DateTime(default=now, readonly=True) unique_username = SQLModel.UniqueIndex(username, domain) user_virtual_ref = SQLModel.ForeignKey(virtual_id, tradius_virtual.id, on_delete='RESTRICT') primary_key = id
class calabiyau_ippool(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) pool_id = SQLModel.Uuid(null=False) user_id = SQLModel.Uuid(null=False, default='') framedipaddress = SQLModel.String(max_length=40, default='', null=False) expiry_time = SQLModel.DateTime(null=True, default=None) primary_key = id ippool_user_index = SQLModel.Index(user_id, expiry_time) ippool_expire_index = SQLModel.Index(pool_id, expiry_time) ippool_pool_ref = SQLModel.ForeignKey(pool_id, calabiyau_pool.id) ippool_unique_ip = SQLModel.UniqueIndex(pool_id, framedipaddress)
class luxon_endpoint(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) name = SQLModel.Fqdn(max_length=64, null=False) interface = SQLModel.Enum('public', 'internal', 'admin', null=False) region = SQLModel.String(max_length=64, null=False) uri = SQLModel.Uri(max_length=64, null=False) creation_time = SQLModel.DateTime(default=now, internal=True) primary_key = id unique_endpoint = SQLModel.UniqueIndex(interface, uri) endpoint_name = SQLModel.Index(name) endpoint_find = SQLModel.Index(name, interface) endpoint_exact = SQLModel.Index(name, interface, region)
class luxon_user_role(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) role_id = SQLModel.Uuid() domain = SQLModel.Fqdn(internal=True) tenant_id = SQLModel.String() user_id = SQLModel.Uuid() creation_time = SQLModel.DateTime(readonly=True, default=now) unique_user_role = SQLModel.UniqueIndex(role_id, tenant_id, user_id) user_role_id_ref = SQLModel.ForeignKey(role_id, luxon_role.id) user_role_domain_ref = SQLModel.ForeignKey(domain, luxon_domain.name) user_role_tenant_ref = SQLModel.ForeignKey(tenant_id, luxon_tenant.id) user_roles = SQLModel.Index(domain, tenant_id) primary_key = id db_default_rows = USER_ROLES
class luxon_tenant(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) domain = SQLModel.Fqdn(internal=True) tenant_id = SQLModel.Uuid(internal=True) name = SQLModel.String(max_length=100, null=False) enabled = SQLModel.Boolean(default=True) creation_time = SQLModel.DateTime(default=now, readonly=True) unique_tenant = SQLModel.UniqueIndex(domain, name) tenants = SQLModel.Index(id, domain) tenants_search_name = SQLModel.Index(domain, name) tenants_per_domain = SQLModel.Index(domain) primary_key = id tenant_domain_ref = SQLModel.ForeignKey(domain, luxon_domain.name) tenant_parent_ref = SQLModel.ForeignKey(tenant_id, id)
class luxon_user(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) tag = SQLModel.String(hidden=True, max_length=30, null=False) domain = SQLModel.Fqdn(internal=True) tenant_id = SQLModel.Uuid(internal=True) username = SQLModel.Username(max_length=100, null=False) password = SQLModel.String(max_length=100, null=True) email = SQLModel.Email(max_length=255) name = SQLModel.String(max_length=100) phone_mobile = SQLModel.Phone() phone_office = SQLModel.Phone() designation = SQLModel.Enum('', 'Mr', 'Mrs', 'Ms', 'Dr', 'Prof') last_login = SQLModel.DateTime(readonly=True) enabled = SQLModel.Boolean(default=True) creation_time = SQLModel.DateTime(default=now, readonly=True) unique_username = SQLModel.UniqueIndex(domain, username) user_tenant_ref = SQLModel.ForeignKey(tenant_id, luxon_tenant.id) user_domain_ref = SQLModel.ForeignKey(domain, luxon_domain.name) users = SQLModel.Index(domain, username) users_tenants = SQLModel.Index(domain, tenant_id) users_domain = SQLModel.Index(domain) primary_key = id db_default_rows = USERS
class Model_Test2(SQLModel): id = SQLModel.Integer(length=11, null=True) primary_key = id stringcol = SQLModel.String(length=128) floatcol = SQLModel.Float(4,4) doublecol = SQLModel.Double(4,4) decimalcol = SQLModel.Decimal(4,4) datetimecol = SQLModel.DateTime(4,4) pyobject = SQLModel.PyObject() blob = SQLModel.Blob() text = SQLModel.Text() enum = SQLModel.Enum('option1', 'option2') boolean = SQLModel.Boolean() unique_index2 = SQLModel.UniqueIndex(stringcol)
class tradius_user_group(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) group_id = SQLModel.Uuid() domain = SQLModel.Fqdn(internal=True) tenant_id = SQLModel.String() user_id = SQLModel.Uuid() priority = SQLModel.Integer() creation_time = SQLModel.DateTime(readonly=True, default=now) unique_user_group = SQLModel.UniqueIndex(group_id, user_id) user_group_id_ref = SQLModel.ForeignKey(group_id, tradius_group.id) group_index = SQLModel.Index(group_id) domain_group_index = SQLModel.Index(domain, group_id) tenant_group_index = SQLModel.Index(tenant_id, group_id) tenant_domain_group_index = SQLModel.Index(domain, tenant_id, group_id) primary_key = id
class tradius_ippool(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) domain = SQLModel.Fqdn(internal=True) pool_name = SQLModel.String(max_length=30, null=False) framedipaddress = SQLModel.String(max_length=15, default='', null=False) nasipaddress = SQLModel.String(max_length=15, null=False, default='') calledstationid = SQLModel.String(max_length=30, null=True) callingstationid = SQLModel.String(max_length=30, null=True) expiry_time = SQLModel.DateTime(null=True, default=None) username = SQLModel.String(max_length=64, default='', null=False) pool_key = SQLModel.String(max_length=30, null=False) primary_key = id poolname_expire_index = SQLModel.Index(pool_name, expiry_time) framedipaddress_index = SQLModel.Index(framedipaddress) nasip_poolkey_ipaddress_index = SQLModel.Index(nasipaddress, pool_key, framedipaddress) unique_pool_ip = SQLModel.UniqueIndex(pool_name, framedipaddress) pool_name_ref = SQLModel.ForeignKey(pool_name, tradius_pool.pool_name)
class tradius_virtual(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) domain = SQLModel.Fqdn(internal=True) name = SQLModel.String(max_length=64, null=False) primary_key = id
class calabiyau_session(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) user_id = SQLModel.Uuid(null=True) username = SQLModel.String(max_length=128, null=False, default=None) acctsessionid = SQLModel.String(max_length=64, null=True, default=None) acctuniqueid = SQLModel.String(max_length=32, null=True, default=None) nasipaddress = SQLModel.Ip4(null=False) nasportid = SQLModel.String(max_length=15, null=True, default=None) nasport = SQLModel.String(max_length=32, null=True, default=None) nasporttype = SQLModel.String(max_length=32, null=True, default=None) acctstarttime = SQLModel.DateTime(null=True) acctupdated = SQLModel.DateTime(null=True) processed = SQLModel.DateTime(null=True) calledstationid = SQLModel.String(max_length=50, null=True, default=None) callingstationid = SQLModel.String(max_length=50, null=True, default=None) servicetype = SQLModel.String(max_length=32, default=None, null=True) framedprotocol = SQLModel.String(max_length=32, default=None, null=True) framedipaddress = SQLModel.Ip4(null=True) acctinputoctets = SQLModel.BigInt(signed=False, null=True, default=None) acctoutputoctets = SQLModel.BigInt(signed=False, null=True, default=None) accttype = SQLModel.String(max_length=32, null=True, default='start') ctx = SQLModel.SmallInt(null=False, default=0) primary_key = id session_uniqueid_index = SQLModel.UniqueIndex(acctuniqueid) session_username_index = SQLModel.Index(user_id) session_ipaddress_index = SQLModel.Index(framedipaddress) session_acctstarttime_index = SQLModel.Index(acctstarttime) session_acctupdated_index = SQLModel.Index(acctupdated) session_acct_prune_index = SQLModel.Index(accttype, processed) session_nasid_index = SQLModel.Index(acctsessionid) session_nas_index = SQLModel.Index(nasipaddress)
class calabiyau_pool(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) domain = SQLModel.Fqdn(internal=True) pool_name = SQLModel.String(max_length=30, null=False) pool_unique = SQLModel.UniqueIndex(pool_name) primary_key = id
class katalog_file(SQLModel): path = SQLModel.String(null=False) content = SQLModel.LongBlob(null=False) mime_type = SQLModel.String(default="application/octet-stream") primary_key = path
class tradius_accounting(SQLModel): id = SQLModel.Uuid(default=uuid4, internal=True) acctsessionid = SQLModel.String(max_length=64, null=False, default='') acctuniqueid = SQLModel.String(max_length=32, null=False, default='') username = SQLModel.String(max_length=64, null=False, default='') realm = SQLModel.String(max_length=64, null=True, default='') nasipaddress = SQLModel.String(max_length=15, null=False, default='') nasportid = SQLModel.String(max_length=15, null=True, default=None) nasporttype = SQLModel.String(max_length=32, null=True, default=None) acctstarttime = SQLModel.DateTime() acctupdatetime = SQLModel.DateTime() acctstoptime = SQLModel.DateTime() acctinterval = SQLModel.Integer(null=True, default=None) acctsessiontime = SQLModel.Integer(signed=False, null=True, default=None) acctauthentic = SQLModel.String(null=True, default=None, max_length=32) connectinfo_start = SQLModel.String(max_length=50, null=True, default=None) connectinfo_stop = SQLModel.String(max_length=50, null=True, default=None) acctinputoctets = SQLModel.BigInt(null=True, default=None) acctoutputoctets = SQLModel.BigInt(null=True, default=None) calledstationid = SQLModel.String(max_length=50, null=False, default='') callingstationid = SQLModel.String(max_length=50, null=False, default='') acctterminatecause = SQLModel.String(max_length=32, null=False, default='') servicetype = SQLModel.String(max_length=32, default=None, null=True) framedprotocol = SQLModel.String(max_length=32, default=None, null=True) framedipaddress = SQLModel.String(max_length=15, default='', null=False) primary_key = id acctuniqueid_index = SQLModel.UniqueIndex(acctuniqueid) username_index = SQLModel.Index(username, nasipaddress) framedipaddress_index = SQLModel.Index(framedipaddress, nasipaddress) acctsessionid_index = SQLModel.Index(acctsessionid) acctsessiontime_index = SQLModel.Index(acctsessiontime) acctstarttime_index = SQLModel.Index(acctstarttime) acctinterval_index = SQLModel.Index(acctinterval) acctstoptime_index = SQLModel.Index(acctstoptime) nasipaddress_index = SQLModel.Index(nasipaddress)