Files

28 lines
1.0 KiB
Python

"""
Discovery task stubs — Phase 1 scaffolding.
Phase 2 implementations will:
scan_all_networks — iterate Network queryset, run nmap per CIDR, upsert Nodes
poll_proxmox — call Proxmox API, upsert VM/container Nodes via PROXMOX_URL/TOKEN env vars
"""
import logging
from config.celery import app
logger = logging.getLogger(__name__)
@app.task(name="tasks.discovery.scan_all_networks", bind=True, max_retries=3)
def scan_all_networks(self) -> dict: # type: ignore[type-arg]
"""Stub: scan all configured Network CIDRs for live hosts."""
logger.info("discovery.scan_all_networks: stub — Phase 2 not yet implemented")
return {"status": "stub", "message": "Phase 2 not yet implemented"}
@app.task(name="tasks.discovery.poll_proxmox", bind=True, max_retries=3)
def poll_proxmox(self) -> dict: # type: ignore[type-arg]
"""Stub: poll Proxmox API for VMs and containers."""
logger.info("discovery.poll_proxmox: stub — Phase 2 not yet implemented")
return {"status": "stub", "message": "Phase 2 not yet implemented"}