# DBAOps Sovereign™ — Collectors

PowerShell-based collection modules for fleet discovery and telemetry.

## Usage

Inventory only:

```powershell
.\DBAOps-Sovereign-Collector.ps1 -ServerList "SQL01","SQL02" -SovereignApi "http://localhost:3041"
```

Register (if missing) and **ingest telemetry** (Ship V1):

```powershell
.\DBAOps-Sovereign-Collector.ps1 -ServerList "localhost" -SovereignApi "http://localhost:3041" -RegisterIfMissing -BearerToken "<admin-jwt>" -SubmitTelemetry
```

**Fleet coverage** (backup, HADR, patch, DB inventory, SQL Agent, volumes) — `POST /api/ingest/fleet-facts`:

```powershell
.\DBAOps-Sovereign-Collector.ps1 -ServerList "localhost" -SovereignApi "http://localhost:3041" -SubmitFleetFacts -IngestKey $env:SOVEREIGN_INGEST_KEY
```

Combine with `-SubmitTelemetry`. `-RegisterIfMissing` requires `-BearerToken` (Administrator JWT from `POST /api/auth/login`).

With API ingest key: add `-IngestKey` matching `SOVEREIGN_INGEST_KEY` in `.env`. See `docs/SHIP-V1-FLEET-COVERAGE.md`.

## Prerequisites

- PowerShell 7+
- SQL Server client tools (for connectivity to target instances)
- DBAOps Sovereign™ API running (for ingest)

## Scheduled Collection

Schedule via Windows Task Scheduler or SQL Agent to run every 5–15 minutes.

---

Powered by RHOYLLE INNOVATION EMPIRE LLC
