| 1234567891011121314151617181920212223242526272829303132333435363738 |
- $ErrorActionPreference = 'Stop'
- $base = 'http://192.168.110.96:8301/api/cockpit/v1'
- $results = @()
- foreach ($endpoint in @('map-snapshot?pageSize=1000', 'monitoring/overview', 'monitoring/distribution?pageSize=1000')) {
- try {
- $response = Invoke-WebRequest -Uri "$base/$endpoint" -UseBasicParsing -TimeoutSec 25
- $body = $response.Content | ConvertFrom-Json
- $data = $body.data
- $emptyBucket = @($data.pointStatusDistribution | Where-Object { $_.status -eq 'EMPTY' })
- $results += [pscustomobject]@{
- endpoint = $endpoint
- httpStatus = [int]$response.StatusCode
- businessCode = $body.code
- monitoringPointCount = $data.counts.monitoringPointCount
- pagePointCount = if ($null -eq $data.monitoringPoints) { $null } else { @($data.monitoringPoints).Count }
- pagePointCodes = if ($null -eq $data.monitoringPoints) { @() } else { @($data.monitoringPoints | ForEach-Object { $_.pointCode }) }
- total = $data.pagination.total
- hasMore = $data.pagination.hasMore
- emptyCount = if ($emptyBucket.Count -eq 1) { $emptyBucket[0].count } else { $null }
- excluded = $data.excluded
- freshness = $data.freshness
- unrenderablePagePoints = @($data.monitoringPoints | Where-Object { $_.coordinateValidation.renderable -eq $false }).Count
- unassociatedPageCount = if ($null -eq $data.unassociatedEquipment) { $null } else { @($data.unassociatedEquipment).Count }
- }
- } catch {
- $results += [pscustomobject]@{ endpoint = $endpoint; error = $_.Exception.Message }
- }
- }
- $output = [pscustomobject]@{
- observedAt = (Get-Date -Format o)
- baseUrl = $base
- method = 'GET only; no authentication, restart or mutation'
- results = $results
- }
- $artifact = Join-Path $PSScriptRoot 'artifacts/t28/live-readonly-verification.json'
- New-Item -ItemType Directory -Force -Path (Split-Path $artifact) | Out-Null
- $output | ConvertTo-Json -Depth 12 | Set-Content -LiteralPath $artifact -Encoding utf8
- $output | ConvertTo-Json -Depth 12
|