Get container record by configuration hash. Args: config_hash: Configuration hash to look up Returns: ContainerRecord if found, None otherwise
(self, config_hash: str)
| 275 | conn.close() |
| 276 | |
| 277 | def get_by_config_hash(self, config_hash: str) -> Optional[ContainerRecord]: |
| 278 | """Get container record by configuration hash. |
| 279 | |
| 280 | Args: |
| 281 | config_hash: Configuration hash to look up |
| 282 | |
| 283 | Returns: |
| 284 | ContainerRecord if found, None otherwise |
| 285 | """ |
| 286 | conn = self._get_connection() |
| 287 | try: |
| 288 | cursor = conn.cursor() |
| 289 | cursor.execute( |
| 290 | "SELECT container_id, container_name, image_name, owner_pid, created_at, config_hash, platform_type FROM containers WHERE config_hash = ?", |
| 291 | (config_hash,), |
| 292 | ) |
| 293 | row = cursor.fetchone() |
| 294 | if row: |
| 295 | return ContainerRecord( |
| 296 | container_id=row[0], |
| 297 | container_name=row[1], |
| 298 | image_name=row[2], |
| 299 | owner_pid=row[3], |
| 300 | created_at=row[4], |
| 301 | config_hash=row[5] if len(row) > 5 else "", |
| 302 | platform_type=row[6] if len(row) > 6 else "", |
| 303 | ) |
| 304 | return None |
| 305 | finally: |
| 306 | conn.close() |
| 307 | |
| 308 | def get_by_platform_type( |
| 309 | self, platform_type: str, order_by_created_at: bool = True |
nothing calls this directly
no test coverage detected