125 lines
4.4 KiB
JSON
125 lines
4.4 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "urn:ksp:schema:std.transport:v1",
|
|
"title": "KSP standard HTTP Transport configuration",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["format_version", "retry", "default_profile", "profiles"],
|
|
"properties": {
|
|
"format_version": {"const": 1},
|
|
"retry": {"$ref": "#/$defs/retry"},
|
|
"default_profile": {"$ref": "#/$defs/profileId"},
|
|
"profiles": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {"$ref": "#/$defs/profile"}
|
|
}
|
|
},
|
|
"$defs": {
|
|
"profileId": {
|
|
"type": "string",
|
|
"pattern": "^[a-z0-9][a-z0-9._-]*$"
|
|
},
|
|
"descriptor": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"pattern": "^\\S(?:.*\\S)?$"
|
|
},
|
|
"positiveMs": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 4294967295
|
|
},
|
|
"positiveU32": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 4294967295
|
|
},
|
|
"retry": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["max_retries", "initial_backoff_ms", "max_backoff_ms"],
|
|
"properties": {
|
|
"max_retries": {"type": "integer", "minimum": 0, "maximum": 100},
|
|
"initial_backoff_ms": {"$ref": "#/$defs/positiveMs"},
|
|
"max_backoff_ms": {"$ref": "#/$defs/positiveMs"}
|
|
}
|
|
},
|
|
"limits": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"requests_per_second": {"$ref": "#/$defs/positiveU32"},
|
|
"burst_capacity": {"$ref": "#/$defs/positiveU32"},
|
|
"max_concurrent_requests": {"$ref": "#/$defs/positiveU32"},
|
|
"pause_after_rate_limit_ms": {"$ref": "#/$defs/positiveMs"}
|
|
}
|
|
},
|
|
"role": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["role", "enabled", "request_kinds", "priority", "limits"],
|
|
"properties": {
|
|
"role": {"$ref": "#/$defs/descriptor"},
|
|
"enabled": {"type": "boolean"},
|
|
"request_kinds": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"uniqueItems": true,
|
|
"items": {"$ref": "#/$defs/descriptor"},
|
|
"allOf": [
|
|
{
|
|
"if": {"contains": {"const": "*"}},
|
|
"then": {"maxItems": 1}
|
|
}
|
|
]
|
|
},
|
|
"priority": {"type": "integer", "minimum": 0, "maximum": 4294967295},
|
|
"limits": {"$ref": "#/$defs/limits"}
|
|
}
|
|
},
|
|
"endpoint": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name",
|
|
"enabled",
|
|
"provider",
|
|
"cluster",
|
|
"url",
|
|
"connect_timeout_ms",
|
|
"request_timeout_ms",
|
|
"roles"
|
|
],
|
|
"properties": {
|
|
"name": {"$ref": "#/$defs/descriptor"},
|
|
"enabled": {"type": "boolean"},
|
|
"provider": {"$ref": "#/$defs/descriptor"},
|
|
"cluster": {"$ref": "#/$defs/descriptor"},
|
|
"url": {"type": "string", "minLength": 1},
|
|
"connect_timeout_ms": {"$ref": "#/$defs/positiveMs"},
|
|
"request_timeout_ms": {"$ref": "#/$defs/positiveMs"},
|
|
"max_idle_connections_per_host": {"type": "integer", "minimum": 1},
|
|
"roles": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {"$ref": "#/$defs/role"}
|
|
}
|
|
}
|
|
},
|
|
"profile": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["profile_id", "endpoints"],
|
|
"properties": {
|
|
"profile_id": {"$ref": "#/$defs/profileId"},
|
|
"endpoints": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {"$ref": "#/$defs/endpoint"}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|