{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://coulomb.social/resource-control/resource-inventory.schema.json", "title": "Railiance managed-infrastructure portfolio resource v0.2", "type": "object", "additionalProperties": false, "required": ["schema_version", "record_scope", "id", "resource_class", "status", "management_model", "provider", "service", "location", "capacity", "ownership", "cost", "lifecycle", "relationships", "requirements", "evidence"], "properties": { "schema_version": {"const": "0.2"}, "record_scope": {"enum": ["inventory", "example"]}, "id": {"type": "string", "pattern": "^resource:[a-z0-9][a-z0-9:_-]+$"}, "resource_class": {"enum": ["compute_instance", "storage", "network", "kubernetes_capacity", "database", "managed_service", "self_managed_service", "shared_platform_service", "license"]}, "status": {"enum": ["proposed", "ordered", "commissioning", "active", "suspended", "retiring", "retired", "rejected"]}, "management_model": {"enum": ["provider_managed", "self_managed", "shared_capacity"]}, "provider": { "type": "object", "additionalProperties": false, "required": ["name", "account_ref", "product_ref", "provider_resource_id"], "properties": { "name": {"type": "string", "minLength": 1}, "account_ref": {"type": ["string", "null"]}, "product_ref": {"type": ["string", "null"]}, "provider_resource_id": {"type": ["string", "null"]} } }, "service": { "type": "object", "additionalProperties": false, "required": ["name", "service_id", "class", "capacity_model"], "properties": { "name": {"type": "string", "minLength": 1}, "service_id": {"type": ["string", "null"]}, "class": {"type": "string", "minLength": 1}, "capacity_model": {"enum": ["elastic", "fixed", "shared", "licensed", "unknown"]} } }, "location": { "type": "object", "additionalProperties": false, "required": ["region", "country", "failure_domains", "residency"], "properties": { "region": {"type": ["string", "null"]}, "country": {"type": ["string", "null"], "pattern": "^[A-Z]{2}$"}, "failure_domains": {"type": "array", "items": {"type": "string"}}, "residency": {"type": ["string", "null"]} } }, "capacity": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["metric", "value", "unit", "kind", "observed_at"], "properties": { "metric": {"type": "string", "minLength": 1}, "value": {"type": ["number", "null"], "minimum": 0}, "unit": {"type": "string", "minLength": 1}, "kind": {"enum": ["provisioned", "usable", "limit", "allocated", "observed", "unknown"]}, "observed_at": {"type": ["string", "null"], "format": "date"} } } }, "ownership": { "type": "object", "additionalProperties": false, "required": ["owner", "environment", "workload_ids", "tenant_id", "allocation"], "properties": { "owner": {"type": "string", "minLength": 1}, "environment": {"type": "string", "minLength": 1}, "workload_ids": {"type": "array", "items": {"type": "string"}}, "tenant_id": {"type": ["string", "null"]}, "allocation": { "type": "object", "additionalProperties": false, "required": ["mode", "cost_attribution_key", "driver", "method_version"], "properties": { "mode": {"enum": ["dedicated", "shared", "unattributed"]}, "cost_attribution_key": {"type": ["string", "null"]}, "driver": {"type": ["string", "null"]}, "method_version": {"type": ["string", "null"]} } } } }, "cost": { "type": "object", "additionalProperties": false, "required": ["currency", "tax_status", "billing_model", "commitment_ref", "price_evidence"], "properties": { "currency": {"type": ["string", "null"], "pattern": "^[A-Z]{3}$"}, "tax_status": {"enum": ["included", "excluded", "unknown", "not_applicable"]}, "billing_model": {"type": "string", "minLength": 1}, "commitment_ref": {"type": ["string", "null"]}, "price_evidence": {"type": ["string", "null"]} } }, "lifecycle": { "type": "object", "additionalProperties": false, "required": ["proposed_on", "ordered_on", "commissioned_on", "renews_on", "cancel_by", "retired_on", "exit_path"], "properties": { "proposed_on": {"type": ["string", "null"], "format": "date"}, "ordered_on": {"type": ["string", "null"], "format": "date"}, "commissioned_on": {"type": ["string", "null"], "format": "date"}, "renews_on": {"type": ["string", "null"], "format": "date"}, "cancel_by": {"type": ["string", "null"], "format": "date"}, "retired_on": {"type": ["string", "null"], "format": "date"}, "exit_path": {"type": "string", "minLength": 1} } }, "relationships": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["type", "resource_id"], "properties": { "type": {"enum": ["depends_on", "hosted_on", "part_of", "provides_capacity_to", "replaces", "backed_up_to"]}, "resource_id": {"type": "string", "pattern": "^resource:"} } } }, "requirements": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["kind", "ref"], "properties": {"kind": {"enum": ["service_objective", "security", "residency", "recovery", "retention", "performance", "other"]}, "ref": {"type": "string", "minLength": 1}} } }, "evidence": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["kind", "ref", "observed_at", "authority"], "properties": { "kind": {"enum": ["provider", "contract", "telemetry", "workload", "decision", "test", "example"]}, "ref": {"type": "string", "minLength": 1}, "observed_at": {"type": ["string", "null"], "format": "date"}, "authority": {"type": "string", "minLength": 1} } } } } }