| 12345678910 |
- param([string]$BaseUrl = 'http://192.168.110.96:8301')
- $ErrorActionPreference = 'Stop'
- $rows = foreach ($endpoint in @('/infrastructure/base-archives', '/overview/infrastructure', '/infrastructure/management-information')) {
- $response = Invoke-RestMethod -Method Get -Uri ($BaseUrl.TrimEnd('/') + '/api/cockpit/v1' + $endpoint) -TimeoutSec 10
- if ($response.code -ne 200 -or $null -eq $response.data.totals.facilityCount) { throw "Invalid business response: $endpoint" }
- [pscustomobject]@{ endpoint = $endpoint; facilityCount = $response.data.totals.facilityCount; excluded = $response.data.excluded }
- }
- $rows | ConvertTo-Json -Depth 5
- if (@($rows.facilityCount | Select-Object -Unique).Count -ne 1) { throw 'Facility count mismatch across three endpoints' }
- Write-Output 'PASS: three facility counts agree (stable dataset required).'
|