models
SQLModel table definitions for PostgreSQL cache.
Supports JSONB columns for complex data types with binary keys.
Asset ¶
Bases: SQLModel
Cached gateway and server assets from Check Point.
Source code in src/arodonata/cache/models.py
CPObject ¶
Bases: SQLModel
Cached Check Point network object with extracted fields and raw data.
Stores relevant fields from Check Point API responses with automatic field filtering for fast queries, plus raw JSONB for complete object access.
Source code in src/arodonata/cache/models.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | |
DistributedLock ¶
Bases: SQLModel
Distributed lock record for cross-process coordination.
Source code in src/arodonata/cache/models.py
Domain ¶
Bases: SQLModel
Cached domain information with MDS server mappings.
Source code in src/arodonata/cache/models.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | |
__repr__() ¶
build(*, mgmt_name, domain_name, domain_uid='', active_ip, active_server='', active_mds='', active_mds_ip='', standby_mdss='', standby_ips='', standby_servers='', is_mdm=False) classmethod ¶
Factory method to create Domain objects with proper defaults.
Eliminates duplication in domain creation across the codebase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mgmt_name | str | Management server name. | required |
domain_name | str | Domain name. | required |
domain_uid | str | Domain UID (default: ""). | '' |
active_ip | str | Active server IP address. | required |
active_server | str | Active server name (default: mgmt_name). | '' |
active_mds | str | Hosting MDS member's name (default: mgmt_name). | '' |
active_mds_ip | str | Hosting member's IPv4 (default: "" = unknown). | '' |
standby_mdss | str | Comma-separated MDS standby servers. | '' |
standby_ips | str | Comma-separated standby IPs. | '' |
standby_servers | str | Comma-separated standby server names. | '' |
is_mdm | bool | Multi-Domain Management status. | False |
Returns:
| Type | Description |
|---|---|
Domain | Configured Domain instance. |
Example
domain = Domain.build( mgmt_name="mgmt1", domain_name="dmn1", domain_uid="123abc", active_ip="192.168.1.10" )
Source code in src/arodonata/cache/models.py
LastPublishedSession ¶
Bases: SQLModel
Last published session for smart refresh detection.
Tracks the last published session time per domain to determine if cache refresh is needed during "check" mode.
Source code in src/arodonata/cache/models.py
RulebaseAccess ¶
Bases: SQLModel
Cached access control rules from Network layer.
Source code in src/arodonata/cache/models.py
RulebaseHTTPS ¶
Bases: SQLModel
Cached HTTPS inspection rules from CVD layer.
Source code in src/arodonata/cache/models.py
RulebaseNAT ¶
Bases: SQLModel
Cached NAT rules from NAT layer.
Source code in src/arodonata/cache/models.py
RulebaseThreat ¶
Bases: SQLModel
Cached threat prevention rules from Threat layer.
Source code in src/arodonata/cache/models.py
SIDCache ¶
Bases: SQLModel
Cached Check Point API session identifiers.
Source code in src/arodonata/cache/models.py
__repr__() ¶
String representation.
SchemaVersion ¶
Bases: SQLModel
Row-per-applied-hash record of confirmed-applied model schema hashes.
DatabaseManager.initialize() skips the per-table migration scan when a row for the currently registered metadata hash already exists. The hash itself (rather than a synthetic single row id) is the primary key so that multiple processes sharing one DB but registering different model sets (e.g. different DISABLED_PLUGINS) each get their own row instead of thrashing: with a single mutable row, each process's init would mismatch the other's stored hash, pay the full scan every time, and overwrite the other's hash.
Source code in src/arodonata/cache/models.py
ServerList dataclass ¶
Value object for comma-separated server lists.
Provides type-safe handling of standby server lists.
Example
servers = ServerList.from_csv("server1,server2,server3") assert servers.servers == ["server1", "server2", "server3"] assert servers.to_csv() == "server1,server2,server3"
empty = ServerList.from_csv("") assert empty.servers == [] assert empty.to_csv() == ""
Source code in src/arodonata/cache/models.py
__bool__() ¶
from_csv(csv) classmethod ¶
Create ServerList from comma-separated string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
csv | str | Comma-separated string (empty string returns empty list). | required |
Returns:
| Type | Description |
|---|---|
ServerList | ServerList instance. |
Source code in src/arodonata/cache/models.py
to_csv() ¶
Convert to comma-separated string.
Returns:
| Type | Description |
|---|---|
str | Comma-separated string (empty string if no servers). |