mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-02 08:44:44 +00:00
generate openapi spec
This commit is contained in:
parent
ba6334475f
commit
49e93085db
3 changed files with 300 additions and 10 deletions
173
docs/_static/llama-stack-spec.html
vendored
173
docs/_static/llama-stack-spec.html
vendored
|
@ -1251,6 +1251,58 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/v1/telemetry/metrics/{metric_name}": {
|
||||||
|
"post": {
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/GetMetricsResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"$ref": "#/components/responses/BadRequest400"
|
||||||
|
},
|
||||||
|
"429": {
|
||||||
|
"$ref": "#/components/responses/TooManyRequests429"
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"$ref": "#/components/responses/InternalServerError500"
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"$ref": "#/components/responses/DefaultError"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Telemetry"
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "metric_name",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/GetMetricsRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/v1/models/{model_id}": {
|
"/v1/models/{model_id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -7559,6 +7611,127 @@
|
||||||
"title": "FileResponse",
|
"title": "FileResponse",
|
||||||
"description": "Response representing a file entry."
|
"description": "Response representing a file entry."
|
||||||
},
|
},
|
||||||
|
"GetMetricsRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"start_time": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"end_time": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"step": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"query_type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"range",
|
||||||
|
"instant"
|
||||||
|
],
|
||||||
|
"title": "MetricQueryType"
|
||||||
|
},
|
||||||
|
"label_matchers": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"operator": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"=",
|
||||||
|
"!=",
|
||||||
|
"=~",
|
||||||
|
"!~"
|
||||||
|
],
|
||||||
|
"title": "MetricLabelOperator",
|
||||||
|
"default": "="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"value",
|
||||||
|
"operator"
|
||||||
|
],
|
||||||
|
"title": "MetricLabelMatcher"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"start_time",
|
||||||
|
"query_type"
|
||||||
|
],
|
||||||
|
"title": "GetMetricsRequest"
|
||||||
|
},
|
||||||
|
"MetricDataPoint": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"timestamp": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"timestamp",
|
||||||
|
"value"
|
||||||
|
],
|
||||||
|
"title": "MetricDataPoint"
|
||||||
|
},
|
||||||
|
"MetricSeries": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"metric": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"values": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/MetricDataPoint"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"metric",
|
||||||
|
"labels",
|
||||||
|
"values"
|
||||||
|
],
|
||||||
|
"title": "MetricSeries"
|
||||||
|
},
|
||||||
|
"GetMetricsResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/MetricSeries"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": [
|
||||||
|
"data"
|
||||||
|
],
|
||||||
|
"title": "GetMetricsResponse"
|
||||||
|
},
|
||||||
"Model": {
|
"Model": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
121
docs/_static/llama-stack-spec.yaml
vendored
121
docs/_static/llama-stack-spec.yaml
vendored
|
@ -857,6 +857,40 @@ paths:
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
/v1/telemetry/metrics/{metric_name}:
|
||||||
|
post:
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/GetMetricsResponse'
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/responses/BadRequest400'
|
||||||
|
'429':
|
||||||
|
$ref: >-
|
||||||
|
#/components/responses/TooManyRequests429
|
||||||
|
'500':
|
||||||
|
$ref: >-
|
||||||
|
#/components/responses/InternalServerError500
|
||||||
|
default:
|
||||||
|
$ref: '#/components/responses/DefaultError'
|
||||||
|
tags:
|
||||||
|
- Telemetry
|
||||||
|
description: ''
|
||||||
|
parameters:
|
||||||
|
- name: metric_name
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/GetMetricsRequest'
|
||||||
|
required: true
|
||||||
/v1/models/{model_id}:
|
/v1/models/{model_id}:
|
||||||
get:
|
get:
|
||||||
responses:
|
responses:
|
||||||
|
@ -5273,6 +5307,93 @@ components:
|
||||||
- created_at
|
- created_at
|
||||||
title: FileResponse
|
title: FileResponse
|
||||||
description: Response representing a file entry.
|
description: Response representing a file entry.
|
||||||
|
GetMetricsRequest:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
start_time:
|
||||||
|
type: integer
|
||||||
|
end_time:
|
||||||
|
type: integer
|
||||||
|
step:
|
||||||
|
type: string
|
||||||
|
query_type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- range
|
||||||
|
- instant
|
||||||
|
title: MetricQueryType
|
||||||
|
label_matchers:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
type: string
|
||||||
|
operator:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- '='
|
||||||
|
- '!='
|
||||||
|
- =~
|
||||||
|
- '!~'
|
||||||
|
title: MetricLabelOperator
|
||||||
|
default: '='
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- value
|
||||||
|
- operator
|
||||||
|
title: MetricLabelMatcher
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- start_time
|
||||||
|
- query_type
|
||||||
|
title: GetMetricsRequest
|
||||||
|
MetricDataPoint:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
timestamp:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
value:
|
||||||
|
type: number
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- timestamp
|
||||||
|
- value
|
||||||
|
title: MetricDataPoint
|
||||||
|
MetricSeries:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
metric:
|
||||||
|
type: string
|
||||||
|
labels:
|
||||||
|
type: object
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/MetricDataPoint'
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- metric
|
||||||
|
- labels
|
||||||
|
- values
|
||||||
|
title: MetricSeries
|
||||||
|
GetMetricsResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/MetricSeries'
|
||||||
|
additionalProperties: false
|
||||||
|
required:
|
||||||
|
- data
|
||||||
|
title: GetMetricsResponse
|
||||||
Model:
|
Model:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
|
@ -203,13 +203,11 @@ class QuerySpanTreeResponse(BaseModel):
|
||||||
data: dict[str, SpanWithStatus]
|
data: dict[str, SpanWithStatus]
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
|
||||||
class MetricQueryType(Enum):
|
class MetricQueryType(Enum):
|
||||||
RANGE = "range"
|
RANGE = "range"
|
||||||
INSTANT = "instant"
|
INSTANT = "instant"
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
|
||||||
class MetricLabelOperator(Enum):
|
class MetricLabelOperator(Enum):
|
||||||
EQUALS = "="
|
EQUALS = "="
|
||||||
NOT_EQUALS = "!="
|
NOT_EQUALS = "!="
|
||||||
|
@ -217,7 +215,6 @@ class MetricLabelOperator(Enum):
|
||||||
REGEX_NOT_MATCH = "!~"
|
REGEX_NOT_MATCH = "!~"
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
|
||||||
class MetricLabelMatcher(BaseModel):
|
class MetricLabelMatcher(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
value: str
|
value: str
|
||||||
|
@ -233,13 +230,12 @@ class MetricDataPoint(BaseModel):
|
||||||
@json_schema_type
|
@json_schema_type
|
||||||
class MetricSeries(BaseModel):
|
class MetricSeries(BaseModel):
|
||||||
metric: str
|
metric: str
|
||||||
labels: Dict[str, str]
|
labels: dict[str, str]
|
||||||
values: List[MetricDataPoint]
|
values: list[MetricDataPoint]
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
|
||||||
class GetMetricsResponse(BaseModel):
|
class GetMetricsResponse(BaseModel):
|
||||||
data: List[MetricSeries]
|
data: list[MetricSeries]
|
||||||
|
|
||||||
|
|
||||||
@runtime_checkable
|
@runtime_checkable
|
||||||
|
@ -292,8 +288,8 @@ class Telemetry(Protocol):
|
||||||
self,
|
self,
|
||||||
metric_name: str,
|
metric_name: str,
|
||||||
start_time: int,
|
start_time: int,
|
||||||
end_time: Optional[int] = None,
|
end_time: int | None = None,
|
||||||
step: Optional[str] = "1d",
|
step: str | None = "1d",
|
||||||
query_type: MetricQueryType = MetricQueryType.RANGE,
|
query_type: MetricQueryType = MetricQueryType.RANGE,
|
||||||
label_matchers: Optional[List[MetricLabelMatcher]] = None,
|
label_matchers: list[MetricLabelMatcher] | None = None,
|
||||||
) -> GetMetricsResponse: ...
|
) -> GetMetricsResponse: ...
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue