Seed a non-secret service inventory (environments, hosts, clusters, services, endpoints, access paths, evidence, gaps) with a JSON schema, a renderer, and a generated service-catalog view. Adds the `make ops-inventory-view` target, probe ActivityDefinition, and docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
175 lines
5.1 KiB
JSON
175 lines
5.1 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://custodian.local/schemas/ops-service-inventory.schema.json",
|
|
"title": "Ops Hub Service Inventory",
|
|
"type": "object",
|
|
"required": ["version", "last_reviewed", "environments", "hosts", "clusters", "services"],
|
|
"properties": {
|
|
"version": { "type": "integer", "minimum": 1 },
|
|
"last_reviewed": { "type": "string", "format": "date" },
|
|
"policy": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
},
|
|
"sources": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/source" }
|
|
},
|
|
"environments": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/environment" }
|
|
},
|
|
"hosts": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/host" }
|
|
},
|
|
"clusters": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/cluster" }
|
|
},
|
|
"services": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/service" }
|
|
}
|
|
},
|
|
"$defs": {
|
|
"source": {
|
|
"type": "object",
|
|
"required": ["path", "summary"],
|
|
"properties": {
|
|
"path": { "type": "string" },
|
|
"summary": { "type": "string" }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"environment": {
|
|
"type": "object",
|
|
"required": ["id", "name", "role", "lifecycle_state"],
|
|
"properties": {
|
|
"id": { "$ref": "#/$defs/id" },
|
|
"name": { "type": "string" },
|
|
"role": { "type": "string" },
|
|
"lifecycle_state": { "$ref": "#/$defs/lifecycle_state" }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"host": {
|
|
"type": "object",
|
|
"required": ["id", "environment", "role"],
|
|
"properties": {
|
|
"id": { "$ref": "#/$defs/id" },
|
|
"environment": { "$ref": "#/$defs/id" },
|
|
"address": { "type": "string" },
|
|
"role": { "type": "string" },
|
|
"evidence": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/evidence" }
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"cluster": {
|
|
"type": "object",
|
|
"required": ["id", "environment", "kind", "lifecycle_state"],
|
|
"properties": {
|
|
"id": { "$ref": "#/$defs/id" },
|
|
"environment": { "$ref": "#/$defs/id" },
|
|
"host": { "$ref": "#/$defs/id" },
|
|
"kind": { "type": "string" },
|
|
"lifecycle_state": { "$ref": "#/$defs/lifecycle_state" },
|
|
"notes": { "type": "string" }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"service": {
|
|
"type": "object",
|
|
"required": ["id", "name", "kind", "lifecycle_state", "health_status", "environment", "owner_repos", "runtime", "endpoints", "backing_stores", "access_paths", "evidence", "gaps"],
|
|
"properties": {
|
|
"id": { "$ref": "#/$defs/id" },
|
|
"name": { "type": "string" },
|
|
"kind": { "type": "string" },
|
|
"lifecycle_state": { "$ref": "#/$defs/lifecycle_state" },
|
|
"health_status": {
|
|
"enum": ["unknown", "observed_ok", "degraded", "down", "planned"]
|
|
},
|
|
"environment": { "$ref": "#/$defs/id" },
|
|
"owner_repos": {
|
|
"type": "array",
|
|
"items": { "type": "string" }
|
|
},
|
|
"desired_state_sources": {
|
|
"type": "array",
|
|
"items": { "type": "string" }
|
|
},
|
|
"runtime": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
},
|
|
"endpoints": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/endpoint" }
|
|
},
|
|
"backing_stores": {
|
|
"type": "array",
|
|
"items": { "type": "string" }
|
|
},
|
|
"access_paths": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/access_path" }
|
|
},
|
|
"evidence": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/evidence" }
|
|
},
|
|
"gaps": {
|
|
"type": "array",
|
|
"items": { "type": "string" }
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"endpoint": {
|
|
"type": "object",
|
|
"required": ["id", "type"],
|
|
"properties": {
|
|
"id": { "$ref": "#/$defs/id" },
|
|
"type": { "type": "string" },
|
|
"url": { "type": "string" },
|
|
"expected_status": { "type": "integer" },
|
|
"expected_signal": { "type": "string" },
|
|
"widget_ref": { "type": "string" }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"access_path": {
|
|
"type": "object",
|
|
"required": ["type", "target", "status"],
|
|
"properties": {
|
|
"type": { "type": "string" },
|
|
"target": { "type": "string" },
|
|
"status": { "enum": ["unknown", "observed_ok", "degraded", "down", "planned"] }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"evidence": {
|
|
"type": "object",
|
|
"required": ["type", "source"],
|
|
"properties": {
|
|
"type": { "type": "string" },
|
|
"observed_at": { "type": "string" },
|
|
"source": { "type": "string" },
|
|
"summary": { "type": "string" }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
},
|
|
"lifecycle_state": {
|
|
"enum": ["observed", "planned", "target", "retired"]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|