mirror of
https://github.com/kerberos-io/agent.git
synced 2026-11-29 00:00:55 +00:00
216 lines
5.5 KiB
YAML
216 lines
5.5 KiB
YAML
openapi: 3.0.3
|
|
info:
|
|
title: Kerberos Frame Processing API
|
|
version: 1.0.0
|
|
description: Reference contract for Agent frame submission and externally requested capture.
|
|
servers:
|
|
- url: http://localhost:8080
|
|
security:
|
|
- bearerAuth: []
|
|
paths:
|
|
/health:
|
|
get:
|
|
security: []
|
|
summary: Check service liveness
|
|
responses:
|
|
"200":
|
|
description: Service is healthy
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required: [status]
|
|
properties:
|
|
status:
|
|
type: string
|
|
enum: [healthy]
|
|
/v1/frames:
|
|
post:
|
|
summary: Process one Agent frame
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
multipart/form-data:
|
|
schema:
|
|
type: object
|
|
required: [metadata, frame]
|
|
properties:
|
|
metadata:
|
|
$ref: "#/components/schemas/FrameMetadata"
|
|
frame:
|
|
type: string
|
|
format: binary
|
|
encoding:
|
|
metadata:
|
|
contentType: application/json
|
|
frame:
|
|
contentType: image/jpeg
|
|
responses:
|
|
"200":
|
|
description: Frame processed
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/FrameResponse"
|
|
"400":
|
|
$ref: "#/components/responses/BadRequest"
|
|
"401":
|
|
$ref: "#/components/responses/Unauthorized"
|
|
"413":
|
|
description: Frame exceeds the configured request limit
|
|
"415":
|
|
description: Frame is not a valid JPEG
|
|
"422":
|
|
description: Metadata is invalid or expired
|
|
"502":
|
|
description: Processing or MQTT command publication failed
|
|
/v1/frame-requests:
|
|
post:
|
|
summary: Request a new frame from one or more Agents
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/FrameRequest"
|
|
responses:
|
|
"202":
|
|
description: Capture commands accepted for publication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/FrameRequestResponse"
|
|
"400":
|
|
$ref: "#/components/responses/BadRequest"
|
|
"401":
|
|
$ref: "#/components/responses/Unauthorized"
|
|
"422":
|
|
description: Request is invalid or expired
|
|
"502":
|
|
description: MQTT command publication failed
|
|
components:
|
|
securitySchemes:
|
|
bearerAuth:
|
|
type: http
|
|
scheme: bearer
|
|
responses:
|
|
BadRequest:
|
|
description: Malformed request
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Error"
|
|
Unauthorized:
|
|
description: Missing or invalid bearer token
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Error"
|
|
schemas:
|
|
FrameMetadata:
|
|
type: object
|
|
required:
|
|
- schemaVersion
|
|
- requestId
|
|
- frameId
|
|
- deviceId
|
|
- capturedAt
|
|
- expiresAt
|
|
- processingProfile
|
|
- sourceStream
|
|
- width
|
|
- height
|
|
properties:
|
|
schemaVersion:
|
|
type: string
|
|
enum: ["1.0"]
|
|
requestId:
|
|
type: string
|
|
frameId:
|
|
type: string
|
|
deviceId:
|
|
type: string
|
|
capturedAt:
|
|
type: integer
|
|
format: int64
|
|
description: Agent wall-clock capture time in Unix milliseconds.
|
|
expiresAt:
|
|
type: integer
|
|
format: int64
|
|
description: Unix milliseconds after which the frame must not be processed.
|
|
processingProfile:
|
|
type: string
|
|
sourceStream:
|
|
type: string
|
|
enum: [main, sub]
|
|
width:
|
|
type: integer
|
|
minimum: 1
|
|
height:
|
|
type: integer
|
|
minimum: 1
|
|
traceId:
|
|
type: string
|
|
FrameRequest:
|
|
type: object
|
|
required: [schemaVersion, deviceIds, processingProfile, expiresAt]
|
|
properties:
|
|
schemaVersion:
|
|
type: string
|
|
enum: ["1.0"]
|
|
requestId:
|
|
type: string
|
|
description: Generated by the service when omitted.
|
|
deviceIds:
|
|
type: array
|
|
minItems: 1
|
|
items:
|
|
type: string
|
|
processingProfile:
|
|
type: string
|
|
expiresAt:
|
|
type: integer
|
|
format: int64
|
|
traceId:
|
|
type: string
|
|
FrameResponse:
|
|
type: object
|
|
required: [schemaVersion, requestId, frameId, decision, reason]
|
|
properties:
|
|
schemaVersion:
|
|
type: string
|
|
enum: ["1.0"]
|
|
requestId:
|
|
type: string
|
|
frameId:
|
|
type: string
|
|
decision:
|
|
type: string
|
|
enum: [no-event, event]
|
|
reason:
|
|
type: string
|
|
FrameRequestResponse:
|
|
type: object
|
|
required: [schemaVersion, requestId, deviceIds, status]
|
|
properties:
|
|
schemaVersion:
|
|
type: string
|
|
enum: ["1.0"]
|
|
requestId:
|
|
type: string
|
|
deviceIds:
|
|
type: array
|
|
items:
|
|
type: string
|
|
status:
|
|
type: string
|
|
enum: [accepted]
|
|
Error:
|
|
type: object
|
|
required: [schemaVersion, error]
|
|
properties:
|
|
schemaVersion:
|
|
type: string
|
|
enum: ["1.0"]
|
|
error:
|
|
type: string |