Files
qdrant/openapi/openapi.lib.yml
Jojii 70646af7a8 Add hardware measurements in API (#5306)
* add HwMeasurementAcc and API helpers+types

* add config to API to toggle hardware reporting in API responses

* add Default impl for HwMeasurementAcc

* comments

* review remarks

* include usage into API schema

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-10-29 09:53:22 +01:00

93 lines
1.9 KiB
YAML

#@ def response(model):
default:
description: error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
4XX:
description: error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"200":
description: successful operation
content:
application/json:
schema:
type: object
properties:
usage:
default: null
anyOf:
- $ref: '#/components/schemas/HardwareUsage'
- nullable: true
time:
type: number
format: float
description: Time spent to process this request
example: 0.002
status:
type: string
example: ok
result: #@ model
#@ end
#@ def response_with_accepted(model):
default:
description: error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
4XX:
description: error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"200":
description: successful operation
content:
application/json:
schema:
type: object
properties:
time:
type: number
format: float
description: Time spent to process this request
example: 0.002
status:
type: string
example: ok
result: #@ model
"202":
description: operation is accepted
content:
application/json:
schema:
type: object
properties:
time:
type: number
format: float
description: Time spent to process this request
status:
type: string
#@ end
#@ def reference(model_name):
$ref: #@ "#/components/schemas/" + model_name
#@ end
#@ def type(type_name):
type: #@ type_name
#@ end
#@ def array(type_data):
type: array
items: #@ type_data
#@ end