All seven data/resources records now carry description, decision, reef/secret refs, and potential vs actual consumers. Discovered resources use decision.status: gap. Validators require live inventory to be 0.3. WP-0006 T03 done; workplan finished.
194 lines
8.4 KiB
JSON
194 lines
8.4 KiB
JSON
{
|
|
"$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/v0.3",
|
|
"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"],
|
|
"if": {
|
|
"properties": {"schema_version": {"const": "0.3"}}
|
|
},
|
|
"then": {
|
|
"required": [
|
|
"schema_version", "record_scope", "id", "resource_class", "status",
|
|
"management_model", "provider", "service", "location", "capacity",
|
|
"ownership", "cost", "lifecycle", "relationships", "requirements",
|
|
"evidence", "description", "decision", "operational_refs",
|
|
"credential_handles", "consumers"
|
|
]
|
|
},
|
|
"properties": {
|
|
"schema_version": {"enum": ["0.2", "0.3"]},
|
|
"record_scope": {"enum": ["inventory", "example"]},
|
|
"id": {"type": "string", "pattern": "^resource:[a-z0-9][a-z0-9:_-]+$"},
|
|
"financial_entity_id": {"type": ["string", "null"], "pattern": "^entity:[a-z0-9]+$"},
|
|
"procuring_entity_id": {"type": ["string", "null"], "pattern": "^entity:[a-z0-9]+$"},
|
|
"entity_gap": {"type": ["string", "null"]},
|
|
"description": {"type": "string", "minLength": 1},
|
|
"decision": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["status", "ref"],
|
|
"properties": {
|
|
"status": {"enum": ["recommended", "approved", "rejected", "gap"]},
|
|
"chosen": {"type": ["string", "null"]},
|
|
"rejected": {"type": "array", "items": {"type": "string"}},
|
|
"approved_by": {"type": ["string", "null"]},
|
|
"approved_on": {"type": ["string", "null"], "format": "date"},
|
|
"ref": {"type": "string", "minLength": 1}
|
|
}
|
|
},
|
|
"operational_refs": {
|
|
"type": "array",
|
|
"items": {"type": "string", "pattern": "^reef:"}
|
|
},
|
|
"credential_handles": {
|
|
"type": "array",
|
|
"items": {"type": "string", "pattern": "^secret:"}
|
|
},
|
|
"consumers": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["potential", "actual"],
|
|
"properties": {
|
|
"potential": {"type": "array", "items": {"type": "string"}},
|
|
"actual": {"type": "array", "items": {"type": "string"}}
|
|
}
|
|
},
|
|
"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"]},
|
|
"entity_shares": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["financial_entity_id", "note"],
|
|
"properties": {
|
|
"financial_entity_id": {"type": "string", "pattern": "^entity:[a-z0-9]+$"},
|
|
"note": {"type": "string"}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|